This project is a teaching-oriented mini framework for deterministic epidemic models using deSolve.
Goal: help understand model structure and parameter meanings, while supporting batch parameter sweeps that automatically output figures and summary tables.
- Logistic growth (population dynamics)
- SI
- SIR
- SEIR
All transmission models use frequency-dependent transmission: beta * S * I / N.
A detailed interpretation of model equations for each model is available in: docs/model_equations.md
- Single-run trajectories for each model
- Parameter sweeps (grid runs) with:
- faceted trajectory plots (one panel per scenario)
- summary metrics tables (CSV): peak, peak time, attack rate, time-to-threshold, etc.
Open R in the project root, then run:
install.packages("deSolve")
# Optional but recommended for stable PNG output on Windows
install.packages("ragg")
source("scripts/01_run_examples.R")Outputs will be written to:
Example results are provided in example_outputs/.
Running scripts/01_run_examples.R will generate new outputs in the outputs/ directory.
To keep interpretation clean, each sweep fixes everything except the parameter of interest:
- Logistic: scan
r - SI: scan
beta(and optional scan initialI0) - SIR: fix
gamma, scanbetaso thatR0 = beta/gammachanges transparently - SEIR: fix
betaandgamma, scansigma(latent period =1/sigma)
Note on "NN-like tuning": For mechanistic ODE models, we usually prefer principled sweeps (one-factor-at-a-time, or grid / Latin hypercube) plus interpretable outputs, rather than ad-hoc trial-and-error. And this ensures that the effect of each parameter (e.g., β, γ, σ) on epidemic dynamics can be interpreted unambiguously.
A detailed interpretation of each model dynamics and parameter effects
is available in: docs/results_interpretation.md
This includes explanations of:
- peak prevalence and attack rate
- the role of (R_0)
- latent period effects in SEIR
- why
t_50andt_90can beNA
R/reusable functions (models, simulation, metrics, plotting)scripts/one-click reproduction scriptsoutputs/generated figures and tables
- Compare same R0 but different (
beta,gamma) to show time-scale effects - Add
SIS, seasonalbeta(t), interventions, or observation noise - Export long-format data and use ggplot2 facets if you prefer

