Skip to content

Respiratory disease with adaptive behavior based on reported (or hospitalized) cases

A simple model of a respiratory disease with adaptive behavior determined by the number and rate of change of detected (reported or hospitalized) cases

RespxietyModel(config)

Bases: Model

A simple model of a respiratory disease with adaptive behavior determined by the number and rate of change of detected (reported or hospitalized) cases

Transition from S (susceptible) to E (exposed) depends on the parameter beta, which is modified by the risk coefficient cr = exp(-sens * p_infection), where sens is a model parameter representing risk sensitivity, and p_infection is an individual's perceived infection probability, based on a time-lagged assessment of reported case counts.

The parameters lrLevel and lrSlope represent the behavioral time lag. lrLevel is the rate at which individuals assimilate information about case counts, and lrSlope is the rate at which individuals respond to changes in the trend.

Transition from E occurs either to Id (detected infection) or Iu (undetected infection), depending on the detection rate, which is a function of time and model parameters as follows: The detection rate increases from 0 at the start of the simulation to thMax at a rate of thInc following a logistic function, and optionally decreases to thLow at a rate of thDec.

Source code in compartment/models/respxiety_model/model.py
def __init__(self, config):
    super().__init__(config)

get_initial_population(admin_zones, compartment_list, **kwargs) classmethod

Seed the initial infected across the two infectious compartments.

The base implementation seeds a single I compartment; this model seeds two infectious compartments: U (unreported and/or unhospitalized) and I (reported and/or hospitalized)

Parameters:

Name Type Description Default
admin_zones list[dict]

Admin zone dicts providing population and the infected_population percentage.

required
compartment_list list[str]

Ordered compartment names, used for column indexing.

required
**kwargs Any

Additional keyword arguments (unused).

{}

Returns:

Type Description
ndarray

Initial populations of shape (n_zones, n_compartments).

Source code in compartment/models/respxiety_model/model.py
@classmethod
def get_initial_population(cls, admin_zones, compartment_list, **kwargs):
    """Seed the initial infected across the two infectious compartments.

    The base implementation seeds a single ``I`` compartment; this model
    seeds two infectious compartments: U (unreported and/or unhospitalized)
    and I (reported and/or hospitalized)

    Args:
        admin_zones (list[dict]): Admin zone dicts providing ``population``
            and the ``infected_population`` percentage.
        compartment_list (list[str]): Ordered compartment names, used for
            column indexing.
        **kwargs (Any): Additional keyword arguments (unused).

    Returns:
        np.ndarray: Initial populations of shape
            ``(n_zones, n_compartments)``.
    """
    column_mapping = {value: index for index, value in enumerate(compartment_list)}
    initial_population = np.zeros((len(admin_zones), len(compartment_list)))

    for i, zone in enumerate(admin_zones):
        ## initial infections specified in config are unreported
        unreported = round(zone["infected_population"] / 100 * zone["population"], 2)
        ## simulation starts when 1 case is reported
        reported = 1
        susceptible = zone["population"] - (unreported + reported)
        initial_population[i, column_mapping["S"]] = susceptible
        initial_population[i, column_mapping["Iu"]] = unreported
        initial_population[i, column_mapping["Id"]] = reported

    return initial_population