EoN.SIS_individual_based_pure_IC¶
-
EoN.
SIS_individual_based_pure_IC
(G, tau, gamma, initial_infecteds, 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.
The difference between this and SIS_individual_based is that this one assumes a “pure initial condition”, that is, we know exactly what the statuses of the nodes are at the initial time.
<dot{Y}_i> = tau sum_j g_{ij} (1-<Y_i>)<Y_j> - gamma_i <Y_i>
Arguments: - G networkx Graph
- The contact network
- tau positive float
- transmission rate of disease
- gamma number (default
None
) - global recovery rate
- initial_infecteds list or set
- the set of nodes initially infected
- nodelist list (default
None
) - list of nodes in
G
in desired order. (only matters 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_weight 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
gamma_i = G.nodes[i][recovery_weight]*gamma
return_full_data boolean (default False)
Returns: - if return_full_data is True,
- returns times, Ss, Is
- if return_full_data is False,
- returns times, S, I
SAMPLE USE: import networkx as nx import EoN import matplotlib.pyplot as plt G = nx.configuration_model([3,10]*1000) nodelist = G.nodes() initial_infecteds = range(100) t, S, I = EoN.SIS_individual_based(G, 0.3, 1, initial_infecteds, nodelist, tmax = 20) plt.plot(t,I)