Skip to content

03. Health Conditions

Nao Yamamoto edited this page Oct 18, 2025 · 3 revisions

This page describes how health conditions (HCs) are defined, parameterized, and simulated in the MIGHTI framework.
MIGHTI supports both infectious and noncommunicable diseases, with flexible modeling capabilities for acquisition, progression, remission, and mortality.


Disease Classes

Health conditions in MIGHTI inherit from Starsim’s disease base classes and fall into the following categories:

  • RemittingDisease: Used for conditions that can spontaneously resolve or remit (e.g., depression)
  • ChronicDisease: Used for lifelong conditions without natural remission (e.g., chronic kidney disease)
  • AcuteDisease: Used for short-term conditions (e.g., road injuries)
  • GenericSIS: For infections with repeated acquisition and recovery (e.g., Flu)

Where They Are Defined

All health condition modules are located in:

mighti/diseases/

Each condition has its own file (e.g., type2diabetes.py, chronickidneydiseases.py, flu.py).

Each class inherits from a Starsim disease base and implements:

  • __init__() constructor with parameter loading
  • Methods to define disease acquisition, mortality, remission, and condition progression

Parameter File

Each disease reads parameters from a central CSV file (e.g., eswatini_parameters.csv):

Key fields include:

  • condition: Name of the disease (e.g., Type2Diabetes)
  • p_death: Annual conditional probability of death (if untreated)
  • dur_condition: Average duration of disease in years
  • rel_sus: Relative susceptibility if comorbid with HIV
  • remission_rate: Probability of spontaneous remission
  • disease_class: Class to use (ChronicDisease, RemittingDisease, etc.)

Parameters are loaded using:

self.pars = get_disease_parameters(csv_path, disease_name)

Initialization

Disease modules are added in your script like this:

cls = getattr(mi, dis, None)
if cls is not None:
    disease_objects.append(cls(csv_path=csv_path_params, pars={"init_prev": ss.bernoulli(get_prev_fn(dis))}))

Each disease will:

  • Initialize agents with prevalence (by age/sex or fixed)
  • Track individual state (e.g., affected, cured, dead)
  • Be eligible for interventions or interactions

Disease Dynamics

Each module can define:

  • update(): What happens each timestep (e.g., disease progression, mortality)
  • calculate_p_acquire(): Acquisition probability (baseline or modulated by risk)
  • update_mortality(): If the disease contributes to death
  • update_remission(): If remission is possible

These follow the Starsim framework and are invoked automatically in the simulation loop.


Adding New Conditions

To add a new disease:

  1. Create a new Python file in mighti/diseases/
  2. Inherit from one of the base classes
  3. Define __init__() and relevant update methods
  4. Add parameter row in the CSV
  5. Add the condition name to your script and prevalence file

Example:

class MyDisease(ChronicDisease):
    def __init__(self, csv_path=None, pars=None):
        super().__init__()
        self.load_parameters(csv_path, 'MyDisease')

Related Files

  • mighti/diseases/base_disease.py: Base disease classes
  • mighti/diseases/*.py: One file per disease
  • mighti/data/eswatini_parameters.csv: Parameter file

Clone this wiki locally