Skip to content

laser.measles.biweekly.components.process_infection

process_infection

InfectionParams

Bases: BaseInfectionParams

Parameters specific to the infection process component.

Examples:

1
2
3
from laser.measles.biweekly.components.process_infection import InfectionParams

params = InfectionParams(beta=0.57, seasonality=0.2)

beta_per_tick property

Transmission rate scaled from daily beta to the biweekly tick.

InfectionProcess(model, params=None)

Bases: BaseInfectionProcess

Component for simulating the spread of infection in the model.

This class implements a stochastic infection process that models disease transmission between different population groups. It uses a seasonally-adjusted transmission rate and accounts for mixing between different population groups.

The infection process follows these steps:

  1. Calculates expected new infections based on:

    • Base transmission rate (beta)
    • Seasonal variation
    • Population mixing matrix
    • Current number of infected individuals
  2. Converts expected infections to probabilities

  3. Samples actual new infections from a binomial distribution
  4. Updates population states:

    • Moves current infected to recovered (configurable recovery period)
    • Adds new infections to infected population
    • Removes new infections from susceptible population

Parameters:

Name Type Description Default
model BaseLaserModel

The simulation model containing population states and parameters

required
params InfectionParams | None

Component-specific parameters. If None, will use default parameters

None
Note

The infection process uses a configurable recovery period and seasonal transmission rate that varies sinusoidally over time.

Examples:

1
2
3
4
5
6
7
8
9
from laser.measles.scenarios.synthetic import single_patch_scenario
from laser.measles.biweekly import BiweeklyModel, BiweeklyParams
from laser.measles.biweekly import components
from laser.measles import create_component

scenario = single_patch_scenario(population=100_000, mcv1_coverage=0.85)
params = BiweeklyParams(num_ticks=52, seed=42, start_time="2000-01")
model = BiweeklyModel(scenario, params)
model.add_component(create_component(components.InfectionProcess, components.InfectionParams(beta=0.57)))

mixing_matrix property

The spatial mixing matrix in use. Shape (n_patches, n_patches).

Mirrors the same-named property on the ABM InfectionProcess so prompts can use one accessor regardless of model variant.