interventions.beta
interventions.beta
Intervention that modifies the TB transmission rate (beta) at specified time points.
Classes
| Name | Description |
|---|---|
| BetaByYear | A transmission reduction intervention that modifies the tuberculosis transmission rate (beta) |
BetaByYear
interventions.beta.BetaByYear(pars=None, *args, **kwargs)A transmission reduction intervention that modifies the tuberculosis transmission rate (beta) at specified time points during the simulation.
This intervention allows for modeling population-wide changes that affect disease transmission, such as policy changes, behavioral modifications, environmental improvements, or calibration scenarios. The intervention multiplies the current beta value by a specified factor at each target year, creating a sustained reduction in transmission rates.
IMPORTANT:
The modifier (x_beta) is always applied to the current/latest value of beta at the time of intervention, not the original or baseline value. This means that if multiple interventions are scheduled, each one will multiply the beta value as it exists after all previous modifications. The effect is cumulative and multiplicative.
For example
- If beta starts at 0.01, and x_beta=0.5 is applied in 2000, beta becomes 0.005.
- If another x_beta=0.8 is applied in 2010, beta becomes 0.004 (0.005 * 0.8).
- This is NOT a reset to the original value; each change compounds on the last.
Attributes
| Name | Type | Description |
|---|---|---|
| years | list | List of years when the intervention should be applied. Default is [2000]. |
| x_beta | float or list | Multiplicative factor(s) to apply to the current beta value. - If a single value, it is applied to all years. - If a list, it must be the same length as years, and each value is applied to the corresponding year. |
Behavior
- Each (year, x_beta) pair is applied only once. After application, both are removed from their lists.
- If x_beta is a list, its length must match years, or a ValueError is raised.
- Changes are applied to both the main disease beta parameter and all mixing pools in the network to ensure consistency.
- This is a multiplicative change, not additive. For example, x_beta=0.5 reduces transmission by 50%, while x_beta=0.8 reduces it by 20%.
- Multiple interventions compound: Each new x_beta is applied to the already-modified beta value.
Examples
# Reduce transmission by 50% in 2000
intervention = BetaByYear(pars={'years': [2000], 'x_beta': 0.5})
# Reduce transmission by 30% in multiple years (same factor)
intervention = BetaByYear(pars={'years': [2000, 2010, 2020], 'x_beta': 0.7})
# Use different factors for each year
intervention = BetaByYear(pars={'years': [2000, 2010, 2020], 'x_beta': [0.7, 0.8, 0.9]})
# Increase transmission by 20% in 2015
intervention = BetaByYear(pars={'years': [2015], 'x_beta': 1.2})Methods
| Name | Description |
|---|---|
| step | Execute the intervention step, applying beta modifications at specified years. |
step
interventions.beta.BetaByYear.step()Execute the intervention step, applying beta modifications at specified years.