EoN.EBCM_pref_mix¶
- EoN.EBCM_pref_mix(N, Pk, Pnk, tau, gamma, rho=None, tmin=0, tmax=100, tcount=1001, return_full_data=False)[source]¶
Encodes the system derived in exercise 6.21 of Kiss, Miller, & Simon. Please cite the book if using this algorithm.
I anticipate eventually adding an option so that the initial condition is not uniformly distributed. So could give rho_k
- Arguments:
- N positive integer
number of nodes.
- Pk dict (could also be an array or a list)
Pk[k] is the probability a random node has degree k.
- Pnk dict of dicts (possibly array/list)
Pnk[k1][k2] is the probability a neighbor of a degree k1 node has degree k2.
- tau positive float
transmission rate
- gamma number
recovery rate
- rho number (optional)
initial proportion infected. Defaults to 1/N.
- tmin number (default 0)
minimum time
- tmax number (default 100)
maximum time
- tcount integer (default 1001)
number of time points for data (including end points)
- return_full_data boolean (default False)
whether to return theta or not
- Returns:
- if return_full_data == False:
returns t, S, I, R, all numpy arrays
- if …== True
returns t, S, I, R and theta where theta[k] is a numpy array giving theta for degree k