Learn R Programming

⚠️There's a newer version (2.5.0) of this package.Take me there.

EpiModel

Tools for simulating mathematical models of infectious disease dynamics. Epidemic model classes include deterministic compartmental models, stochastic individual-contact models, and stochastic network models. Network models use the robust statistical methods of exponential-family random graph models (ERGMs) from the Statnet suite of software packages in R. Standard templates for epidemic modeling include SI, SIR, and SIS disease types. EpiModel features an easy API for extending these templates to address novel scientific research aims.

Lead Authors

Additional contributors to EpiModel are listed on the contributors page.

Installation

The current release version can be found on CRAN and installed with:

install.packages("EpiModel", dependencies = TRUE)

To install this development version, use the remotes package:

if (!require("remotes")) install.packages("remotes")
remotes::install_github("statnet/EpiModel")

EpiModel 2.0

In July 2020, we relased EpiModel version 2.0. This major software package update incorporates a substantial redesign of many elements of the EpiModel infrastructure and application programming interface (API). We anticipate that there will be some minor backwards incompatibilities with any EpiModel code developed with versions 1.x. There is a EpiModel 2.0 migration document available in the Tutorials page.

Documentation and Support

Website. The main website for EpiModel, with tutorials and other supporting files is http://epimodel.org/.

Methods Paper. A good place to start learning about EpiModel is the main methods paper published in the Journal of Statistical Software. It is available at http://doi.org/10.18637/jss.v084.i08.

Summer Course. Network Modeling for Epidemics is our annual 5-day course at the University of Washington where we teach the statistical theory, software tools, and applied modeling methods using EpiModel. Our course materials are open-source and updated annually around the time of the course.

Getting Help. Users are encouraged to use Github issues on this repository as a place to ask questions (both technical coding quesitons and conceptual modeling questions), report bugs, and request new features & functionality.

The EpiModel Gallery

We recently started a new EpiModel Gallery that contains templates of extensions to EpiModel, for now focused on network-based mathematical models. We will be continuing to add new examples the gallery, and encourage users to either file requests for new examples or contribute them following our guidelines.

Citation

If using EpiModel for teaching or research, please include a citation our main methods paper:

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

Please also send us an email if you have used EpiModel in your work so we can add the citation below.

Funding

The primary support for the development of these software tools and statistical methods has been by two National Institutes of Health (NIH) grants. Our applied research projects using EpiModel have received funding from the NIH and Centers for Disease Control and Prevention (CDC). Our team also receives institutional support through center-level NIH grants. A full list of our funding support can be found here.

EpiModel in the Scientific Literature

EpiModel and its extension packages have been used in the following scientific journal articles. A list of these articles can be accessed in a wiki page or on Zotero. (If you are aware of others, send us an email at samuel.m.jenness@emory.edu to be included in this list.)

Copyright

These materials are distributed under the GPL-3 license, with the following copyright and attribution requirements listed in the LICENSE document above.

Copy Link

Version

Install

install.packages('EpiModel')

Monthly Downloads

933

Version

2.0.5

License

GPL-3

Maintainer

Samuel Jenness

Last Published

October 11th, 2024

Functions in EpiModel (2.0.5)

InitErgmTerm.absdiffnodemix

Definition for absdiffnodemix ERGM Term
as.data.frame.icm

Extract Model Data for Stochastic Models
InitErgmTerm.absdiffby

Definition for absdiffby ERGM Term
apportion_lr

Apportion Least-Remainder Method
arrivals.net

Arrivals: netsim Module
as.data.frame.dcm

Extract Model Data for Deterministic Compartmental Models
arrivals.icm.bip

Arrivals: bipartite icm Module
arrivals.2g.net

Arrivals: netsim Module
as.phylo.transmat

Convert transmat infection tree into a phylo object
arrivals.icm

Arrivals: icm Module
EpiModel-package

Mathematical Modeling of Infectious Disease Dynamics
check_attr_lengths

Check that all attributes in the master object are of equal length
brewer_ramp

RColorBrewer Color Ramp for EpiModel Plots
delete_attr

Delete Elements from Attribute List
comp_plot

Plot Compartment Diagram for Epidemic Models
as.data.frame.netdx

Extract Timed Edgelists netdx Objects
departures.2g.net

Departures: netsim Module
auto_update_attr

Updates Vertex Attributes for Incoming Vertices
as.network.transmat

Converts transmat infection tree into a network object
crosscheck.net

Cross Checking of Inputs for Stochastic Network Models
control.dcm

Control Settings for Deterministic Compartmental Models
dcm

Deterministic Compartmental Models
crosscheck.dcm

Cross Checking of Inputs for Deterministic Compartmental Models
get_attr_prop

Proportional Table of Vertex Attributes
crosscheck.icm

Cross Checking of Inputs for Stochastic Individual Contact Models
check_degdist_bal

Check Degree Distribution for Balance in Target Statistics
copy_datattr_to_nwattr

Copies Vertex Attributes from the dat List to the Network Object
copy_nwattr_to_datattr

Copies Vertex Attributes From Network to dat List
get_network

Extract networkDynamic and network Objects from Network Simulations
get_formula_term_attr

Outputs ERGM Formula Attributes into a Character Vector
edgelist_meanage

Mean Age of Partnerships over Time
merge.icm

Merge Data across Stochastic Individual Contact Model Simulations
edges_correct

Adjustment for the Edges Coefficient with Changing Network Size
mcat

Write Out Test Progress to Console
departures.icm

Departure: icm Module
departures.icm.bip

Departure: bipartite icm Module
geom_bands

ggplot2 geom for Quantile Bands
get_network_term_attr

Outputs ERGM Formula Attributes into a Character Vector
plot.netsim

Plot Data from a Stochastic Network Epidemic Model
get_degree

Get Individual Degree from Network or Edgelist
infection.net

Primary Infection Module for netsim
control.net

Control Settings for Stochastic Network Models
epiweb

EpiModel Web
control.icm

Control Settings for Stochastic Individual Contact Models
plot.transmat

Plot transmat infection tree in one of several styles
departures.net

Departures: netsim Module
get_args

Get Arguments from EpiModel Parameterization Functions
discord_edgelist

Discordant Edgelist
generate_random_params

Generate Values for Random Parameters
icm

Stochastic Individual Contact Models
is.transmat

Extract Transmissions Matrix from Network Epidemic Model
get_nwparam

Extract Network Model Parameters
modules.icm

Modules for Stochastic Individual Contact Models
get_nwstats

Extract Network Statistics from netsim or netdx Object
merge.netsim

Merge Model Simulations Across netsim Objects
init.dcm

Initial Conditions for Deterministic Compartmental Models
netdx

Dynamic Network Model Diagnostics
get_sims

Extract Network Simulations
net-accessor

Functions to Access and Edit the Master List Object in Network Models
color_tea

Creates a TEA Variable for Infection Status for ndtv Animations
deleteAttr

Delete Elements from Attribute List
initialize.net

Initialization: netsim Module
dcm.mods

Deterministic Compartmental Model Functions
process_out.net

Save a list of netsim Data to Output List Format
initialize.icm

Initialization: icm Module
prevalence.net

Get Epidemic Output from netsim Model
nwupdate.net

Dynamic Network Updates
param.dcm

Epidemic Parameters for Deterministic Compartmental Models
dissolution_coefs

Dissolution Coefficients for Stochastic Network Models
resim_nets

Resimulate Dynamic Network at Time 2+
set_transmat

Save Transmission Matrix
param.icm

Epidemic Parameters for Stochastic Individual Contact Models
recovery.icm.bip

Recovery: icm Module
recovery.net

Recovery: netsim Module
test_net

Test the Model Output from a Network Model
truncate_sim

Truncate Simulation Time Series
saveout.dcm

Save dcm Data to Output List Format
param.net

Epidemic Parameters for Stochastic Network Models
netest

Dynamic Network Model Estimation
edgelist_censor

Table of Edge Censoring
sim_nets

Simulate Dynamic Network at Time 1
init_status.icm

Disease Status Initialization Module for icm
infection.2g.net

Primary Infection Module for netsim
param_random

Create a Value Sampler for Random Parameters
idgroup

Mode Numbers for Two-Group Network
verbose.net

Progress Print Module for Stochastic Network Models
plot.dcm

Plot Data from a Deterministic Compartmental Epidemic Model
summary.icm

Summary Model Statistics
netsim

Stochastic Network Models
init_status.net

Disease Status Initialization Module for netsim
test_icm

Test the Model Output from a Stochastic Individual Contact Model
summary.netsim

Summary Model Statistics
summary.netest

Summary for Network Model Fit
infection.icm

Primary Infection Module for icm
unique_id-tools

Convert Unique identifiers from/to Positional identifiers
update_dissolution

Adjust Dissolution Component of Network Model Fit
init.icm

Initial Conditions for Stochastic Individual Contact Models
netsim_cond_msg

Message to find in which module a `condition` occured
netsim_loop

Internal function running the network simulation loop
plot.icm

Plot Data from a Stochastic Individual Contact Epidemic Model
init.net

Initial Conditions for Stochastic Network Models
infection.icm.bip

Primary Infection Module for icm
plot.netdx

Plot Dynamic Network Model Diagnostics
saveout.icm

Save icm Data to Output List Format
modules.net

Modules for Stochastic Network Models
mutate_epi

Add New Epidemiology Variables
prevalence.icm

Get Epidemic Output from icm Model
recovery.2g.net

Recovery: netsim Module
prevalence.icm.bip

Get Epidemic Output from icm Model
recovery.icm

Recovery: icm Module
update_params

Update Model Parameters for Stochastic Network Models
update_unique_ids

Create the unique_ids for the new nodes
summary.dcm

Summary Model Statistics
ssample

Stable Sampling Function
saveout.net

Save netsim Data to Output List Format
verbose.dcm

Progress Print Module for Deterministic Compartmental Models
verbose.icm

Progress Print Module for Stochastic Individual Contact Models