ModelSIRMixing#
- class epiworldpy.epimodels.ModelSIRMixing(self: epiworldpy._core.epimodels.ModelSIRMixing, vname: str, n: SupportsInt | SupportsIndex, prevalence: SupportsFloat | SupportsIndex, transmission_rate: SupportsFloat | SupportsIndex, recovery_rate: SupportsFloat | SupportsIndex, contact_matrix: collections.abc.Sequence[SupportsFloat | SupportsIndex])#
Bases:
ModelSusceptible-Infected-Recovered (SIR) model with mixing between groups.
States:
Susceptible,Infected,Recovered.Agents are split into groups with
Entityobjects (add them withadd_entity()before running), and contacts between groups followcontact_matrix. The model creates itsnagents itself.Create a SIR model with mixing.
- Parameters:
vname (str) – Name of the virus.
n (int) – Number of agents.
prevalence (float) – Initial proportion of agents with the virus.
transmission_rate (float) – Probability of transmission per contact, between 0 and 1.
recovery_rate (float) – Daily probability of recovery, between 0 and 1.
contact_matrix (list of float) – Flattened
G x Gmatrix, whereGis the number of entities; entry(i, j)is the expected number of daily contacts an agent in groupihas with agents in groupj, so the row sums are the expected contacts per day of each group. The matrix is stored by columns: flatten a NumPy array withm.flatten(order="F").