
OverviewThis deposit contains the Python implementation for eigenvector-based sensitivity analysis of age-structured epidemic models. The software computes the sensitivity of key outcomes to perturbations in age-specific contact patterns using the Next Generation Matrix (NGM) framework and automatic differentiation in PyTorch. It accompanies the manuscript “Eigenvector-Based Sensitivity Analysis of Contact Patterns in Epidemic Modeling.” The method, models, and equations are described in detail in the paper. What the code does• Builds a computation graph from contact matrices to the dominant eigenvalue of the NGM (R0) and to mortality-weighted targets. • Computes pairwise (age-by-age) and group-level sensitivities via gradients of R0 with respect to independent contact-matrix entries. • Supports full and aggregated age partitions and produces heatmaps and bar plots. Models implemented1) Pitman et al. SEIR/SEIRS influenza model (England & Wales contact data). 2) Röst et al. COVID-19 model with 16 age groups and multiple infectious/hospital compartments (Hungary contact data). Both model constructions and equations are as in the manuscript. Data access (Google Drive fetch)The repository does not bundle large data files. Instead, the code downloads the required inputs from Google Drive at runtime using `gdown`. File IDs are declared in `data/model_config.json`; the `DataLoader` class fetches:• model parameters (JSON), • contact matrices (Excel), • age distributions (Excel), and • shared labels (JSON). Downloaded files are stored under `./data/`. See `src/data_loader.py` for the exact workflow. Contents• `main.py` — entry point for running experiments and producing figures • `src/` — model builders, gradient/sensitivity routines, plotting utilities • `requirements.txt` — pinned dependencies (PyTorch, xlrd, gdown, matplotlib, etc.) • `flowchart.png` — pipeline overview • `README.md` — usage instructions Reproducibility1) Python 3.10+ recommended. 2) `pip install -r requirements.txt` 3) Run, e.g., rost or seir `python main.py --rost` `python main.py --rost_agg` Figures are written to the `./outputs/` directory; the code reproduces the sensitivity heatmaps and group-level summaries shown in the paper.
Age-dependent epidemic model, Social contact patterns, Next Generation Matrix, Sensitivity analysis.
Age-dependent epidemic model, Social contact patterns, Next Generation Matrix, Sensitivity analysis.
| selected citations These citations are derived from selected sources. This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | 0 | |
| popularity This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network. | Average | |
| influence This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | Average | |
| impulse This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network. | Average |
