Skip to content

epymorph.data.ipm.sirh

Defines a compartmental IPM for a generic SIRH model.

SIRH

Bases: CompartmentModel

A basic SIRH model.

compartments class-attribute instance-attribute

compartments = [
    compartment("S"),
    compartment("I"),
    compartment("R"),
    compartment("H", tags=["immobile"]),
]

The compartments of the model.

requirements class-attribute instance-attribute

requirements = [
    AttributeDef(
        "beta", type=float, shape=TxN, comment="infectivity"
    ),
    AttributeDef(
        "gamma",
        type=float,
        shape=TxN,
        comment="recovery rate",
    ),
    AttributeDef(
        "xi",
        type=float,
        shape=TxN,
        comment="immune waning rate",
    ),
    AttributeDef(
        "hospitalization_prob",
        type=float,
        shape=TxN,
        comment="a ratio of cases which are expected to require hospitalization",
    ),
    AttributeDef(
        "hospitalization_duration",
        type=float,
        shape=TxN,
        comment="the mean duration of hospitalization, in days",
    ),
]

The attributes required by the model.

edges

edges(symbols)

When implementing a CompartmentModel, override this method to define the transition edges between compartments.

Parameters:

  • symbols (ModelSymbols) –

    An object containing the symbols in the model for use in declaring edges. These include compartments and data requirements.

Returns: