Disease Models

How Disease Models Work: Main Steps

1. Initialization

  1. Define the Model Population

    • Specify total population by age, sex, etc.
    • Specify baseline prevalence of risk factors or diseases if applicable.
    • Set “base year” indexes to align the simulation with real calendar years.
  2. Set Up Disease States

    • Each disease typically has one or more health states (e.g., susceptible, infected, clinical, remission, etc.).
    • The model maps each “health state” to an internal index (so it can track transitions among these states).
  3. Load Parameters

    • Incidence rates, remission rates, mortality rates, plus other key parameters are loaded from data files or global settings.
    • Intervention coverage or other system settings (like “scale up” toggles) are set here.

2. Year-by-Year (or Timestep-by-Timestep) Progression

Once initialized, the core model runs in a loop over each year (or each time step). In the example code, we often see a loop from the base year to the final year. For each year:

  1. Update Risk Factors (If Applicable)

    • If the model simulates changes in risk factor prevalence or consumption, it updates them first.
    • Any interventions that reduce prevalence or shift consumption are applied.
  2. Set or Reset Baseline Transitions

    • The model has baseline transition rates (from susceptible to incident disease, from one severity level to another, from disease to death, etc.).
    • It may reset these to default values before applying the new year’s adjustments.
  3. Apply Intervention Impacts

    • For any prevention or treatment programs (e.g. new screening coverage, new medication coverage), the model adjusts the transition rates or the incidence accordingly.
    • This might be multiplicative or additive (e.g., incidence is multiplied by 0.9 if we have a 10% reduction).
  4. Iterate Through Time Steps

    • Some diseases (e.g., CVD) need monthly or weekly sub-steps to capture acute events. In the code, you see “NC_TimeStep” set to 10, 28, etc., indicating multiple sub-steps per year.
    • Within each sub-step, the model moves people from one health state to another according to those transition rates.

3. Population Dynamics and Aging

  1. Move Individuals Across Age Groups

    • At the end of each simulation year (or every time step), the model “ages” everyone by one year.
    • The oldest age category typically has a special rule so that it never empties entirely (some remain in the 80+ group, for instance).
  2. Births and Deaths

    • The model adds new births (who enter the youngest age group as healthy).
    • It removes from the population those who die (due to disease or background mortality).
  3. Keep Track of Incidence, Remission, and Mortality

    • Each cycle, the model calculates how many new cases (incidence) occur, how many existing cases are cured (remission), and how many die (mortality).
    • These are recorded as output results for that time period.

4. Calculating Health Metrics

Common health metrics in disease models include:

  • Prevalence: How many people have the disease in a given year.
  • Incidence: How many new cases occur during the year.
  • Mortality: How many die (disease-specific or all-cause).
  • YLD (Years Lived with Disability): Prevalence × disability weight.
  • YLL (Years of Life Lost): Deaths × remaining life expectancy.
  • DALYs (Disability-Adjusted Life Years): YLD + YLL.

At each time step, the model aggregates these based on the updated disease counts.


5. Equilibrium Runs (Optional)

Some models do an “equilibrium run” before the main simulation:

  • This means they run the model for a certain number of years to stabilize prevalence.
  • Then they begin their official “projection” from a stable baseline.
  • In the code, we see logic for skipping or enabling that “equilibrium run” (e.g., bEqWillBeSet, bEqIsSet, etc.).

6. Final Outputs and Totals

After looping through all years:

  1. Aggregate Final Results

    • The model sums or stores each year’s incidence, prevalence, mortality, or other measures.
    • It might also produce outputs by age group, sex, and year.
  2. Reporting

    • Finally, results are displayed or saved (for instance, to show how the disease burden changes from 2020 to 2040).

Summary

Disease models generally follow this pattern:

  1. Initialize (set up population, disease states, parameters).
  2. Update (apply interventions, risk factor changes each year).
  3. Advance (apply transitions for incidence, remission, mortality, stepping through sub-timesteps).
  4. Aging & Turnover (age cohorts, add births, remove deaths).
  5. Measure (record incidence, prevalence, deaths, DALYs, etc.).
  6. Loop over each simulation year until the end.
  7. Compile Results (totals or time-series data).