EoN.SIR_heterogeneous_meanfield

EoN.SIR_heterogeneous_meanfield(Sk0, Ik0, Rk0, tau, gamma, tmin=0, tmax=100, tcount=1001, return_full_data=False)[source]

Encodes System (5.11) of Kiss, Miller, & Simon. Please cite the book if using this algorithm.

In the text this is often referred to as the “heterogeneous mean-field model closed at the level of pairs”

This is also called Degree-baded Mean Field or Mean Field Social Heterogeneity

Ik0 and Rk0 are similar to Sk0.

[S_k] = [S_k](0) theta^k [I_k] = [N_k] - [S_k] - [R_k] [dot{R}_k] = gamma [I_k] pi_I = sum_k k[I_k]

Arguments:

Sk0 array

Sk0[k] is the number of nodes that are susceptible and have degree k (even if some degrees missing).

Ik0 array

as in Sk0

Rk0 array

as in Sk0

tau positive float

transmission rate

gamma number

recovery rate

tmin number (default 0)

minimum report time

tmax number (default 100)

maximum report time

tcount integer (default 1001)

number of reports

return_full_data boolean

tells whether to just return times, S, I, R or all calculated data.

Returns:

if return_full_data is True:

times, S, I, R, Sk, Ik, Rk (the Xk are numpy 2D arrays)

if return_full_data is False:

times, S, I, R (all numpy arrays)

SAMPLE USE:

import networkx as nx
import EoN
Sk0 = [995, 995, 995, 995, 995]
Ik0 = [5, 5, 5, 5, 5]
Rk0 = [0,0,0,0,0]
tau = 1
gamma = 2
t, S, I, R = EoN.SIR_heterogeneous_meanfield(Sk0, Ik0, Rk0, tau, gamma,
                                                tmax = 10)