EoN.SIR_homogeneous_pairwise

EoN.SIR_homogeneous_pairwise(S0, I0, R0, SI0, SS0, n, tau, gamma, tmin=0, tmax=100, tcount=1001, return_full_data=False)[source]

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

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

[dot{S}] = - tau [SI] [dot{I}] = au [SI] - gamma [I] [dot{R}] = gamma [I] ; [R] = N-[S]-[I] [dot{SI}] = -gamma [SI]+ au ((n-1)/n) [SI]([SS]-[SI])/[S]

  • au [SI]

[dot{SS}] = - 2 au ((n-1)/n) [SI][SS]/[S]

conserved quantities: [S]+[I]+[R] also
[SS]+[II]+[RR] + 2([SI] + [SR] + [IR])
Arguments:
S0 float
Initial number susceptible
I0 float
Initial number infected
R0 float
Initial number recovered
SI0 float
Initial number of SI edges
SS0 float
Initial number of SS edges
n float
Degree of nodes
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 (default False)
tells whether to just return times, S, I, R or all calculated data. if True, then returns times, S, I, R, SI, SS
Returns:
if return_full_data is True:
times, S, I, R, SI, SS
if return_full_data is False:
**times, S, I, R **
SAMPLE USE:
import networkx as nx
import EoN
S0 = 990
I0 = 10
R0 = 1
SI0 = 45
SS0 = 4900
n = 5
tau = 1
gamma = 2
t, S, I, R = EoN.SIR_homogeneous_pairwise(S0, I0, R0, SI0, SS0, n, tau, gamma,
                                            tmax = 20)