| Field | Value |
|---|---|
| R version | R version 4.6.1 (2026-06-24) |
| Platform | aarch64-apple-darwin23 |
| Operating system | macOS Tahoe 26.5.1 |
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.
Build Environment
The examples on this site are built and tested against the environment below, pinned with renv for reproducibility. The complete pinned set for all packages is recorded in renv.lock.
| Package | Version |
|---|---|
| dampack | 1.0.2.1000 |
| deSolve | 1.42 |
| dplyr | 1.2.1 |
| EpiModel | 2.6.1 |
| ergm | 4.12.0 |
| ergm.multi | 0.3.0 |
| network | 1.20.0 |
| networkDynamic | 0.12.0 |
| networkDynamicData | 0.3.0 |
| networkLite | 1.1.0 |
| renv | 1.2.3 |
| statnet.common | 4.13.0 |
| tergm | 4.2.2 |
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