Skip to content

Source code for "The Paradox of Neglecting Changes in Behavior" implementing behavioral SEIRD models and parameter inference using ABC-SMC (pyABC)

License

Notifications You must be signed in to change notification settings

markolalovic/epi-behavior-models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

epi-behavior-models

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)

Overview

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.

Examples

In the examples below we estimate parameters from synthetic observations for two models.

1. Baseline model (SEIRD)

Recovery of parameters under the assumption of constant transmission $\beta(t) = \beta_0$:

python3 src/run_example.py --model baseline
Estimated posterior (KDE) Model fit to synthetic data
Baseline Posteriors Baseline Fit

The red dashed lines and markers indicate the ground-truth parameters used to generate the synthetic observations.

2. Behavioral model (Mixed form)

Recovery of parameters when including the behavioral sensitivity $\zeta$:

python3 src/run_example.py --model behavior
Estimated posterior (KDE) Model fit to synthetic data
Behavior Posteriors Behavior Fit

The red dashed lines and markers indicate the ground-truth parameters used to generate the synthetic observations.

Reproducing results

1. Installation

Clone the repository

git clone https://github.com/markolalovic/epi-behavior-models.git
cd epi-behavior-models

Install 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.txt

2. Data

The models are calibrated to COVID-19 mortality data from the Johns Hopkins University (JHU) CSSE repository:

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.

3. Execution

To regenerate all results: processed data, summary statistics, figures and tables, run:

./run_all.sh --all

Note: 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 $\ge 4$) and the following R packages:

install.packages(c(
    "ggplot2", "dplyr", "tidyr", "reticulate", "tikzDevice",
    "patchwork", "knitr", "kableExtra", "ggh4x"))

Citation

@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}
}

About

Source code for "The Paradox of Neglecting Changes in Behavior" implementing behavioral SEIRD models and parameter inference using ABC-SMC (pyABC)

Topics

Resources

License

Stars

Watchers

Forks