Package: EpiModel 2.7.1

Samuel Jenness

EpiModel: Mathematical Modeling of Infectious Disease Dynamics

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 API for extending these templates to address novel scientific research aims. Full methods for EpiModel are detailed in Jenness et al. (2018, <doi:10.18637/jss.v084.i08>).

Authors:Samuel Jenness [cre, aut], Steven M. Goodreau [aut], Martina Morris [aut], Adrien Le Guillou [aut], Chad Klumb [aut], Skye Bender-deMoll [ctb]

EpiModel_2.7.1.tar.gz
EpiModel_2.7.1.zip(r-4.7-x86_64)EpiModel_2.7.1.zip(r-4.7-arm64)EpiModel_2.7.1.zip(r-4.6-x86_64)EpiModel_2.7.1.zip(r-4.6-arm64)EpiModel_2.7.1.zip(r-4.5-x86_64)
EpiModel_2.7.1.tgz(r-4.6-x86_64)EpiModel_2.7.1.tgz(r-4.6-arm64)EpiModel_2.7.1.tgz(r-4.5-x86_64)EpiModel_2.7.1.tgz(r-4.5-arm64)
EpiModel_2.7.1.tar.gz(r-4.7-arm64)EpiModel_2.7.1.tar.gz(r-4.7-x86_64)EpiModel_2.7.1.tar.gz(r-4.6-arm64)EpiModel_2.7.1.tar.gz(r-4.6-x86_64)
EpiModel_2.7.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
EpiModel/json (API)

# Install 'EpiModel' in R:
install.packages('EpiModel', repos = c('https://epimodel.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/epimodel/epimodel/issues

Pkgdown/docs site:https://epimodel.github.io

On CRAN:

Conda:

agent-based-modelingepidemicsepidemiologyergminfectious-diseasesnetwork-graphstatnet

10.72 score 284 stars 2.0k downloads 19 mentions 191 exports 67 dependencies

Last updated from:cea40a5e55. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK245
linux-devel-x86_64OK184
source / vignettesOK291
linux-release-arm64OK194
linux-release-x86_64OK238
macos-release-arm64OK202
macos-release-x86_64OK492
macos-oldrel-arm64OK175
macos-oldrel-x86_64OK680
windows-devel-arm64OK347
windows-devel-x86_64OK218
windows-release-arm64OK343
windows-release-x86_64OK192
windows-oldrel-x86_64OK181
wasm-releaseOK133

Exports:.batch_plan.run_batch.scenarios_setupadd_attradd_controladd_epiadd_initadd_paramadd_verticesappend_attrappend_core_attrapportion_lrarrivals.2g.netarrivals.icmarrivals.icm.biparrivals.netarrive_nodesas_cumulative_edgelistas_tibble_edgelistas.epi.data.frameas.phylo.transmatassign_groupsauto_update_attrbrewer_rampby_infection_durationcheck_degdist_balcolor_teacomp_plotcontrol.dcmcontrol.icmcontrol.netcopy_datattr_to_nwattrcopy_nwattr_to_datattrcreate_dat_objectcreate_scenario_listcrosscheck.dcmcrosscheck.icmcrosscheck.netdcmdedup_cumulative_edgelistdelete_attrdelete_edgesdelete_verticesdepart_nodesdepartures.2g.netdepartures.icmdepartures.icm.bipdepartures.netdiscord_edgelistdissolution_coefsedgelist_censoredges_correctepiwebgeom_bandsget_argsget_attrget_attr_atget_attr_historyget_attr_listget_attr_propget_backward_reachableget_controlget_control_listget_core_attributesget_cumulative_degreeget_cumulative_edgelistget_cumulative_edgelists_dfget_current_timestepget_degreeget_degree_distget_discordant_edgelistget_edgelistget_edgelists_dfget_epiget_epi_listget_formula_term_attrget_forward_reachableget_initget_init_listget_networkget_network_attributesget_network_controlget_network_term_attrget_nwparamget_nwstatsget_paramget_param_listget_partnersget_posit_idsget_scenarios_batches_infosget_scenarios_tibble_infosget_simsget_transmatget_unique_idsget_vertex_attributeicmidgroupincrement_timestepinfection.2g.netinfection.icminfection.icm.bipinfection.netinit_netsinit_status.icminit_status.netinit.dcminit.icminit.netinitialize.icminitialize.netis_active_posit_idsis_active_unique_idsis.transmatmake_networkDynamicmake_restart_pointmake_restart_poolmcatmerge_netsim_scenariosmerge_netsim_scenarios_tibblemod_SI_1g_clmod_SI_1g_opmod_SI_2g_clmod_SI_2g_opmod_SIR_1g_clmod_SIR_1g_opmod_SIR_2g_clmod_SIR_2g_opmod_SIS_1g_clmod_SIS_1g_opmod_SIS_2g_clmod_SIS_2g_opmove_to_groupmultilayermutate_epinetcensusnetcliquenetdxnetestnetsimnetsim_path_wrappernetsim_scenariosnetwork_initializenwupdate.netoverwrite_attrspadded_vectorparam.dcmparam.icmparam.netparam.net_from_tableparam.net_to_tableprevalence.icmprevalence.icm.bipprevalence.netprocess_out.netrecord_attr_historyrecord_raw_objectrecovery.2g.netrecovery.icmrecovery.icm.biprecovery.netremove_node_attrresim_netssample_groupssaveout.dcmsaveout.icmsaveout.netset_attrset_controlset_current_timestepset_episet_initset_networkset_paramset_transmatset_vertex_attributesim_nets_t1simulate_datssamplesummary_netstest_icmtest_nettrim_netesttruncate_simupdate_cumulative_edgelistupdate_dissolutionupdate_paramsuse_scenariovalidate_restart_poolverbose.dcmverbose.icmverbose.net

Dependencies:apecachemclicodacodetoolscollectionscpp11DEoptimRdeSolvedigestdplyrergmergm.multievaluatefarverfastmapfuturefuture.applygenericsggplot2globalsgluegtablehighrisobandknitrlabelinglatticelazyevallifecyclelistenvlpSolveAPImagrittrMASSMatrixmemoisenetworknetworkDynamicnetworkLitenlmeparallellypillarpkgconfigpurrrR6rbibutilsRColorBrewerRcppRdpackrlangrlerobustbaseS7scalesstatnet.commonstringistringrtergmtibbletidyselecttrustutf8vctrsviridisLitewithrxfunyaml

Running Scenarios in Batches and From Restart Pools
Introduction | Setup | Running Scenarios in Batches | Listing and Merging the Batches | Restart Pools | Making a Pool | Running Scenarios From a Pool

Last update: 2026-11-18
Started: 2026-11-18

Working with Model Parameters in EpiModel
Introduction | Scenarios | Setup | Scenario Definitions | Running Scenarios | Scenarios with Parameter Vectors | Parameter Input via Table | Parameter Uncertainty | Drawing Parameter Values | Correlated Draws | Vector Parameters | Running the Draws | Linking Draws to Outcomes | Migrating from random.params | Time-Varying Parameters and Control Settings (Advanced) | Parameter Updaters | Incorporating Updaters | Verbosity | Relative Parameter Changes | Time-Varying Control Settings

Last update: 2026-11-18
Started: 2021-11-08

EpiModel: Mathematical Modeling of Infectious Disease Dynamics
What EpiModel Does | The Network Model Pipeline | Step 1: Network Estimation | Step 2: Network Diagnostics | Step 3: Epidemic Simulation | Step 4: Analyzing Results | Epidemic Trajectories | Summary Statistics | Data Extraction | Transmission Trees | Extending EpiModel | Learning Pathway | Beginner | Intermediate | Advanced | Package Documentation | Getting Help | Citation

Last update: 2026-10-14
Started: 2014-11-02

Working with Custom Attributes and Summary Statistics in EpiModel
Introduction | Current Nodal Attributes | Core Attributes | Positional Indexing vs Unique IDs | Working With Attributes | Accessing Attributes | Modifying Attributes | Summary | Historical Nodal Attributes | Automatic Attribute Tracking | Manual Attribute Recording | Epidemic Trackers | Working With Epidemic Trackers in Modules | Accessing Epidemic Trackers After a Simulation | Derived Statistics with mutate_epi() | Stratified Prevalence with epi.by | Custom Epidemic Trackers | Writing Tracker Functions | Using Custom Tracker Functions | Recording Arbitrary Objects (Advanced Debugging)

Last update: 2026-10-14
Started: 2021-11-08

Working with Network Objects in EpiModel
Introduction | Network Storage Modes | Accessing Network Objects | During Simulation (Inside Modules) | After Simulation | Transmission Matrix | Current Edgelists | Single Network | Multiple Networks | Discordant Edgelist | Positional Indexing and Unique IDs | Multi-Layer Networks | Specifying Layers | Per-Layer Controls and Parameters | Accessing Layers | Dependent Layers | Clique Layers | Building a Clique Layer | Clique Layers During Simulation | Arrivals and Departures | Moving Nodes Between Groups | Observed Network Layers | Building an Observed Layer | Simulation Time and the Observation Window | Observed Layers During Simulation | Cumulative Edgelist | Lifecycle | Enabling Cumulative Edgelists | Updating the Cumulative Edgelist | Accessing the Cumulative Edgelist | During Simulation: Specific Network | During Simulation: Multiple Networks | Contact Tracing | Cumulative Degree | Reachability Analysis | Forward Reachable Set | Backward Reachable Set | Converting External networkDynamic Objects | Deduplicating Across Sources | Performance Notes

Last update: 2026-10-14
Started: 2021-11-08

Readme and manuals

Help Manual

Help pageTopics
Mathematical Modeling of Infectious Disease DynamicsEpiModel-package EpiModel
Fast Version of network::add.vertices for Edgelist-formatted Networkadd_vertices
Apportion Using the Largest Remainder Methodapportion_lr
Arrive New Nodes to the netsim_dat Objectarrive_nodes
Convert an Object to a Cumulative Edgelistas_cumulative_edgelist
Convert an Edgelist into a Tibbleas_tibble_edgelist
Extract Model Data for Deterministic Compartmental Modelsas.data.frame.dcm
Extract Model Data for Stochastic Modelsas.data.frame.icm as.data.frame.netsim
Extract Timed Edgelists for netdx Objectsas.data.frame.netdx
Validate and Convert to epi.data.frameas.epi.data.frame
Convert transmat Infection Tree into a network Objectas.network.transmat
Convert transmat Infection Tree into a phylo Objectas.phylo.transmat
Assign Group Ids to an Existing Populationassign_groups
Parameters That Vary With the Duration of Infectionby_infection_duration
Check Degree Distribution for Balance in Target Statisticscheck_degdist_bal
Create a TEA Variable for Infection Status for 'ndtv' Animationscolor_tea
Plot Compartment Diagram for Epidemic Modelscomp_plot comp_plot.dcm comp_plot.icm comp_plot.netsim
Control Settings for Deterministic Compartmental Modelscontrol.dcm
Control Settings for Stochastic Individual Contact Modelscontrol.icm
Control Settings for Stochastic Network Modelscontrol.net
Create a Minimal netsim_dat Main List Object for a Network Modelcreate_dat_object
Make a list of EpiModel scenarios from a data.frame of scenarioscreate_scenario_list
Deterministic Compartmental Modelsdcm
Deduplicate a Cumulative Edgelistdedup_cumulative_edgelist
Remove Edges That Include Specified Verticesdelete_edges
Fast Version of network::delete.vertices for Edgelist-formatted Networkdelete_vertices
Depart Nodes from the netsim_dat Objectdepart_nodes
Dissolution Coefficients for Stochastic Network Modelsdissolution_coefs
Table of Edge Censoringedgelist_censor
EpiModel Webepiweb
ggplot2 Geom for Quantile Bandsgeom_bands
Returns an adjacency list from an edge listget_adj_list
Get and Set Nodal Attributes in Network Modelsadd_attr append_attr append_core_attr get_attr get_attr_list get_core_attributes remove_node_attr set_attr
Get Tracked Attributes at a Given Time Stepget_attr_at
Extract the Attributes History from Network Simulationsget_attr_history
Returns all the node connected directly or indirectly to a set of nodesget_connected_nodes
Return the Cumulative Degree of a Set of Index Nodesget_cumulative_degree
Get a Cumulative Edgelist From a Specified Networkget_cumulative_edgelist
Get the Cumulative Edgelists of a Modelget_cumulative_edgelists_df
Return the Current Timestepget_current_timestep
Get Individual Degree from Network or Edgelistget_degree
Extract Degree Distributions from Network Diagnosticsget_degree_dist
Get an Edgelist From the Specified Networkget_edgelist
Get the Edgelist(s) from the Specified Network(s)get_edgelists_df
Get and Set Epidemic Outputs in Network Modelsadd_epi get_epi get_epi_list set_epi
Output ERGM Formula Attributes into a Character Vectorget_formula_term_attr
Extract Network Objects from Network Simulationsget_network get_network.netdx get_network.netsim get_network.netsim_dat
Get Network Attributes from a Network Objectget_network_attributes
Output Network Attributes into a Character Vectorget_network_term_attr
Extract Network Statistics from netsim or netdx Objectget_nwstats
Get and Set Parameters, Controls, and Initial Conditions in Network Modelsadd_control add_init add_param get_control get_control_list get_init get_init_list get_network_control get_param get_param_list set_control set_init set_param
Return the Historical Contacts (Partners) of a Set of Index Nodesget_partners
Helper function to access the file name elements of scenariosget_scenarios_batches_infos
Helper function to access the infos on merged scenarios 'data.frame'get_scenarios_tibble_infos
Extract Network Simulationsget_sims
Return an adjacency list of subnetsget_subnet_adj_list
Get Vertex Attribute on Network Objectget_vertex_attribute
Stochastic Individual Contact Modelsicm
Increment the Current Timestepincrement_timestep
Initial Conditions for Deterministic Compartmental Modelsinit.dcm
Initial Conditions for Stochastic Individual Contact Modelsinit.icm
Initial Conditions for Stochastic Network Modelsinit.net
Definition for absdiffby ERGM Termabsdiffby InitErgmTerm.absdiffby
Definition for absdiffnodemix ERGM Termabsdiffnodemix InitErgmTerm.absdiffnodemix
Definition for fuzzynodematch ERGM Termfuzzynodematch InitErgmTerm.fuzzynodematch
Are These Nodes Active (Positional IDs)is_active_posit_ids
Are These Nodes Active (Unique IDs)is_active_unique_ids
Extract Transmissions Matrix from Network Epidemic Modelget_transmat is.transmat transmat
Build a networkDynamic Object from Simulation Outputmake_networkDynamic
Make a Lightweight Restart Point From a 'netsim' Object with tergmLitemake_restart_point
Make a Restart Pool From Simulations Run With Scenariosmake_restart_pool
Create a Single Sim File per Scenarios Using the Files From 'netsim_scenarios'merge_netsim_scenarios
Create a Single Sim File per Scenarios Using the Files From 'netsim_scenarios'merge_netsim_scenarios_tibble
Merge Data across Stochastic Individual Contact Model Simulationsmerge.icm
Merge Model Simulations across netsim Objectsmerge.netsim
Modules for Stochastic Individual Contact Modelsmodules.icm
Modules for Stochastic Network Modelsmodules.net
Move Nodes to Another Group of a Clique Layermove_to_group
Specify Controls and Parameters by Networkmultilayer
Add New Epidemiology Variablesmutate_epi
Functions to Access and Edit the Main netsim_dat Object in Network Modelsnet-accessor
Control Settings for Network Model Estimation and Simulationnet-controls set.control.ergm set.control.ergm.ego set.control.tergm
Observed Network Layer for Network Epidemic Modelsnetcensus
Clique Layer for Network Epidemic Modelsnetclique
Dynamic Network Model Diagnosticsnetdx
Dynamic Network Model Estimationnetest
Stochastic Network Modelsnetsim
Run Single Simulations From a Restart Pool or a Single Objectnetsim_path_wrapper
Run EpiModel Network Simulations With Scenariosnetsim_scenarios
Initialize Network Objectnetwork_initialize
Dynamic Network Updatesnwupdate.net
Helper to use a 'data.frame' to initialize some attributesoverwrite_attrs
Grow a Vector to a Given Size, Padding it With Empty Elementspadded_vector
Epidemic Parameters for Deterministic Compartmental Modelsparam.dcm
Epidemic Parameters for Stochastic Individual Contact Modelsparam.icm
Epidemic Parameters for Stochastic Network Modelsparam.net
Parameters List for Stochastic Network Models from a Formatted Data Frameparam.net_from_table
Coerce a list of parameters to a 'long.param.df'param.net_to_table
Plot Data from a Deterministic Compartmental Epidemic Modelplot.dcm
Plot Epidemic Model Results From a Netsim Data.Frameplot.epi.data.frame
Plot Data from a Stochastic Individual Contact Epidemic Modelplot.icm
Plot Dynamic Network Model Diagnosticsplot.netdx
Plot Data from a Stochastic Network Epidemic Modelplot.netsim
Plot transmat Infection Tree in Three Stylesplot.transmat
Print Method for DCM Objectsprint.dcm
Print Method for ICM Objectsprint.icm
Utility Function for Printing netdx Objectprint.netdx
Print Method for Network Model Simulationsprint.netsim
Get the Forward or Backward Reachable Nodes for a Set of Nodesget_backward_reachable get_forward_reachable reachable-nodes
Record Attribute Historyrecord_attr_history
Record an Arbitrary Object During a Simulationrecord_raw_object
Sample a Population of Groups from a Table of Group Typessample_groups
Set the Current Timestepset_current_timestep
Save Transmission Matrixset_transmat
Set Vertex Attribute on Network Objectset_vertex_attribute
Summary Model Statisticssummary.dcm
Summary Model Statisticssummary.icm
Summary Model Statisticssummary.netsim
Function to Reduce the Size of a 'netest' Objecttrim_netest
Truncate Simulation Time Seriestruncate_sim truncate_sim.dcm truncate_sim.icm truncate_sim.netsim
Convert Unique Identifiers to/from Positional Identifiersget_posit_ids get_unique_ids unique_id-tools
Update a Cumulative Edgelist of the Specified Networkupdate_cumulative_edgelist
Adjust Dissolution Component of Network Model Fitupdate_dissolution
Update Model Parameters for Stochastic Network Modelsupdate_params
Apply a scenario object to a param.net objectuse_scenario
Validate a Restart Poolvalidate_restart_pool