EoN.EBCM_discrete_from_graph

EoN.EBCM_discrete_from_graph(G, p, initial_infecteds=None, initial_recovereds=None, rho=None, tmin=0, tmax=100, return_full_data=False)[source]

Takes a given graph, finds the degree distribution (from which it gets psi), assumes a constant proportion of the population is infected at time 0, and then uses the discrete EBCM model.

Arguments:

G Networkx Graph

the contact network

p number

per edge transmission probability

initial infecteds node or iterable of nodes (default None)

if a single node, then this node is initially infected if an iterable, then whole set is initially infected if None, then choose randomly based on rho. If rho is also None, a random single node is chosen. If both initial_infecteds and rho are assigned, then there is an error.

initial_recovereds iterable of nodes (default None)

this whole collection is made recovered. Currently there is no test for consistency with initial_infecteds. Understood that everyone who isn’t infected or recovered initially is initially susceptible.

rho float between 0 and 1 (default None)

the fraction to be randomly infected at time 0 If None, then rho=1/N is used where N = G.order()

tmax number

maximum time

return_full_data boolean
if False,

return t, S, I, R and if True return t, S, I, R, and theta

Returns:

if return_full_data == False:

returns t, S, I, R, all numpy arrays

if …== True

returns t, S, I, R and theta, all numpy arrays