Skip to content

laser.measles.abm.components.process_transmission

process_transmission

Component defining the TransmissionProcess, which models the transmission of measles in a population.

TransmissionParams

Bases: BaseModel

Parameters specific to the transmission process component.

Examples:

1
2
3
from laser.measles.abm.components.process_transmission import TransmissionParams

params = TransmissionParams(beta=0.3)

mu_underlying property

The mean of the underlying lognormal distribution.

sigma_underlying property

The standard deviation of the underlying lognormal distribution.

TransmissionProcess(model, params=None)

Bases: BasePhase

A component to model the transmission of disease in a population.

Examples:

1
2
3
4
5
6
7
8
9
from laser.measles.scenarios.synthetic import single_patch_scenario
from laser.measles.abm import ABMModel, ABMParams
from laser.measles.abm import components
from laser.measles import create_component

scenario = single_patch_scenario(population=50_000, mcv1_coverage=0.85)
params = ABMParams(num_ticks=365, seed=42, start_time="2000-01")
model = ABMModel(scenario, params)
model.add_component(create_component(components.TransmissionProcess, components.TransmissionParams(beta=0.3)))

Initializes the transmission object.

Parameters:

Name Type Description Default
model

The model object that contains the patches and parameters.

required

Attributes:

Name Type Description
model

The model object passed during initialization.

The model's patches are extended with the following scalar property:

  • 'incidence' (uint32, per patch): number of new infections during the most recent tick; overwritten each tick. For cumulative incidence over a run, sum this each tick yourself, or compute from per-tick decreases in S recorded by a StateTracker.

mixing property writable

Returns the mixing matrix, initializing if necessary

__call__(model, tick)

Simulate the transmission of measles for a given model at a specific tick.

This method updates the state of the model by simulating the spread of disease through the population and patches. It calculates the contagion, handles the migration of infections between patches, and updates the forces of infection based on the effective transmission rate and seasonality factors. Finally, it updates the infected state of the population.

Parameters:

Name Type Description Default
model object

The model object containing the population, patches, and parameters.

required
tick int

The current time step in the simulation.

required

Returns:

Type Description
None

None

infect(model, idx)

Infect a set of agents. Moves agents from S to E state and updates patch counters.

nb_lognormal_update(states, patch_ids, susceptibilties, forces, etimers, count, exp_mu, exp_sigma, flow)

Numba compiled function to stochastically transmit infection to agents in parallel.

numpy_lognormal_update(states, patch_ids, susceptibilties, forces, etimers, count, exp_mu, exp_sigma, flow)

Numpy function to stochastically transmit infection to agents.