comorbidities.hiv
comorbidities.hiv
Simplified HIV disease model and TB-HIV connector for co-infection simulations.
Classes
| Name | Description |
|---|---|
| HIV | A simplified agent-based HIV disease model for use with the Starsim framework. |
| HIVState | HIV states: uninfected through advanced disease. |
| HivInterventions | Adjust HIV prevalence and/or ART coverage in a simulated population at each |
| TB_HIV_Connector | Connector between TB and HIV: multiplies TB activation risk by HIV-state-dependent |
HIV
comorbidities.hiv.HIV(pars=None, **kwargs)A simplified agent-based HIV disease model for use with the Starsim framework.
This model tracks HIV state progression through ACUTE, LATENT, and AIDS phases, influenced by whether the agent is receiving ART (antiretroviral therapy).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| - init_prev | Initial probability of infection (ACUTE). | required | |
| - init_onart | Probability of being on ART at initialization (if infected). | required | |
| - acute_to_latent | Daily transition probability from ACUTE to LATENT. | required | |
| - latent_to_aids | Daily transition probability from LATENT to AIDS. | required | |
| - aids_to_dead | Daily transition probability from AIDS to DEAD (unused). | required | |
| - art_progression_factor | Multiplier applied to progression probabilities for agents on ART. | required |
States
- state: HIV progression state (ATRISK, ACUTE, LATENT, AIDS, DEAD).
- on_ART: Boolean indicating whether agent is on ART.
Results
- hiv_prevalence: Proportion of total agents with HIV.
- infected: Total number of HIV-positive agents.
- on_art: Number of agents on ART.
- atrisk, acute, latent, aids: Percent of population in each state.
- n_active: Total number of agents in ACUTE, LATENT, or AIDS states.
Example
::
import starsim as ss
from tbsim.comorbidities.hiv import HIV
sim = ss.Sim(diseases=HIV(), pars=dict(start='2000', stop='2020'))
sim.run()
Methods
| Name | Description |
|---|---|
| init_results | Define HIV result channels (prevalence, state counts, ART coverage). |
| p_acute_to_latent | Calculate probability of HIV ACUTE → LATENT transition. |
| p_latent_to_aids | Calculate probability of HIV LATENT → AIDS transition. |
| set_prognoses | Assign initial HIV infection and ART status (called at t=0). |
| step | Progress HIV states; ART reduces transition probabilities. |
| update_results | Record HIV state distribution and ART counts for the current timestep. |
init_results
comorbidities.hiv.HIV.init_results()Define HIV result channels (prevalence, state counts, ART coverage).
p_acute_to_latent
comorbidities.hiv.HIV.p_acute_to_latent(sim, uids)Calculate probability of HIV ACUTE → LATENT transition.
p_latent_to_aids
comorbidities.hiv.HIV.p_latent_to_aids(sim, uids)Calculate probability of HIV LATENT → AIDS transition.
set_prognoses
comorbidities.hiv.HIV.set_prognoses()Assign initial HIV infection and ART status (called at t=0).
step
comorbidities.hiv.HIV.step()Progress HIV states; ART reduces transition probabilities.
update_results
comorbidities.hiv.HIV.update_results()Record HIV state distribution and ART counts for the current timestep.
HIVState
comorbidities.hiv.HIVState()HIV states: uninfected through advanced disease.
HivInterventions
comorbidities.hiv.HivInterventions(pars=None, **kwargs)Adjust HIV prevalence and/or ART coverage in a simulated population at each timestep within a date window.
Methods
| Name | Description |
|---|---|
| step | Adjust HIV prevalence and ART coverage to match targets each timestep. |
step
comorbidities.hiv.HivInterventions.step()Adjust HIV prevalence and ART coverage to match targets each timestep.
TB_HIV_Connector
comorbidities.hiv.TB_HIV_Connector(pars=None, **kwargs)Connector between TB and HIV: multiplies TB activation risk by HIV-state-dependent relative risk factors (ACUTE: 1.2202, LATENT: 1.9001, AIDS: 2.5955).
Example
::
import starsim as ss
import tbsim
from tbsim.comorbidities.hiv import HIV, HivInterventions, TB_HIV_Connector
tb = tbsim.TB(name='tb')
hiv = HIV(name='hiv')
conn = TB_HIV_Connector()
intv = HivInterventions()
sim = ss.Sim(diseases=[tb, hiv], connectors=conn, interventions=intv,
pars=dict(start='2000', stop='2020'))
sim.run()
Methods
| Name | Description |
|---|---|
| compute_tb_hiv_risk_rr | Compute per-agent TB relative risk multiplier based on HIV state. |
| step | Apply HIV-based risk multipliers to TB activation rates. |
compute_tb_hiv_risk_rr
comorbidities.hiv.TB_HIV_Connector.compute_tb_hiv_risk_rr(
tb,
hiv,
uids,
base_factor=1.0,
)Compute per-agent TB relative risk multiplier based on HIV state.
step
comorbidities.hiv.TB_HIV_Connector.step()Apply HIV-based risk multipliers to TB activation rates.