EoN.SIS_individual_based(G, tau, gamma, rho=None, Y0=None, nodelist=None, tmin=0, tmax=100, tcount=1001, transmission_weight=None, recovery_weight=None, return_full_data=False)[source]

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

See also: Hadjichrysanthou and Sharkey Epidemic control analysis: Desigining targeted intervention

strategies against epidemics propagated on contact networks,

Journal of Theoretical Biology

<dot{Y}_i> = tau sum_j g_{ij} (1-<Y_i>)<Y_j> - gamma_i <Y_i>


G networkx Graph

tau positive float
transmission rate of disease
gamma number
global recovery rate
rho float between 0 and 1 (default None)
initial uniformly random probability of being infected. Cannot define both rho and Y0.
Y0 numpy array (default None)
the array of initial infection probabilities. If Y0 is defined, nodelist must also be defined. If Y0 is defined, rho cannot be defined.
nodelist list (default None)
list of nodes in G in the same order as in Y0. If rho is defined and nodelist is not, then nodelist= G.nodes() Only affects returned values if return_full_data=True.
tmin number (default 0)
minimum report time
tmax number (default 100)
maximum report time
tcount integer (default 1001)
number of reports
transmission_weighta string (default None)
the label for a weight given to the edges. G.edge[i][j][transmission_weight] = g_{ij}
recovery_weight string (default None)
a label for a weight given to the nodes to scale their recovery rates so gamma_i = G.nodes[i][recovery_weight]*gamma
return_full_data (default False)
If True, returns times, Ss, Is if False, returns times, S, I
if return_full_data is True:
returns times, Ss, Is where times is a numpy array of times, Ss is a 2D numpy array Ss[i,j] gives probability nodelist[i] is susceptible at time times[j]. Similarly for Is.
if return_full data is False:
returns times, S, I all are numpy arrays. gives times, and expected number susceptible and expected number infected.
import networkx as nx
import EoN as EoN

G = nx.configuration_model([3,10]*1000)
N = G.order()
rho = 1./N
t, S, I = EoN.SIS_individual_based(G, 0.3, 1, rho=rho, tmax = 20)