Last Updated June 13, 2026
Mathematical modeling in public health and epidemiology uses formal representations to understand disease transmission, population risk, intervention effects, health-system demand, uncertainty, and public decision-making. Epidemiological models connect infections, contacts, susceptibility, immunity, behavior, testing, surveillance data, healthcare capacity, social conditions, policy choices, and uncertainty.
Public health models are used to study infectious disease spread, vaccination strategies, screening programs, outbreak response, hospital demand, environmental exposure, chronic disease risk, health behavior, resource allocation, and policy interventions. They help decision-makers ask what is happening, what may happen next, which interventions may reduce harm, and where evidence is uncertain.
Responsible public health modeling requires transparent assumptions, careful surveillance interpretation, validation, uncertainty communication, equity review, ethical governance, and humility about real populations. A model can clarify risk, but it cannot replace public health judgment, community trust, clinical evidence, or institutional accountability.

Epidemiological models are powerful because they connect individual events to population dynamics. A single infection can become part of a transmission chain. A testing delay can distort surveillance. A policy intervention can change contact patterns. A vaccination campaign can alter susceptibility. Public health modeling helps these relationships become visible enough for analysis and action.
Why Modeling Matters in Public Health and Epidemiology
Mathematical modeling matters in public health because population health problems unfold through dynamic systems. Disease transmission depends on contact patterns, susceptibility, immunity, behavior, environments, testing, treatment, institutions, and time. Public health decisions must often be made before complete evidence exists.
Models help public health teams estimate risk, compare interventions, plan capacity, anticipate demand, identify fragile assumptions, and communicate uncertainty. During outbreaks, models can support decisions about testing, vaccination, isolation guidance, hospital preparedness, community mitigation, and resource allocation. In non-emergency settings, models support screening policy, chronic disease prevention, environmental health, and health-system planning.
| Public health need | Modeling contribution | Example |
|---|---|---|
| Outbreak detection | Identifies growth patterns, clusters, and reporting anomalies. | Case counts, wastewater signals, syndromic surveillance. |
| Transmission analysis | Represents how infections move through populations. | SIR, SEIR, contact-network, or agent-based models. |
| Intervention comparison | Tests possible effects of public health actions. | Vaccination, testing, isolation, ventilation, masking, treatment access. |
| Capacity planning | Estimates demand on hospitals, clinics, staff, beds, or supplies. | ICU demand, antiviral allocation, emergency staffing. |
| Risk assessment | Connects likelihood, exposure, vulnerability, and consequence. | High-risk groups, occupational exposure, environmental hazards. |
| Public accountability | Documents assumptions, uncertainty, equity review, and use limits. | Policy memo, public dashboard, model governance record. |
Public health modeling is most useful when it supports timely, evidence-aware action without pretending that uncertainty, ethics, or judgment have disappeared.
What Public Health and Epidemiological Models Do
Public health models serve different roles. Some describe current conditions. Some estimate hidden states such as true infections. Some forecast possible demand. Some test policy scenarios. Some evaluate whether an intervention plausibly reduced harm. Others support allocation, surveillance, or communication.
These roles should not be confused. A model designed for scenario exploration may not be a precise forecast. A model designed to estimate transmission may not be adequate for allocating scarce care. A public dashboard may communicate trends without explaining causal mechanisms.
| Model role | Public health question | Typical output |
|---|---|---|
| Descriptive model | What is observed? | Trend, rate, map, outbreak curve, or surveillance dashboard. |
| Transmission model | How does disease spread through a population? | Compartment flows, contact rates, reproduction number, attack rate. |
| Forecast model | What may happen under current assumptions? | Projected cases, hospitalizations, deaths, or demand intervals. |
| Scenario model | What happens under alternative interventions or futures? | Scenario comparison, stress test, or intervention pathway. |
| Evaluation model | What effect did an intervention have? | Counterfactual comparison, impact estimate, uncertainty range. |
| Allocation model | How should limited resources be distributed? | Priority list, capacity plan, or constrained allocation. |
Good public health modeling begins by naming the model role and approved use. Without that clarity, outputs can drift into decisions for which they were not designed, validated, or ethically reviewed.
Populations, Risk, and Surveillance Data
Epidemiological models depend on population structure and surveillance evidence. Population structure includes age, geography, households, workplaces, schools, immunity, health conditions, occupation, access to care, and social vulnerability. Surveillance evidence includes reported cases, tests, hospitalizations, deaths, wastewater signals, serology, syndromic indicators, genomic surveillance, and field investigations.
Surveillance data are never a transparent mirror of reality. Reported case counts depend on who gets tested, who seeks care, which tests are available, how results are reported, and whether public health systems have enough capacity to detect events.
| Data issue | Public health implication | Modeling response |
|---|---|---|
| Underreporting | Reported cases may underestimate true infections. | Use detection-rate assumptions, serology, hospitalization, or wastewater signals. |
| Testing bias | People with access or symptoms may be overrepresented. | Adjust interpretation and document surveillance limits. |
| Reporting delay | Current data may reflect past transmission. | Use delay adjustment and nowcasting where appropriate. |
| Population heterogeneity | Risk differs across groups and places. | Use stratified, spatial, or network-aware models. |
| Changing definitions | Case, death, or hospitalization definitions may shift. | Check comparability over time. |
| Missing context | Data may omit behavior, access, housing, or workplace exposure. | Use contextual variables and equity review. |
Public health models should treat surveillance quality as part of interpretation. Weak or biased data do not make modeling impossible, but they change what conclusions are justified.
Transmission, Contact Structure, and Susceptibility
Transmission depends on contact structure. People do not mix randomly in most real settings. Contacts occur through households, schools, workplaces, transportation systems, healthcare settings, congregate living environments, social networks, and community spaces. Susceptibility and infectiousness also vary across time and population groups.
Contact assumptions are among the most important choices in epidemiological modeling. A simple model may assume homogeneous mixing. A more detailed model may stratify by age, geography, behavior, occupation, or network position.
| Transmission element | Modeling meaning | Interpretive issue |
|---|---|---|
| Contact rate | How often potentially infectious contact occurs. | Changes with behavior, policy, season, school, work, and mobility. |
| Transmission probability | Chance that contact produces infection. | Depends on pathogen, environment, ventilation, immunity, and protection. |
| Susceptibility | Probability that exposure leads to infection. | Varies with immunity, vaccination, prior infection, health status, and age. |
| Infectiousness | Ability of infected person to transmit. | Changes over infection stage and across individuals. |
| Network structure | Pattern of who contacts whom. | Clusters and superspreading can dominate spread. |
| Behavioral response | Changes in contact or protection due to risk perception or policy. | Feedback can alter model assumptions during an outbreak. |
Transmission models should make contact assumptions explicit because those assumptions often drive intervention conclusions.
Compartmental Models and Disease Dynamics
Compartmental models represent populations as groups that move between health states. A simple SIR model divides the population into susceptible, infectious, and recovered compartments. More detailed models may include exposed, asymptomatic, hospitalized, vaccinated, quarantined, deceased, or waning-immunity compartments.
Compartmental models are useful because they make disease dynamics explicit. They show how susceptibility, transmission, recovery, immunity, and intervention shape outbreak trajectories over time.
| Compartment | Meaning | Modeling concern |
|---|---|---|
| Susceptible | People who can become infected. | Susceptibility may vary by immunity, age, or exposure. |
| Exposed | People infected but not yet infectious or detected. | Latent periods and testing delays matter. |
| Infectious | People able to transmit. | Infectiousness changes over time and by context. |
| Recovered | People no longer infectious and possibly immune. | Immunity may wane or vary. |
| Hospitalized | People requiring care. | Hospitalization depends on severity, access, and admission practice. |
| Vaccinated | People with vaccine-derived protection. | Protection can differ for infection, severe disease, and transmission. |
Compartmental models are strongest when their compartments match the public health question. A model for hospital demand needs different detail than a model for basic transmission learning.
Reproduction Numbers and Epidemic Growth
Reproduction numbers are central in infectious disease modeling. The basic reproduction number, often written \(R_0\), describes the expected number of secondary infections caused by one infectious person in a fully susceptible population under specified conditions. The effective reproduction number, often written \(R_t\), describes transmission under current conditions, including immunity, behavior, interventions, and population structure.
Reproduction numbers are useful but often misunderstood. They are not fixed properties of a pathogen alone. They depend on context, contact patterns, immunity, environment, and behavior.
| Quantity | Meaning | Interpretive caution |
|---|---|---|
| \(R_0\) | Expected secondary infections in a fully susceptible population. | Depends on assumptions about contact and context. |
| \(R_t\) | Expected secondary infections at time \(t\). | Changes with behavior, immunity, season, and intervention. |
| Growth rate | Speed at which cases increase or decline. | Reporting delays and testing changes can distort estimates. |
| Generation interval | Time between infection in one case and infection in secondary cases. | Uncertainty affects reproduction-number estimates. |
| Attack rate | Proportion infected over a period or outbreak. | Depends on detection and population definition. |
| Herd immunity threshold | Approximate immunity level needed to reduce spread under assumptions. | Heterogeneity and waning immunity complicate simple thresholds. |
A reproduction number should be communicated as an estimate under assumptions, not as a complete summary of epidemic risk.
Interventions, Scenarios, and Counterfactuals
Public health modeling often compares interventions. These may include vaccination, testing, treatment, isolation, ventilation, masking, vector control, screening, contact tracing, communication campaigns, harm reduction, environmental regulation, or access improvements.
The challenge is counterfactual reasoning: what would have happened without the intervention? Public health models can estimate counterfactual trajectories, but the estimate depends on assumptions about behavior, baseline transmission, surveillance, timing, and confounding factors.
| Intervention modeling element | Public health meaning | Review question |
|---|---|---|
| Timing | When the intervention begins and how fast it scales. | Could earlier or delayed implementation change outcomes? |
| Coverage | Who receives or follows the intervention. | Are high-risk groups reached? |
| Effectiveness | How strongly the intervention changes risk. | Is effectiveness estimated from relevant evidence? |
| Adherence | How consistently people or institutions implement the action. | Does the model assume unrealistic compliance? |
| Behavioral feedback | How people respond to risk or policy. | Could risk compensation or fatigue alter results? |
| Counterfactual baseline | What would happen without intervention. | Is the baseline plausible and transparent? |
Intervention models should show not only projected outcomes, but also the assumptions that make those outcomes plausible.
Health-System Capacity and Resource Planning
Public health models often support capacity planning. Health systems need to anticipate demand for beds, staff, intensive care, emergency departments, testing, vaccines, medications, protective equipment, laboratory capacity, and community services.
Capacity models connect disease dynamics to healthcare demand. They translate infections into symptomatic cases, severe cases, admissions, length of stay, staffing needs, and resource use. Small changes in assumptions can produce large differences in projected capacity stress.
| Capacity element | Modeling representation | Planning concern |
|---|---|---|
| Incident infections | New infections over time. | Leading indicator of future demand. |
| Severity probability | Chance of hospitalization or severe outcome. | Varies by age, immunity, comorbidity, and access. |
| Admission delay | Time from infection or symptoms to hospitalization. | Capacity pressure lags transmission. |
| Length of stay | Duration of resource use. | Determines bed occupancy and staff burden. |
| Available capacity | Beds, staff, equipment, labs, or services. | Nominal capacity may exceed usable capacity. |
| Equity of access | Who can obtain services. | Aggregate capacity can hide unequal access. |
Capacity modeling is a public health decision-support tool. It should be updated with real-world operational data and interpreted with healthcare system expertise.
Uncertainty, Sensitivity, and Robustness
Public health models operate under uncertainty. True infection counts may be unknown. Transmission rates may change. Behavior may shift. New variants, pathogens, or environmental conditions may emerge. Intervention effects may differ across populations. Data may lag reality.
Uncertainty should be communicated as part of public health reasoning. Decision-makers need to know which conclusions are robust, which are fragile, and which assumptions matter most.
| Uncertainty source | Public health implication | Modeling response |
|---|---|---|
| Surveillance uncertainty | Observed cases may not equal true infections. | Use detection assumptions and alternative indicators. |
| Parameter uncertainty | Transmission, recovery, severity, and delay estimates vary. | Use sensitivity analysis and uncertainty intervals. |
| Behavioral uncertainty | Contact patterns and adherence may change. | Use scenarios and adaptive updating. |
| Structural uncertainty | Model form may omit important compartments or feedbacks. | Compare model structures. |
| Equity uncertainty | Data may not capture subgroup risk or access barriers. | Use stratification, coverage review, and stakeholder input. |
| Policy uncertainty | Implementation may differ from model assumptions. | Model practical capacity and monitor real uptake. |
Robust public health modeling asks whether a decision remains reasonable across plausible assumptions, not only whether it performs well under one forecast.
Validation and Real-World Evidence
Epidemiological model validation is difficult because outbreaks evolve while models are being used. Data change, behavior changes, testing changes, and interventions alter the system being modeled. Still, validation is essential.
Validation should be tied to intended use. A model may be adequate for short-term hospital demand planning but not for long-term policy evaluation. A model may be useful for scenario comparison but not for precise local forecasting.
| Validation question | Evidence type | Use-limit issue |
|---|---|---|
| Does the model fit historical data? | Observed cases, hospitalizations, deaths, or other indicators. | Historical fit may reflect changing surveillance. |
| Does it predict near-term outcomes? | Prospective forecast comparison. | Short-term performance may not hold under behavior or variant change. |
| Does it match independent indicators? | Wastewater, serology, syndromic data, genomic surveillance. | Indicators may reflect different populations or delays. |
| Does it perform across groups? | Stratified validation and subgroup diagnostics. | Aggregate accuracy may hide inequitable error. |
| Does it support the decision? | Purpose-specific evidence review. | Exploratory model should not be used as decisive allocation tool. |
| Does it remain current? | Monitoring, drift checks, and model updates. | Stale model can mislead public response. |
A public health model should always state its domain of validity. Model evidence becomes risky when separated from its data, assumptions, and intended use.
Equity, Distribution, and Public Trust
Public health modeling has direct equity implications. Disease exposure, vulnerability, access to care, testing availability, vaccination coverage, occupational risk, housing conditions, environmental burden, and trust in institutions are not evenly distributed.
A model that improves aggregate accuracy may still fail vulnerable groups. A model that optimizes resource allocation may still reproduce unequal access if the data reflect unequal detection, service contact, or institutional visibility.
| Equity issue | Modeling question | Review artifact |
|---|---|---|
| Differential exposure | Who faces higher contact, workplace, housing, or environmental risk? | Exposure and vulnerability review. |
| Differential detection | Who is more or less visible in surveillance data? | Data coverage and testing access note. |
| Differential severity | Who faces higher hospitalization or death risk? | Severity stratification and uncertainty review. |
| Differential access | Who can obtain prevention, testing, treatment, or care? | Access and allocation review. |
| Differential model error | Does the model perform differently across groups? | Subgroup validation report. |
| Public trust | Can affected communities understand and contest model use? | Communication and governance record. |
Equity is not an optional add-on in public health modeling. It is part of whether the model supports responsible public action.
Communicating Epidemiological Model Results
Public health models must be communicated carefully because they can influence public behavior, institutional decisions, media coverage, and trust. Communication should explain what the model estimates, what it assumes, what remains uncertain, what decisions remain human, and what actions are supported by the evidence.
Overconfident communication can damage trust when projections change. Under-communication can leave people unprepared. Responsible communication frames model outputs as conditional evidence.
| Communication need | Weak framing | Better framing |
|---|---|---|
| Forecast | “There will be 10,000 cases next month.” | “Under current assumptions, the model projects 7,000 to 13,000 reported cases.” |
| Scenario | “This is what will happen.” | “This is what the model estimates under this intervention scenario.” |
| Intervention | “The model proves this policy is best.” | “This option reduces projected hospital demand under stated assumptions.” |
| Uncertainty | “The numbers changed, so the model was wrong.” | “The model updates as data, behavior, and assumptions change.” |
| Equity | “Average risk is declining.” | “Average risk is declining, but subgroup and access differences require review.” |
| Accountability | “The model says we must do this.” | “Public health officials chose this action using model evidence and broader judgment.” |
Good communication protects both public understanding and institutional accountability.
Major Model Families in Public Health and Epidemiology
Public health and epidemiology use many model families. The right model depends on the disease, data, intervention, time horizon, population structure, and decision context.
| Model family | Use | Example |
|---|---|---|
| Compartmental models | Represent population movement between disease states. | SIR, SEIR, vaccinated compartments, hospitalization compartments. |
| Statistical surveillance models | Detect trends, anomalies, and reporting patterns. | Nowcasting, outbreak detection, excess mortality models. |
| Network models | Represent contact structure and transmission pathways. | Households, schools, workplaces, sexual networks, healthcare networks. |
| Agent-based models | Represent heterogeneous individuals and behaviors. | Local spread, intervention adherence, mobility, school reopening scenarios. |
| Forecasting models | Project cases, hospitalizations, deaths, or demand. | Short-term epidemic forecasts or capacity forecasts. |
| Risk models | Estimate individual or population risk. | Severity risk, screening risk, environmental exposure risk. |
| Optimization models | Allocate scarce resources under constraints. | Vaccine allocation, testing locations, staff deployment. |
| Evaluation models | Estimate intervention effects. | Difference-in-differences, causal models, counterfactual simulations. |
No model family is universally best. Responsible public health modeling matches model form to question, data, uncertainty, population, and decision use.
Mathematical Lens: Epidemiological Models as Population-State Representations
A basic compartmental model represents a population as states that change over time:
N = S(t)+I(t)+R(t)
\]
Interpretation: Population \(N\) is divided into susceptible \(S(t)\), infectious \(I(t)\), and recovered \(R(t)\) groups at time \(t\).
A simple SIR model can be written as:
\frac{dS}{dt}=-\beta\frac{S I}{N}
\]
Interpretation: Susceptible people leave the susceptible compartment through effective contact with infectious people.
\frac{dI}{dt}=\beta\frac{S I}{N}-\gamma I
\]
Interpretation: Infectious cases increase through transmission and decrease through recovery or removal.
\frac{dR}{dt}=\gamma I
\]
Interpretation: Recovered or removed cases accumulate at rate \(\gamma I\).
The basic reproduction number in this simplified model is:
R_0=\frac{\beta}{\gamma}
\]
Interpretation: \(R_0\) compares transmission rate \(\beta\) with recovery or removal rate \(\gamma\) under the model’s assumptions.
A capacity-risk expression can be written as:
P(H_t \gt C_t)\leq \alpha
\]
Interpretation: The probability that healthcare demand \(H_t\) exceeds capacity \(C_t\) should remain below risk tolerance \(\alpha\).
The mathematical lesson is that epidemiological models connect biological process, population structure, behavior, surveillance, and intervention assumptions. Their outputs are conditional on those choices.
Example: SIR Modeling Under Intervention Scenarios
Consider a simplified infectious disease model in which public health officials compare several intervention scenarios. A baseline scenario assumes current transmission. A moderate intervention reduces effective contact. A stronger intervention reduces contact further. A vaccination scenario reduces the susceptible pool and severe outcomes.
| Model element | Epidemiological meaning | Interpretive issue |
|---|---|---|
| Susceptible population | People who can become infected. | Immunity and vaccination may vary across groups. |
| Transmission rate | Effective contact leading to infection. | Behavior, policy, season, and environment affect contact. |
| Recovery rate | Rate at which people leave infectious state. | Depends on disease duration and isolation assumptions. |
| Intervention effect | Reduction in transmission, severity, or exposure. | Effectiveness and adherence are uncertain. |
| Peak infectious cases | Maximum burden at one time. | Peak timing and magnitude affect capacity planning. |
| Hospital demand | Severe cases requiring care. | Severity, access, and length of stay matter. |
The model helps compare scenarios, but it should not be interpreted as a guarantee. Its conclusions depend on surveillance data, parameter assumptions, population structure, intervention implementation, and changing behavior.
Models, Public Health Action, and Decision Support
Public health modeling supports decisions under time pressure and uncertainty. The goal is not simply to predict the future. It is to help institutions choose actions that reduce harm, preserve capacity, improve equity, and adapt as evidence changes.
| Decision-support function | Model role | Public health question |
|---|---|---|
| Early warning | Detects growth, clusters, or capacity stress. | Should surveillance or response escalate? |
| Intervention comparison | Projects outcomes under different actions. | Which option plausibly reduces harm? |
| Capacity planning | Estimates demand for healthcare resources. | When and where may systems be overwhelmed? |
| Allocation | Distributes scarce resources under constraints. | Who should receive limited tests, vaccines, treatment, or staff first? |
| Communication | Makes uncertainty and assumptions understandable. | How should public risk be explained without false certainty? |
Decision support is strongest when model evidence is combined with field investigation, clinical expertise, community knowledge, legal authority, operational capacity, and ethical review.
Ethical Stakes of Public Health Modeling
Public health models have ethical stakes because they can influence restrictions, resource allocation, risk communication, access to care, surveillance practices, vaccination strategies, school policy, workplace safety, and public trust. A model can reduce harm, but it can also amplify inequity if used without care.
Ethical modeling requires transparency, proportionality, equity review, privacy protection, contestability, humility, and accountability. Public health models should support public well-being without hiding value judgments inside technical language.
| Ethical issue | Modeling risk | Responsible response |
|---|---|---|
| False certainty | Conditional projections are presented as certain outcomes. | Communicate ranges, scenarios, and assumptions. |
| Unequal burden | Interventions impose costs unevenly across groups. | Use distributional and equity review. |
| Data privacy | Surveillance or contact data expose individuals or communities. | Use privacy-preserving governance and data minimization. |
| Automation bias | Officials defer to model outputs without judgment. | Separate model evidence from decision authority. |
| Stigmatization | Risk maps or group labels create blame or discrimination. | Use careful communication and contextual explanation. |
| Accountability gap | Institution blames “the model” for public health decisions. | Assign human and institutional responsibility. |
Ethical public health modeling should strengthen protective action, public trust, and accountability rather than provide technical cover for unexamined decisions.
Python Workflow: Epidemiology Model Register and Intervention Review
The Python workflow below creates an epidemiology model register, simulates simplified SIR intervention scenarios, estimates peak infectious burden and capacity risk, flags review obligations, and writes a public health model review card.
# mathematical_modeling_in_public_health_and_epidemiology_workflow.py
# Dependency-light workflow for epidemiology model and intervention review.
from __future__ import annotations
from dataclasses import asdict, dataclass
from pathlib import Path
import csv
import json
import statistics
ARTICLE_ROOT = Path(__file__).resolve().parents[1]
OUTPUTS = ARTICLE_ROOT / "outputs"
TABLES = OUTPUTS / "tables"
JSON_DIR = OUTPUTS / "json"
@dataclass(frozen=True)
class PublicHealthModelRecord:
key: str
domain: str
model_role: str
model_family: str
public_health_question: str
status: str
@dataclass(frozen=True)
class EpidemicScenario:
key: str
scenario_name: str
population: float
initial_infectious: float
initial_recovered: float
beta: float
gamma: float
days: int
hospital_capacity: float
hospitalization_rate: float
def public_health_model_register() -> list[PublicHealthModelRecord]:
return [
PublicHealthModelRecord(
key="transmission_model",
domain="infectious_disease",
model_role="transmission_analysis",
model_family="sir_compartmental_model",
public_health_question="How does transmission change under different intervention assumptions?",
status="active",
),
PublicHealthModelRecord(
key="surveillance_model",
domain="public_health_surveillance",
model_role="data_interpretation",
model_family="nowcasting_and_reporting_delay_model",
public_health_question="How should reported data be interpreted under delay and undercounting?",
status="review",
),
PublicHealthModelRecord(
key="capacity_model",
domain="health_system_planning",
model_role="capacity_review",
model_family="hospital_demand_model",
public_health_question="Could projected severe cases exceed healthcare capacity?",
status="review",
),
PublicHealthModelRecord(
key="equity_model",
domain="health_equity",
model_role="distributional_review",
model_family="subgroup_risk_model",
public_health_question="Which populations face unequal exposure, severity, or access?",
status="review",
),
PublicHealthModelRecord(
key="communication_model",
domain="public_communication",
model_role="uncertainty_communication",
model_family="scenario_summary_model",
public_health_question="How should model uncertainty and use limits be communicated?",
status="review",
),
]
def epidemic_scenarios() -> list[EpidemicScenario]:
return [
EpidemicScenario("baseline", "Baseline transmission", 100000.0, 120.0, 4000.0, 0.32, 0.12, 120, 850.0, 0.045),
EpidemicScenario("moderate_intervention", "Moderate intervention", 100000.0, 120.0, 4000.0, 0.24, 0.12, 120, 850.0, 0.045),
EpidemicScenario("strong_intervention", "Strong intervention", 100000.0, 120.0, 4000.0, 0.18, 0.12, 120, 850.0, 0.045),
EpidemicScenario("vaccination_plus_intervention", "Vaccination plus intervention", 100000.0, 120.0, 22000.0, 0.20, 0.12, 120, 850.0, 0.030),
]
def simulate_sir(scenario: EpidemicScenario) -> list[dict[str, float]]:
susceptible = scenario.population - scenario.initial_infectious - scenario.initial_recovered
infectious = scenario.initial_infectious
recovered = scenario.initial_recovered
trajectory: list[dict[str, float]] = []
for day in range(scenario.days + 1):
hospital_demand = infectious * scenario.hospitalization_rate
trajectory.append({
"day": float(day),
"susceptible": round(susceptible, 8),
"infectious": round(infectious, 8),
"recovered": round(recovered, 8),
"hospital_demand": round(hospital_demand, 8),
})
new_infections = scenario.beta * susceptible * infectious / scenario.population
new_recoveries = scenario.gamma * infectious
susceptible = max(0.0, susceptible - new_infections)
infectious = max(0.0, infectious + new_infections - new_recoveries)
recovered = min(scenario.population, recovered + new_recoveries)
return trajectory
def evaluate_scenario(scenario: EpidemicScenario) -> dict[str, object]:
trajectory = simulate_sir(scenario)
peak_infectious = max(point["infectious"] for point in trajectory)
peak_hospital_demand = max(point["hospital_demand"] for point in trajectory)
final_recovered = trajectory[-1]["recovered"]
estimated_attack_rate = final_recovered / scenario.population
capacity_breach = peak_hospital_demand > scenario.hospital_capacity
r0 = scenario.beta / scenario.gamma
review_class = "capacity_breach" if capacity_breach else "within_capacity"
if r0 > 1.5 and not capacity_breach:
review_class = "high_transmission_review"
return {
**asdict(scenario),
"r0_simple": round(r0, 8),
"peak_infectious": round(peak_infectious, 8),
"peak_hospital_demand": round(peak_hospital_demand, 8),
"capacity_margin": round(scenario.hospital_capacity - peak_hospital_demand, 8),
"estimated_attack_rate": round(estimated_attack_rate, 8),
"capacity_breach": capacity_breach,
"review_class": review_class,
}
def public_health_priority(record: PublicHealthModelRecord) -> float:
score = {"active": 1.0, "review": 5.0, "revise": 8.0, "archive": 2.0}.get(
record.status.lower(),
4.0,
)
text = f"{record.model_role} {record.model_family} {record.public_health_question}".lower()
for term in ["capacity", "equity", "surveillance", "uncertainty", "transmission", "communication"]:
if term in text:
score += 1.0
return round(score, 8)
def epidemic_summary(rows: list[dict[str, object]]) -> dict[str, object]:
if not rows:
raise ValueError("Epidemic summary requires at least one scenario.")
peaks = [float(row["peak_infectious"]) for row in rows]
capacity_breaches = sum(1 for row in rows if bool(row["capacity_breach"]))
best = min(rows, key=lambda row: float(row["peak_hospital_demand"]))
return {
"lowest_peak_hospital_demand_scenario": best["scenario_name"],
"mean_peak_infectious": round(statistics.mean(peaks), 8),
"max_peak_infectious": round(max(peaks), 8),
"min_peak_infectious": round(min(peaks), 8),
"capacity_breach_count": capacity_breaches,
"scenario_count": len(rows),
}
def write_csv(path: Path, rows: list[dict[str, object]]) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
if not rows:
raise ValueError(f"No rows supplied for {path}")
with path.open("w", newline="", encoding="utf-8") as handle:
writer = csv.DictWriter(handle, fieldnames=list(rows[0].keys()))
writer.writeheader()
writer.writerows(rows)
def write_json(path: Path, payload: object) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
with path.open("w", encoding="utf-8") as handle:
json.dump(payload, handle, indent=2, sort_keys=True)
def main() -> None:
records = public_health_model_register()
scenarios = epidemic_scenarios()
register_rows = [
{**asdict(record), "public_health_priority": public_health_priority(record)}
for record in records
]
scenario_rows = [evaluate_scenario(scenario) for scenario in scenarios]
baseline_trajectory = simulate_sir(scenarios[0])
write_csv(TABLES / "public_health_model_register.csv", register_rows)
write_csv(TABLES / "epidemic_scenario_review.csv", scenario_rows)
write_csv(TABLES / "baseline_sir_trajectory.csv", baseline_trajectory)
write_json(JSON_DIR / "public_health_model_review_card.json", {
"article": "Mathematical Modeling in Public Health and Epidemiology",
"epidemic_summary": epidemic_summary(scenario_rows),
"public_health_model_register": register_rows,
"scenario_review": scenario_rows,
"use_limit": "This simplified SIR workflow supports public health modeling literacy and scenario review; it does not replace surveillance investigation, clinical evidence, local expertise, ethical review, or public health authority.",
"diagnostic_checks": [
"transmission assumptions are explicit",
"capacity demand is estimated",
"capacity breach is flagged",
"scenario comparison is preserved",
"equity and surveillance review remain required",
"uncertainty and use limits are stated",
],
})
print("Public health and epidemiology workflow complete.")
print(f"Epidemic summary: {epidemic_summary(scenario_rows)}")
print(f"Wrote outputs to {OUTPUTS}")
if __name__ == "__main__":
main()
This workflow treats epidemiological modeling as public health evidence infrastructure. It records model purpose, disease scenarios, simple reproduction-number estimates, peak infectious burden, hospital demand, capacity margins, review classes, and use limits.
R Workflow: Epidemic Scenario Summary and Capacity Review
The R workflow below reviews generated public health outputs, ranks scenarios by peak hospital demand, summarizes capacity breaches, and creates a base R infectious-curve plot.
# mathematical_modeling_in_public_health_and_epidemiology_review.R
# Base R workflow for epidemic scenario and capacity review.
args <- commandArgs(trailingOnly = FALSE)
file_arg <- grep("^--file=", args, value = TRUE)
if (length(file_arg) > 0) {
script_path <- normalizePath(sub("^--file=", "", file_arg[1]), mustWork = TRUE)
article_root <- normalizePath(file.path(dirname(script_path), ".."), mustWork = TRUE)
} else {
article_root <- getwd()
}
tables_dir <- file.path(article_root, "outputs", "tables")
figures_dir <- file.path(article_root, "outputs", "figures")
dir.create(tables_dir, recursive = TRUE, showWarnings = FALSE)
dir.create(figures_dir, recursive = TRUE, showWarnings = FALSE)
register_path <- file.path(tables_dir, "public_health_model_register.csv")
scenario_path <- file.path(tables_dir, "epidemic_scenario_review.csv")
trajectory_path <- file.path(tables_dir, "baseline_sir_trajectory.csv")
if (!file.exists(register_path) || !file.exists(scenario_path) || !file.exists(trajectory_path)) {
stop("Missing public health modeling outputs. Run the Python workflow first.")
}
register <- read.csv(register_path, stringsAsFactors = FALSE)
scenarios <- read.csv(scenario_path, stringsAsFactors = FALSE)
trajectory <- read.csv(trajectory_path, stringsAsFactors = FALSE)
register$public_health_priority <- as.numeric(register$public_health_priority)
scenarios$peak_hospital_demand <- as.numeric(scenarios$peak_hospital_demand)
scenarios$peak_infectious <- as.numeric(scenarios$peak_infectious)
scenarios$capacity_margin <- as.numeric(scenarios$capacity_margin)
trajectory$day <- as.numeric(trajectory$day)
trajectory$infectious <- as.numeric(trajectory$infectious)
register <- register[order(-register$public_health_priority), ]
scenarios <- scenarios[order(scenarios$peak_hospital_demand), ]
breach_values <- tolower(as.character(scenarios$capacity_breach))
capacity_breach_count <- sum(breach_values %in% c("true", "1", "yes"))
summary_table <- data.frame(
lowest_peak_hospital_demand_scenario = scenarios$scenario_name[1],
mean_peak_infectious = mean(scenarios$peak_infectious),
max_peak_infectious = max(scenarios$peak_infectious),
min_peak_infectious = min(scenarios$peak_infectious),
capacity_breach_count = capacity_breach_count,
scenario_count = nrow(scenarios)
)
write.csv(
register,
file.path(tables_dir, "r_public_health_model_review_queue.csv"),
row.names = FALSE
)
write.csv(
scenarios,
file.path(tables_dir, "r_epidemic_scenario_ranking.csv"),
row.names = FALSE
)
write.csv(
summary_table,
file.path(tables_dir, "r_epidemic_summary.csv"),
row.names = FALSE
)
png(file.path(figures_dir, "r_baseline_infectious_curve.png"), width = 1000, height = 700)
plot(
trajectory$day,
trajectory$infectious,
type = "l",
xlab = "Day",
ylab = "Infectious population",
main = "Baseline SIR Infectious Curve"
)
dev.off()
print(register)
print(summary_table)
print(scenarios)
The R layer supports public health review by preserving model priorities, scenario rankings, capacity margins, capacity breach flags, and infectious-curve diagnostics.
Haskell Workflow: Typed Public Health Model Records
Haskell is useful here because public health model categories should remain distinct. Transmission modeling is not surveillance correction. Capacity planning is not equity review. A scenario is not a forecast. A model output is not a public health decision.
{-# OPTIONS_GHC -Wall #-}
module Main where
data PublicHealthDomain
= InfectiousDisease
| PublicHealthSurveillance
| HealthSystemPlanning
| HealthEquity
| PublicCommunication
deriving (Eq, Show)
data PublicHealthModelRole
= TransmissionAnalysis
| DataInterpretation
| CapacityReview
| DistributionalReview
| UncertaintyCommunication
deriving (Eq, Show)
data PublicHealthModelFamily
= SIRCompartmentalModel
| NowcastingAndReportingDelayModel
| HospitalDemandModel
| SubgroupRiskModel
| ScenarioSummaryModel
deriving (Eq, Show)
data ReviewStatus
= Active
| RequiresReview
| RequiresEquityReview
| RequiresSurveillanceReview
| RequiresCommunicationReview
deriving (Eq, Show)
data PublicHealthModelRecord = PublicHealthModelRecord
{ key :: String
, domain :: PublicHealthDomain
, role :: PublicHealthModelRole
, family :: PublicHealthModelFamily
, publicHealthQuestion :: String
, status :: ReviewStatus
} deriving (Eq, Show)
publicHealthRegister :: [PublicHealthModelRecord]
publicHealthRegister =
[ PublicHealthModelRecord
"transmission_model"
InfectiousDisease
TransmissionAnalysis
SIRCompartmentalModel
"How does transmission change under different intervention assumptions?"
Active
, PublicHealthModelRecord
"surveillance_model"
PublicHealthSurveillance
DataInterpretation
NowcastingAndReportingDelayModel
"How should reported data be interpreted under delay and undercounting?"
RequiresSurveillanceReview
, PublicHealthModelRecord
"capacity_model"
HealthSystemPlanning
CapacityReview
HospitalDemandModel
"Could projected severe cases exceed healthcare capacity?"
RequiresReview
, PublicHealthModelRecord
"equity_model"
HealthEquity
DistributionalReview
SubgroupRiskModel
"Which populations face unequal exposure, severity, or access?"
RequiresEquityReview
, PublicHealthModelRecord
"communication_model"
PublicCommunication
UncertaintyCommunication
ScenarioSummaryModel
"How should model uncertainty and use limits be communicated?"
RequiresCommunicationReview
]
needsReview :: PublicHealthModelRecord -> Bool
needsReview item =
case status item of
Active -> False
_ -> True
main :: IO ()
main = do
putStrLn "Typed public health model records:"
mapM_ print publicHealthRegister
putStrLn "\nPublic health records requiring review:"
mapM_ print (filter needsReview publicHealthRegister)
This typed layer supports public health model governance by keeping domains, model roles, model families, public health questions, and review obligations distinct.
GitHub Repository
The companion repository for this article is designed as a reproducible mathematical-modeling workspace. It contains article-specific code, data, documentation, notebooks, schemas, and generated outputs for public health model registers, SIR intervention scenarios, infectious-curve simulation, hospital capacity review, uncertainty and equity diagnostics, typed Haskell public health records, and responsible epidemiological modeling workflows.
Complete Code Repository
Companion article folder with Python, R, Julia, SQL, Haskell, Rust, Go, C++, Fortran, and C examples for professional mathematical modeling, epidemiology model registers, SIR transmission dynamics, intervention scenario review, hospital capacity diagnostics, surveillance interpretation, equity review, typed public health records, and responsible public health decision-support workflows.
A Practical Method for Mathematical Modeling in Public Health
Public health modeling should be structured enough to support evidence review, operational action, public communication, and institutional accountability. The goal is not only to produce projections, but to clarify risk, assumptions, uncertainty, capacity, equity, and decision responsibility.
| Step | Task | Question | Artifact |
|---|---|---|---|
| 1 | Define the public health question | Is the model for transmission, forecasting, capacity, allocation, evaluation, or communication? | Model purpose statement. |
| 2 | Define population and boundary | Who is included, where, and over what time horizon? | Population and boundary record. |
| 3 | Review surveillance evidence | What data are available, delayed, biased, or incomplete? | Data quality and surveillance note. |
| 4 | Specify model structure | Which compartments, states, contacts, or risks are represented? | Model structure diagram or table. |
| 5 | Estimate parameters | What transmission, recovery, severity, delay, or intervention parameters are used? | Parameter table with uncertainty ranges. |
| 6 | Compare scenarios | What interventions, behaviors, or futures are being compared? | Scenario comparison table. |
| 7 | Assess capacity and risk | Could demand exceed health-system capacity or public health resources? | Capacity and risk summary. |
| 8 | Review equity | Who faces unequal exposure, severity, detection, access, or burden? | Equity and subgroup review. |
| 9 | Validate for use | What evidence supports the model for this decision? | Validation and use-limit statement. |
| 10 | Communicate responsibly | How will uncertainty, assumptions, and accountability be explained? | Public communication note. |
This method keeps public health models tied to evidence, action, equity, communication, and accountability.
Common Pitfalls
Public health modeling can fail when outputs are treated as more precise, complete, or authoritative than the evidence supports. Many failures come from surveillance bias, hidden assumptions, weak validation, poor communication, or overconfident policy use.
- Case-count literalism: treating reported cases as true infections without accounting for testing and reporting conditions.
- Fixed-parameter thinking: assuming transmission, behavior, or severity remains constant over time.
- Homogeneous population assumptions: ignoring differences in exposure, susceptibility, severity, and access.
- Scenario-as-forecast confusion: presenting conditional scenarios as predictions.
- Capacity simplification: counting beds without considering staff, supplies, access, and operational limits.
- Ignoring uncertainty: communicating one number when a range or scenario set is more honest.
- Weak validation: applying a model to decisions beyond its tested domain.
- Equity omission: reporting aggregate benefit while missing subgroup harm or access barriers.
- Automation bias: letting model outputs substitute for public health judgment.
- No use-limit statement: allowing model results to travel into inappropriate policy decisions.
These pitfalls can be reduced through transparent assumptions, surveillance review, uncertainty analysis, subgroup diagnostics, validation, public communication, and explicit governance.
Conclusion: Public Health Models Should Support Accountable Action
Mathematical modeling is central to public health and epidemiology because population health problems are dynamic, uncertain, and consequential. Models help connect disease processes, surveillance data, interventions, behavior, healthcare capacity, and public decisions.
But public health models do not replace public health judgment. They depend on assumptions, data quality, parameter estimates, model structure, validation, communication, and governance. Their outputs should inform decisions, not own them.
A strong epidemiological model makes assumptions visible, uncertainty communicable, intervention tradeoffs comparable, and capacity risks reviewable. It supports action while preserving humility about what is unknown.
Used responsibly, mathematical modeling can help public health institutions anticipate risk, allocate resources, communicate honestly, reduce harm, and make more accountable decisions under complexity.
Related Articles
- What Is Mathematical Modeling?
- Differential Equations and Dynamic Models
- Probabilistic and Stochastic Models
- Network Models and Graph Structures
- Agent-Based Models and Emergent Behavior
- Simulation and Computational Modeling
- Uncertainty in Mathematical Models
- Communicating Model Uncertainty
- Mathematical Modeling in Policy and Public Systems
- Mathematical Modeling in Artificial Intelligence and Data Systems
Further Reading
- Anderson, R.M. and May, R.M. (1991) Infectious Diseases of Humans: Dynamics and Control. Oxford: Oxford University Press.
- Bailey, N.T.J. (1975) The Mathematical Theory of Infectious Diseases and Its Applications. 2nd edn. London: Griffin.
- Diekmann, O., Heesterbeek, H. and Britton, T. (2013) Mathematical Tools for Understanding Infectious Disease Dynamics. Princeton: Princeton University Press.
- Garnett, G.P., Cousens, S., Hallett, T.B., Steketee, R. and Walker, N. (2011) ‘Mathematical models in the evaluation of health programmes’, The Lancet, 378(9790), pp. 515–525.
- Hethcote, H.W. (2000) ‘The mathematics of infectious diseases’, SIAM Review, 42(4), pp. 599–653.
- Keeling, M.J. and Rohani, P. (2008) Modeling Infectious Diseases in Humans and Animals. Princeton: Princeton University Press.
- Lipsitch, M., Cohen, T., Cooper, B. et al. (2003) ‘Transmission dynamics and control of severe acute respiratory syndrome’, Science, 300(5627), pp. 1966–1970.
- Vynnycky, E. and White, R.G. (2010) An Introduction to Infectious Disease Modelling. Oxford: Oxford University Press.
- World Health Organization (2016) Guidance for Managing Ethical Issues in Infectious Disease Outbreaks. Geneva: World Health Organization.
- World Health Organization (2023) WHO Guidance on Public Health Surveillance. Geneva: World Health Organization.
References
- Anderson, R.M. and May, R.M. (1991) Infectious Diseases of Humans: Dynamics and Control. Oxford: Oxford University Press.
- Bailey, N.T.J. (1975) The Mathematical Theory of Infectious Diseases and Its Applications. 2nd edn. London: Griffin.
- Diekmann, O., Heesterbeek, H. and Britton, T. (2013) Mathematical Tools for Understanding Infectious Disease Dynamics. Princeton: Princeton University Press.
- Garnett, G.P., Cousens, S., Hallett, T.B., Steketee, R. and Walker, N. (2011) ‘Mathematical models in the evaluation of health programmes’, The Lancet, 378(9790), pp. 515–525.
- Hethcote, H.W. (2000) ‘The mathematics of infectious diseases’, SIAM Review, 42(4), pp. 599–653.
- Keeling, M.J. and Rohani, P. (2008) Modeling Infectious Diseases in Humans and Animals. Princeton: Princeton University Press.
- Lipsitch, M., Cohen, T., Cooper, B. et al. (2003) ‘Transmission dynamics and control of severe acute respiratory syndrome’, Science, 300(5627), pp. 1966–1970.
- Vynnycky, E. and White, R.G. (2010) An Introduction to Infectious Disease Modelling. Oxford: Oxford University Press.
- World Health Organization (2016) Guidance for Managing Ethical Issues in Infectious Disease Outbreaks. Geneva: World Health Organization.
- World Health Organization (2023) WHO Guidance on Public Health Surveillance. Geneva: World Health Organization.
