Epidemics module¶
This module provides functions related to the simulation and measurement of epidemics.
-
class
tacoma.epidemics.
SIR_weighted
(N, weighted_edge_tuples, infection_rate, recovery_rate, number_of_initially_infected)[source]¶ Bases:
object
-
force_of_infection_on_node
= []¶
-
infected
= []¶
-
node_status
= []¶
-
rates
¶
-
-
class
tacoma.epidemics.
SIS_weighted
(N, weighted_edge_tuples, infection_rate, recovery_rate, number_of_initially_infected)[source]¶ Bases:
object
-
force_of_infection_on_node
= []¶
-
infected
= []¶
-
node_status
= []¶
-
rates
¶
-
-
tacoma.epidemics.
get_SIS_critical_infection_rate
(tn, recovery_rate, method='Powell', arpackmaxiter=10000, arpacktol=1e-09)[source]¶
-
tacoma.epidemics.
get_SIS_critical_recovery_rate
(tn, infection_rate, method='Powell', arpackmaxiter=10000, arpacktol=1e-09)[source]¶
-
tacoma.epidemics.
get_SIS_max_eigenvalue
(tn, infection_rate, recovery_rate, maxiter=10000, tol=1e-09)[source]¶
-
tacoma.epidemics.
simulate_and_measure_i_inf
(temporal_network_or_model, epidemic_object, t_equilibrate, is_static=False, verbose=False)[source]¶ Get the equilibrium ratio of infected.
Parameters: - temporal_network_or_model (
_tacoma.edge_changes
,_tacoma.edge_lists
,_tacoma.edge_changes_with_histograms
,_tacoma.edge_lists_with_histograms
, or_tacoma.EdgeActivityModel
.) – An instance of a temporal network or network model. - epidemic_object (
_tacoma.SI
,_tacoma.SIS
,_tacoma.SIR
,_tacoma.SIRS
,_tacoma.node_based_SIS
) – An initialized epidemic object. - t_equilibrate (float) – Time passed after t0 after which to start measuring.
- is_static (bool, default : False) – The algorithm works a bit differently if it knows that the network is actually static.
It works only with instances of
_tacoma.edge_lists
. - verbose (bool, optional) – Be chatty.
Returns: - i_inf (float) – Temporal average over the ratio of infected after equilibration.
- i_inf_std (float) – RMSE of the ratio of infected.
- R0 (float) – As measured after equilibration
- temporal_network_or_model (