About EpiModel Gallery
What is EpiModel Gallery?
Templates for extending the EpiModel platform to model infectious disease dynamics over networks. Each example demonstrates how to build custom modules for stochastic network models using exponential random graph models (ERGMs).
EpiModel provides built-in SIS/SIR models out of the box, but its module API supports arbitrarily complex epidemic systems. These examples teach by example — from adding a single compartment to multi-stage disease models with interventions and cost-effectiveness analysis.
Getting Started
Prerequisites
- R >= 4.5
- EpiModel >= 2.6.0
Install EpiModel from CRAN:
install.packages("EpiModel")Running an Example
Clone the repository, then run any example from the project root:
source("examples/si-vital-dynamics/model.R")Or from the command line:
Rscript examples/si-vital-dynamics/model.RRunning All Examples
bash test.shContributing
Contributions of new gallery examples are welcome! To contribute:
- Fork the repository on GitHub.
- Create a new subdirectory under
examples/containing:model.R— main script for network estimation and simulationmodule-fx.R— custom module functionsindex.qmd— annotated Quarto document
- Include the standard unit test lines near the top of
model.R(see existing examples). - Verify your example passes:
bash test.sh - Submit a Pull Request.
Requesting New Examples
If you’d like to ask “how would you build a network model in EpiModel that does X?”, file a GitHub Issue with a detailed description.
Citation
If using EpiModel for teaching or research, please include a citation:
Jenness SM, Goodreau SM and Morris M. EpiModel: An R Package for Mathematical Modeling of Infectious Disease over Networks. Journal of Statistical Software. 2018; 84(8): 1-47. doi: 10.18637/jss.v084.i08