This repository contains the source code for the paper:
- The Paradox of Neglecting Changes in Behavior: How Standard Epidemic Models Misestimate Both Transmissibility and Final Epidemic Size
- Link to: preprint (medRxiv)
This repository provides a framework for parameter inference of compartmental epidemic models that incorporate human behavioral feedback. The inference is performed using Approximate Bayesian Computation based on Sequential Monte Carlo (ABC-SMC) using pyABC library.
It includes:
- Implementation of SEIRD models with constant and behavioral transmission.
- ABC-SMC pipeline for estimating posterior distributions of epidemiological parameters.
- Bayesian model selection to compare behavioral and baseline model performance (using Bayes factors).
- Analysis and diagnostics of the inference results and visualizations in R.
In the examples below we estimate parameters from synthetic observations for two models.
Recovery of parameters under the assumption of constant transmission
python3 src/run_example.py --model baseline| Estimated posterior (KDE) | Model fit to synthetic data |
|---|---|
The red dashed lines and markers indicate the ground-truth parameters used to generate the synthetic observations.
Recovery of parameters when including the behavioral sensitivity
python3 src/run_example.py --model behavior| Estimated posterior (KDE) | Model fit to synthetic data |
|---|---|
The red dashed lines and markers indicate the ground-truth parameters used to generate the synthetic observations.
Clone the repository
git clone https://github.com/markolalovic/epi-behavior-models.git
cd epi-behavior-modelsInstall the minimal set of Python packages in a fresh virtual environment:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txtThe models are calibrated to COVID-19 mortality data from the Johns Hopkins University (JHU) CSSE repository:
- Source: CSSEGISandData
- Direct link:
time_series_covid19_deaths_US.csv - File size: 11.9 MB
Note: time_series_covid19_deaths_US.csv is large and not tracked by version control, see .gitignore.
Download the CSV file and place it in data/raw/ before execution.
To regenerate all results: processed data, summary statistics, figures and tables, run:
./run_all.sh --allNote: full inference across 30 locations is computationally intensive.
See run_all.sh how to set flags to skip some parts, or use the provided summary statistics to regenerate tables and figures.
Note: Regenerating the figures and tables requires R (Version
install.packages(c(
"ggplot2", "dplyr", "tidyr", "reticulate", "tikzDevice",
"patchwork", "knitr", "kableExtra", "ggh4x"))@article {Pant2025.12.07.25341782,
author = {Pant, Binod and Lalovic, Marko and Kiss, Istv{\'a}n Z. and Santillana, Mauricio},
title = {The Paradox of Neglecting Changes in Behavior: How Standard Epidemic Models Misestimate Both Transmissibility and Final Epidemic Size},
elocation-id = {2025.12.07.25341782},
year = {2025},
doi = {10.64898/2025.12.07.25341782},
publisher = {Cold Spring Harbor Laboratory Press},
URL = {https://www.medrxiv.org/content/early/2025/12/15/2025.12.07.25341782},
eprint = {https://www.medrxiv.org/content/early/2025/12/15/2025.12.07.25341782.full.pdf},
journal = {medRxiv}
}