EoN.EBCM_pref_mix_discrete

EoN.EBCM_pref_mix_discrete(N, Pk, Pnk, p, rho=None, tmin=0, tmax=100, return_full_data=False)[source]

Encodes the discrete version of 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.

p positive float (0 <= p <= 1)

transmission probability

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 is a dict and theta[k] is the thetas for given k.