Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ODE Disease Dynamics Mini-Lab (Logistic growth / SI / SIR / SEIR)

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.

Models

  • 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

What you get

  • 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.

Quick start

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:

  • outputs/figures/ SIR R0 sweep SEIR latent sweep To see more in example_outputs/.

  • outputs/tables/

Example results are provided in example_outputs/. Running scripts/01_run_examples.R will generate new outputs in the outputs/ directory.

Parameter sweep strategies (less "random tuning", more interpretable)

To keep interpretation clean, each sweep fixes everything except the parameter of interest:

  • Logistic: scan r
  • SI: scan beta (and optional scan initial I0)
  • SIR: fix gamma, scan beta so that R0 = beta/gamma changes transparently
  • SEIR: fix beta and gamma, scan sigma (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.

Results interpretation

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_50 and t_90 can be NA

Project layout

  • R/ reusable functions (models, simulation, metrics, plotting)
  • scripts/ one-click reproduction scripts
  • outputs/ generated figures and tables

Ideas to extend

  • Compare same R0 but different (beta, gamma) to show time-scale effects
  • Add SIS, seasonal beta(t), interventions, or observation noise
  • Export long-format data and use ggplot2 facets if you prefer

About

Teaching-oriented ODE epidemic mini-lab with SI, SIR, and SEIR models, parameter sweeps, and interpretable metrics.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages