- export a generic
get_discordant_edgelistwhere the attribute to be use to assess discordance as well as the values for each group can be specified.
CRAN release: 2023-06-20
- Stochastic network models, simulated with
netsim, now support multi-layer networks. These are networks with a common common node set but different edge set (e.g., home-based and community-based contact layers). An example implementation can be found at the EpiModel Gallery.
- Add a
get_cumulative_degreefunction with an interface similar to
get_partners. This function helps look up cumulative degree over a time period (e.g., number of partners over the past year) for a specified set of nodes.
set_networkfunctions created for more consistent access to the network objects within
update_cumulative_edgelistis now called unconditionally and governed by the
- Attempting to access a cumulative edgelist when the
cumulative.edgelist == FALSEcauses an error.
netsimdata objects now properly classed as
icmdata objects now properly classed as
icm_dat, consistent with
- Update network simulation handling of
ergmobjects to address backwards incompatible data structures for
CRAN release: 2023-02-16
- Estimation with the
ergm.egopackage estimation is now supported. This is accomplished by passing an
egorclass object instead of a
networkclass object as the
- Added an
end.horizoncontrol setting to
control.net. This allows one to remove a set of modules within network epidemic models at a given time step. This end horizon is needed for cost-effectiveness analyses and related models that require tracking person time in the absence of disease transmision.
.dump.frames.on.errorcontrols to print the
tracebackon error even on multicore settings and
dump.framesfor remote debugging.
- Fixed an error where
get_attr_historywould crash when attribute history of
- Changed in the internal behavior of
saveout.net: missing elements on some simulations now produce a warning instead of an error. Additionally, elements passed to
save.otherthat are not present in the final object are skipped silently instead of producing an error.
- Removed functionality for the
networkLiteclass (sparse network representations needed for epidemic modeling) from EpiModel and placed into its own package on CRAN: https://CRAN.R-project.org/package=networkLite.
truncate.el.cumlcontrols get default values in
0). Better messages and warnings are sent when trying to access an uncreated cumulative edgelist.
CRAN release: 2022-10-01
netdxnow calculates additional summary statistics to quantify variability within and across simulations for model diagnostics. See the help page for the associated print function for futher details:
deduplicateargument to randomly select one transmitting act in the case that multiple potential transmissions occur within a time step to the newly infected person.
get_simsnot properly subsetting
- Fix parallel memory leak in
- Rework the network resimulation module to allow for working with observed network data. See this EpiModel Gallery Example.
- Fix error message for tergmLite/resimulate.network collision
tracker.netmodule was removed as an optional extension module, and this functionality is now default for all network models (built-in and extension models). See the Working with Attributes and Summary Statistics Vignette for more details.
- Speed up the transmission matrix (
transmat) storage by using
padded_vectorinstead of repeated
rbindcalls. The result of
generate_random_paramsinstead of bespoke code.
- Standardize and speed up the summary calculations and plotting functionality for
- Streamline unit tests for testing on CRAN.
CRAN release: 2022-07-19
- Network models can now use predefined scenarios with the
use_scenariofunction. See the Working with Model Parameters vignette for details.
trim_netestfunction has been added to reduce
netestobject sizes in common use cases.
networkLiteclass now supports some additional functionalities.
- Duration = 1 time step models in
tergmLite = FALSEnow use
tergmsimulation to produce a
networkDynamicclass object, similar to the duration > 1 time step case.
netdxnow supports heterogeneous dissolution model diagnostics. See the example in
type = "duration","dissolution"for homogeneous (“edges-only”) dissolution models.
- Network model parameters can now be supplied to
data.frame. See the Working with Model Parameters vignette for details.
- A new term
fuzzynodematchwas added, to support modeling of more generalized notions of homophily.
- Network models can now be checkpointed to automate saving, recovering, and restarting simulations after interruption, as might occur with large-scale simulation jobs on high-performance computing (HPC) systems. See
- EpiModel’s custom terms
absdiffnodemixare now usable again (due to enabling symbol search).
- The correct formula is now used in
sim_nets_t1when initializing the network with the non-nested edges dissolution approximation approach in
- References to
networkclass internals have been removed from
net.utils.Rto make the code function properly with
update_dissolutionnow correctly handles duration 1 models.
get_cumulative_edgelistsnow throw informative errors when the
networkrefers to non-existing networks.
get_cumulative_edgelists_dfwill throw errors as well as they call those functions internally.
- fix double memory allocation in
ncores > 1
updater.netmodule was removed as an optional module but its functionalities are now the default behavior for all network models (built-in and custom).
- The parameters
control.netrespectively were renamed
.control.updater.list. The leading dot indicates that these are built-in EpiModel elements not to be confused with the user-defined ones.
- Dissolution models using the
nodefactorterm have been deprecated.
stergmcontrols have been deprecated in favor of
- Formula-style simulations are used consistently for both
tergmsimulation, requiring control arguments of class
ndtvis added to “Suggests” (again) and
plot.transmatnow accepts the
- Systematic review and improvement of documentation across the package.
netdxnow have default control arguments following R’s default argument mechanism.
- Simulation names are now attached to
netsimobject fields produced via the
- Imputed durational corrections for onset-censored edges are now sampled from a geometric distribution rather than simply using the mean of that distribution.
CRAN release: 2022-02-02
- Improved optional module
updater.netallowing it to update the model controls as well as the parameters. See the vignette, “Working with model parameters.”
- General updates to the names and content of the included vignettes.
- Fix dissolution model statistics calculations for
netsimin the case with a model with an “end horizon” (when the network is not resimulated at the end of the time series).
- Fix duplicate printing issues across
- Fix use of
all.equalin unit tests as requested by CRAN.
- Change defaults of newly introduced cumulative edgelist functionality to not store it (improves speed).
posit_idsto return unchanged
- We have changed the names of arguments from the function
get_partnersnewly introduced in EpiModel v2.2.0:
max.ageis renamed to
truncatefor consistency with the other cumulative edgelist functions;
only.active.nodesto clarify that this argument subsets by nodes and not by partnerships.
CRAN release: 2021-11-09
- Developed a general approach to tracking and querying historical and contacts, called a cumulative edgelist. This may be used, for example, to query the recent but non-current contacts of newly infected nodes. See the vignette, “Working with network objects”.
create_dat_objecthelper function was added to standardize the creation of the core
- The current timestep within
netsimsimulations is now stored in the
datobject and accessible with
get_current_timestep. This eliminates the need to explicitly pass
atas a function argument, although that is still allowed.
- Addition of the
get_param_setfunction that extracts from a
netsimobject the set of parameters used by each simulation. See the help page:
- Developed a mechanism to store nodal attribute history over the course of a
netsimsimulation. See the vignette, “Working with attributes and summary statistics.”
- Developed an optional module to define prevalence statistics (also called “epi stats”) as functions to be passed to the model as control settings before each
netsimsimulation. This allows users to avoid updating the
prevalence.netmodule. See the vignette, “Working with attributes and summary statistics.”
- Developed an optional module allowing the update of the model controls and parameters over timesteps within
netsimsimulations (i.e., time-varying parameters). See the vignette, “Working with model parameters.”
- Improved the random parameterization programming interface to allow correlation between parameters in each simulation (e.g., the ability to pass in a multivariate parameter set for each simulation). See the vignette, “Working with model parameters.”
- When calling
netsimobject, the arguments in the ellipsis (
...) are now correctly passed to the
- When trying to use the built-in
netsimwill now output a more explicit error if the values used are not only
- Fixed the names of the target formation statistics in
edapprox == FALSEthat were causing the plotting functions to misbehave.
- Simplification of the
set_transmatfunction removing the assumption that
dat$stats$transmatwas to exist only if
at != 2(thanks to @thednainus).
- More consistent formation and dissolution statistics print between
- Removed duplication in the printing of the parameters when a parameter was defined both as fixed and as random.
- When using custom
type == NULL, some built-in modules no longer stop because they required
typeto be a string.
- Fixed issue with
- Fixed problem with unique ID counter not saved by
saveout.net, resulting in the unique ids to start a 1 again when restarting a model from a previous simulation.
- The new home for EpiModel on Github is: https://github.com/EpiModel/EpiModel. It was previously located on the
statnetorganization on Github.
CRAN release: 2021-06-25
- Summary network statistics for
netsimclass objects (epidemic simulations) are now available when
tergmLiteis used. Previously these network statistics were only available when
tergmLite = FALSEbut updates to the
tergmLitemade this possible. These network stats are output with
- Developed a general storage and printing mechanism for the recently developed random parameterization interface. See the help page
- Cleaned up the handling of the initial network simulation in
initialize.net, so that the user-facing code in that function is more readable, and the more complex code is put in
- Added new
update_paramsfunction to add new parameters to an existing list of network parameters specified in
param.net. This aids in workflows that distinguish fixed parameters versus varying parameters that may change across scenarios or simulations.
- Added new general interface for random parameters in network models that allows randomly drawing a parameter value from a specified statistical distribution, where the distribution may either be a sampling of discrete values or a factory function for any of R’s random statistical distribution functions. See help file for
- Implemented a standardized approach with helper functions for setting core attributes (those nodal attributes which should be present in any workflows) in network models. This functionality is specified with
append_core_attrfunction in the initialization and arrival modules in any extension models. This includes a standardized implementation of persistent, unique IDs as an attribute that remains constant for nodes even with open population models.
- With the use of a standardized core attribute framework that now correctly handles unique IDs in all models, now the transmission matrix objects output from any network model work consistently and correctly for both closed population and open population models.
- For DCM models with
dt < 1, fix
NAoutput for any
- Reduce complexity of some unit tests that were stochastically generating errors due to ERGM MCMC estimation problems.
- Fix problem with temporally extended status variables in network models (i.e., tracking of disease status history across time steps) by simplifying the general approach that works across built-in and extension model types.
- Reimplemented the handling of relational age diagnostics in
netdx, with updated numerical summaries in
print.netdxand visuals in
plot.netdx. Because relational ages are left-censored for any edges that existed at time zero, this led to a misleading diagnostic that ages were lower than the targeted durations. Imputation of a start time for those edges was added, with the option in
plot.netdxto visualize with imputed start times (default = TRUE) or not.
- More consistent approach to trimming unneeded environmental data from ERGM objects implemented with
statnet.common::trim_env(), used in
- Reimplemented the
netest“edges dissolution approximation” for efficient estimation of a temporal ERGM via a cross-sectional ERGM estimation with adjustment of formation model coefficients (see
netesthelp page). This new approach further reduces bias in the approximation method, plus now allows for non-nested dissolution models (i.e., dissolution formula does not need to be a subset of the formation formula).
CRAN release: 2020-11-09
- Implemented an error catching approach for
netsimso that epidemic modules with errors or warnings are clearly identified in the console.
- Allow saving the transmission matrix with
control.netindependently of using tergmLite methods (previously use of tergmLite did not allow for saving these data).
- Added an
infstatparameter to the internal
discord_edgelistfunction used in the infection module, to allow for arbitrary specification of which disease statuses are considered infectious for the purpose of dyad discordance.
- Added ability to vary node size in
type = 'network'with
- Fix issue for
plot.netdxwhen plot legend set to
print.netsimthat does not error when displaying new epidemic modules for extension models.
- Use appropriate tergmLite resimulation methods for
netsimfor networks with duration of 1 (i.e., one-time contacts handled with cross-sectional ERGMs).
- Further minor edits/updates to EpiModel 2.0 migration documentation (posted on https://www.epimodel.org/).
- This release introduces a major update to the EpiModel package infrastructure and application programming interface for both built-in models (primarily used for teaching purposes) and extension models (primarily used for research purposes). The major substantive changes are summarized in a EpiModel 1.x to EpiModel 2.0 migration guide on our primary website: https://www.epimodel.org/.
CRAN release: 2020-05-08
- Improve error handling for inputs to
- Skip dissolution diagnostics in
netdxif a static ERGM is passed.
CRAN release: 2020-01-07
- Add foundation updates to support the
tergmLitepackage (to be released).
- Print network statistic diagnostics stored in
print.netsim(x, formation.stats = TRUE).
CRAN release: 2019-08-29
- Add a
netdxto skip dissolution diagnostics for computational efficiency.
CRAN release: 2018-12-18
- Two helper functions,
apportion_lr, ported over from EpiModelHIV.
- Two custom ERGM terms,
absdiffnodemix, ported over from EpiModelHIV.
- Fix linked functions in embedded Shiny apps broken in v1.7.0.
- Update handling of parameter and module name changes related to births/deaths to arrivals/departures renames in v1.7.0.
- Reduce complexity of verbose output so that it can generalize across EpiModel extension packages.
- Fix bug in
dtcontrol setting < 1.
CRAN release: 2018-11-21
netdxto allow for retaining the full
networkDynamicobject during dynamic network simulations. Relatedly, add support for
get_networkto extract those networks from
- Change the default handling of
as.data.framefunction for processing model output for all three model classes (DCM, ICM, and Network Models) to generate a stacked data frame of all simulations (instead of row means across simulations). This is a breaking change that may require updating old code.
as.data.frame.netdxfunction extracts the timed edgelists directly from a
get_nwstatsfunction now extracts data frames of network statistics from both
- Improve functionality and error handling of
- Fix problems with color handling of network statistics plots in
- Enforce maximum number
netdxto prevent over parallelization of simulations.
- Removed the redundant storage of the timed edgelist data in
- Fix errors in calculation of population sizes in verbose module that prints simulation output to the console.
- Add warning for input parameter with a name
act.rate.m2for network models in
param.net, as this is an unused parameter for built-in models.
- Updated parameters and documentation throughout EpiModel for vital dynamics parameters and processes to reflect a more general method of demographic in-flows and out-flows from the population. Previous terms were births and deaths; new terms are arrivals and departures. The default parameter for births was previously
b.rate; it is now
a.rate. Inputs of a
b.rateparameter yield a message and will automatically set
b.ratevalue. This is a breaking change that may require updating old code.
- Adapted y-axis limit calculation for all stochastic plots to depend on dynamic range of data displayed instead of full data range.
- Changed the default plot type for static diagnostics in
dynamicis set to
FALSE) to smoothed rolling averages instead of the full MCMC trace. The trace plots may be turned back on with
sim.lines = TRUE.
CRAN release: 2018-04-10
netdxnow includes a new argument,
sequential, for static diagnostics that mirrors the same argument from
ergm::simulate.ergmto simulate from MCMC chains based on previous draws versus new draws.
ggplot2from depend to import.
- References added for publication of Journal of Statistical Software methods paper on EpiModel: Jenness SM, Goodreau SM, 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.
CRAN release: 2018-01-25
CRAN release: 2018-01-24
icmclasses now allow creation of a single data frame with epidemic outcomes across multiple simulations, where previous only single individual simulations would be output. This is specified with the
sim = "all"parameter when
out = "vals". See the help page for examples. This “tidy” data format allows for easier integration with external plotting and analysis approaches, including ggplot2.
geom_bandsis a new “geom” for use by
ggplot2to facilitate plotting of simulation intervals given a specified lower and upper quantile set. Examples of plotting ICM simulations are provided, and the same principle applies for network models. As a result of this,
ggplot2was added as a depend.
truncate_simsis a new utility function that takes truncates the time series of a
icmclass object at a specified time step. This truncation will remove all epidemic output before that time step, and reset the control settings to start at that time step. This is useful in our modeling workflows when we need to remove a pre-intervention burnin period from the model simulations.
init.netallows you to pass in a vector of backwards-looking infection times for those initally infected at t_1 through the
infTime.vectorparameter. Combined with the
status.vectorparameter, this provides users maximal control over who is infected and for how long as initial conditions.
- Fixed bug in DCM Shiny app related to plotting prevalence vs count outcomes.
- Removed unneeded and unused input parameters from
- Fixed issue where SIS/SIR models with vital dynamics, and a low mortality rate relative to the recovery rate (which is typical) would get very long initial infection times assigned at t_1.
- Changed the title (actually, it’s a subtitle) in the DESCRIPTION to: “Mathematical Modeling of Infectious Disease Dynamics”.
- Deprecated the
init.icmthat allowed users to specify a random number of initially infected. Support for this got too complex for a little (or never) used argument, and users interested in randomly setting the initial number infected may control this more flexibly with the
CRAN release: 2017-06-01
- Reset the
verbosedefault for network models to
TRUE(reverts change in v1.3.0 specifically for network models).
legargument name (to add default legends to plots) to
legend. Note this is backwards-incompatible because of fuzzy matching with other function arguments starting
leg; prior model code must be updated.
- Change default transparency level to 0.5 (if unspecified).
CRAN release: 2017-03-13
nstepsmay now be a vector of time steps or, as before, an integer containing the number of time steps within a DCM simulation. For example,
control.dcm(..., nsteps = seq(1980, 2015, 1/12), ...)for solve for monthly outputs from a range of dates from 1980 to 2015.
mutate_epifor adding new variables to a epidemic simulation object now works for all three model classes.
- Outputs from
controlfunctions are now dual-classed as lists as well as their native classes.
- When passing a
control.dcm, printing the
control.dcmobject no longer yields a warning and instead prints the function name.
- Update handling of transparent colors within
transcoto use the base
- Derivatives tracking a “flow” or the size of a transition between compartments for DCM simulations (e.g., disease incidence) often output
NAfor the final value, creating issues with analyzing those data. Those
NAs are replaced with the penultimate value of that vector.
- Simplify printing of
netsimobjects to list “Variables” together instead of dividing them into compartments, flows, and other.
- Change the
popfracdefault for plotting
FALSE. This avoids any problems when prevalences are already stored within the model simulation.
- Change the
verbosedefault for control functions to
CRAN release: 2016-12-16
- Print simulation number and prevalence value for static network plots in
min, or `max.
- Add new line at end of
- Tighten the default ylim ranges for
CRAN release: 2016-07-30
- Add new
mutate_epifunction inspired by the
dplyrpackage, to add post-hoc summary statistic calculations to completed network simulations. See the function help file for examples.
- Added a speedy
get_degreefunction that returns a vector of current network degree for each person in a network.
- Updated internal plot functions that calculate prevalences.
- Disable verbose output if running network models in parallel.
CRAN release: 2016-05-24
- Updates to
as.phylo.transmatto fix issues with vertex exit times and to now accept multiple seed vertices if multiple seeds are detected, returning a list of phylo objects of class
multiPhylofollowing the convention of
- Corrected an error governing the birth rate of 2-group, open-population deterministic compartmental models (DCMs).
CRAN release: 2016-03-09
- Added multicore functionality to simulating stochastic network models with
netsim. This only supports single-node frameworks currently, using the
doParallelpackage. Run models in parallel by using the
- Modifications to the
as.phylo.transmatfunction to construct the phylo tree with all network vertices as phylo-tips and all transmissions as phylo nodes.
- The stochastic network model Shiny application now features adaptive concurrency levels with ERGMs including that network statistic.
plot.netsimnow correctly functions for diagnostic plots (
type = "formation") when summary statistics contain variable names with numeric values as suffixes.
- Avoided duplicate reinitialization of persistent IDs for network models started with a full STERGM fit (
edapprox = FALSEin the
- Fixed error for stochastic network model simulations in
netestwhen models were fit with the full STERGM method.
- Automatically set
control.netwhen user passes in any new birth or death modules.
CRAN release: 2015-11-03
- New translation and plotting functions for temporal transmission chains measured in stochastic network models. These include a dendogram using methods from the
apepackage and a transmission timeline from the
ndtvpackage. See the help files for the
- Added a Shiny application for stochastic network models. This may be accessed from within the package with
epiweb(class = "net"). It is also hosted online at shinyapps.
get_simsfunction is used to extract individual simulations from larger
netsimobjects. This function has been updated to include a
varargument that allows for automatic calculation of which simulation is closest to the mean across all simulations for extraction.
- Added a quantile extraction method for
netsimclasses. This will provide a data frame of output corresponding to defined quantiles across all simulations contained within a model object.
- Supress warnings with the lowess smoother in
plot.netsimin cases where there are
NAvalues in the epidemiological output.
- Removed error check for
typeis missing, and automatically sets
"SI". This will impact extensions to EpiModel in the case when the default transmission module is replaced.
- Fixed bug in
netdxon calculating summary statistics from models with multiple structural zeros for target statistics.
- Changed the default of
status.rand, which controls whether the number initially infected in stochastic epidemic models, to
FALSE. This will ensure that exactly the number specified in
init.netare matched in each simulation.
- Fully removed the
netsim_parallelfunction from the package. See the EpiModelHPC extension package at https://github.com/EpiModel/EpiModelHPC for running network simulations in parallel.
CRAN release: 2015-07-24
check_bip_degdistnow uses more tolerant checks of equality when comparing bipartite mode statistics.
- Fixes a formatting issue with output for DCMs run with the
- Fixes a variable name collision problem for epidemic plotting functions.
- Removes long burn-ins from network model estimation in
netestto improve performance of fitting models.
- In stochastic network models, one may now remove built-in modules, such as
births.FUN, from the dynamic workflow by setting the argument value for that module to
CRAN release: 2015-07-08
calc_eqlfunction now returns test statistics invisibly.
- Major overhaul of plotting functions for stochastic model plots.
plot.netsimis now a separate method for epidemic plots (it was previously a function call to
plot.icm), with function arguments and default settings more consistent across plotting functions. There may be minor backwards incompatibility for some epidemic plots. Network statistic plots in
plot.netsimnow use the same methods and share the same defaults. The defaults for these plots will be to plot smoothed quantile bands (the IQR) and means of simulations without the individual simulation lines. Any individual elements may be toggled on or off as before.
- Modules are now listed in the output for
netest. This argument specified the right- hand sided dissolution formula for temporal ERGMs. It was removed because this formula was already specified in the
dissolution_coefsfunction, the output of which is passed to
netest, thereby removing the duplication.
as.data.framemethods for stochastic models remove
NAfrom individual simulations when calculating row means.
- Fixed bug in network birth module for assigning infection status for incoming nodes.
netestnow correctly controls the model fitting output level in the underlying
merge.netsimnow correctly checks elements of two objects to be merged when the classes of those elements may be of length greater than 1.
- Major updated internal package function testing for more reliable performance.
epiwebto pass additional arguments to
- Importing the
utilspackages as required by CRAN.
CRAN release: 2015-05-16
- Built-in parallelization of stochastic network model simulations directly within the package with the
netsim_parallelfunction has been deprecated. This functionality has been replaced with model simulation functions within the
EpiModelHPCextension package: https://github.com/EpiModel/EpiModelHPC
- Cosmetic and functional updates to built-in Shiny applications accessible within the package via
- New function,
calc_eql, calculates whether a model of any class in EpiModel has reached an equilibrium state over a defined time series. Equilibrium is defined as the absolute value of the difference of the maximum prevalence and minimum prevalence over a specified time series falling below a specified threshold. For stochastic models, these values are calcualted based on the mean of the individual time series simulations.
netestnow includes a new argument,
nonconv.error, that will send the function to an error state if the ERGM did not coverge after the specified number of interations. The default is to allow for a nonconverged model fit to be returned. Requiring an error may be helpful when running a number of models in batch mode.
- Within the built-in deterministic compartmental models solved with the
dcmfunction, there was an error in the calculation of flows (e.g., disease incidence or number of deaths per unit time) when the models were integrated with methods other than the “Euler” solution. Flows are now calculated correctly for all numerical integration methods supported via the
- Minor bugs in the default deaths module for stochastic network models were corrected.
CRAN release: 2015-04-12
- A limited set of heterogeneous dissolution models now allowed for network models (#184): edges + nodematch, nodemix, or nodefactor formulas now supported. See help file for
- Network models now feature more consistent and flexible use of persistent IDs for networkDynamic objects (#199). This involved adding a new control setting,
control.net. See help(“persistent.ids”) in the
networkDynamicpackage for more background.
- Interventions are added to all model classes (#20). For DCMs, ICMs, and network models, there are new parameters, inter.eff and inter.start, for the efficacy and starting time of the intervention. This generic intervention has the effect of reducing the probability of transmission given a contact between a susceptible and infected person by the efficacy parameter.
CRAN release: 2015-01-18
control.netis even more flexible, to allow for passing different class elements into
netsimwith original models.
merge.netsimthat allows bypassing the stop error if the parameters and control settings from the two merged objects are not identical.
module.orderargument to provide control of the order in which modules are evaluated within each time step. The default ordering is maintained as explained in the updated help file.
netsim_parallelnow returns the correct object if used for single simulations or on single cores.
plot.icmremoves NA values from the data when calculating
ylimand the quantile bands.
CRAN release: 2014-12-01
dede, which if true allows for delayed differential equations to be passed into a new model solved with
- New option for
netdxto simulate static diagnostics from an ERGM, rather than the temporal diagnostics (still the default). This will help better diagnose poor dynamic model fit when using the edges dissolution approximation (#175).
- Plot option added for
netdx, with the
methodparameter, to plot boxplots of the simulations against the target statistics. The default is still the line plots (#191).
- Additional summary elements may now be plotted with
netdxobjects, similar to epidemic data plots: mean lines and quantile bands. Additional arguments added to allow toggling of these along with individual simulation lines and target lines.
- Print method for
netdxis updated, along with a new statistic for the percent deviation between the simulation means and target statistics (#192).
- Added other epidemiological outcomes saved in user-defined modules to print output with
- New function
get_simswill subset and extract entire simulations from
netsimobjects with multiple simulations. A vector of simulation numbers may be specified, or if set as “mean”, the simulation with the infected prevalence closest to the means across all simulations will be chosen.
deSolvemoved from import to depend (#194).
CRAN release: 2014-11-02
- Added dissolution diagnostics in
netdx, for the proportion of edges that dissolve per time step, as another diagnostic for the dissolution model (#53).
- Network plots with
plot.netsimnow allow specifying
"max"to plot the network at with the most average, maximum, and minumum disease prevalence at the specified time step (#73).
- Network models may now use time-varying recovery rates, similar to the previous time-varying infection probabilities and act rates. The documentation for the
param.netfunction has been updated with details (#65).
- New control setting for DCMs,
param.sens, that allows bypassing the default behavior of evaluating parameters with length greater than 1 as sensitivity analyses. This should be used for single-run models if passing in parameters with arbitrary form.
- Print functions for initial condition processing functions now handle list and data frame structures (#135).
- Fix bug for new DCMs in which the initial condition names include standard integrated initial condition names (#160).
- Several bugs fixes related to network diagnostics for models with offset terms in the formation model. Also related formation diagnostics plots in
- Initialization of infection time for stochastic SIS/SIR models with two groups or modes now fixed (#102).
- Edges population size correction module,
edges_correct, now runs for any dependent network simulations, not just if built-in vital dynamics modules are called (#141).
- The new website for the EpiModel project is https://www.epimodel.org/
- Added a new example of a SEIR Ebola DCM in the “Solving New DCMs with EpiModel” tutorial.
- The shiny apps now use the single file method (#155).
- Exported and added documentation for the
- Other elements saved in network simulations with the
save.othercontrol setting in
control.netare now printed as output in
CRAN release: 2014-10-01
- Added three new extraction functions for network models (
get_nwstats) which extract the network objects, transmission matrices, and data frame of network statistics from a completed
netsimsimulation. These functions also support extraction of network model simulations with multiple networks (see API note).
- The plot function for
netsimobjects now has an argument, network, for plotting network statistics and static networks (
type = "formation"and
"network", respectively) in simulations with multiple networks.
- For stochastic epidemic plots, added an option
TRUE, this uses a lowess smoother on the outcome variables of interest. This is helpful in visualization of low-count outcomes like disease incidence.
- Automatic parallelization of network models is now possible with the
netsim_parallelfunction. Note that this is experimental and has not been tested extensively across platforms, so bug reports are welcome. Two parallel methods are supported:
doParallelfor multiple cores on a single node, and
doMPIfor multiple cores across multiple nodes. The latter requires an MPI installation on a linux-based cluster.
- Network diagnostics in
netdxalso accepts a new
ncoresargument, which will run the diagnostic simulations and calculations on those simulations in parallel on a specified number of cores (single node only).
- Added an argument,
skip.check, for the control settings in both ICM and network model classes, which overrides the default error checking of parameters, initial conditions, and control settings. This should only be used for original models with new modules that may unnecessarily trigger a check error.
- Added an argument,
save.other, for the control settings in network models, which is a character vector of other elements from the main data list,
dat, to save out in the simulation.
- Added an argument,
start, for the control settings in network models, which is a starting time step to resume simulations. In this case, the
netsimis a previously saved
netsimobject rather than a
startargument should be one integer higher than the
nstepsin that earlier
nstepsargument should now be the final steps for the simulation. Note that this requires specifying
save.other = "attr"in the control settings, as well as saving the networks.
- Added progress bars for
netdxdiagnostic simulations for computationally intensive parts of the simulations.
- Network model estimation with
netestnow provides an output argument. When using the edges dissolution approximation (
edapprox = TRUE), one may set output to
"sim"to save a static simulation network instead of the
ergmobject as an element of the
netestoutput. This is mainly for file size efficiency.
- The internal representation of disease status as an individual-level attribute in the stochastic ICM and network models has been changed from number
(0, 1, 2)to character
("s", "i", "r"). This changes little when running the integrated models, and has greater implications for the API when editing modules. But one change for integrated models is that the status vector passed into the initial conditions functions must now be in this new format. This also impacts the expansion of EpiModel for original models.
zeromargargument has been removed from
plot.netsimfor static network plots (
type = "network") to reduce potential issues with setting default margins on plots. Now they must explicitly be set with standard par options.
- For ICMs and network models, the internal main data object has been renamed from
datto prevent function name conflicts. Additionally, all summary output is now stored within
dat$epi, whereas the previous location was
- The ordering of built-in modules within a time step for network simulations has been changed such that the network resimulation module is run before the infection module. There should be no substantive differences in model results, but this provides a more logical consistency between edges toggled on at a time step and the infections that may occur over those edges.
- In network models, two preset functions have been changed to replaceable modules:
verbose.net. The former performs the adjustment to the edges coefficient for network models with population size changes, in order to preserve the mean degree; for mass action epidemic models, for example, one would not want this adjustment, so the module should be set to NULL in
control.net. The latter performs the printing of simulation results to the console. Both functions are now listed in the modules help file accessed by:
- Evaluation of parameters, initial conditions, and control settings in the core parameterization functions is now more stable, and also more flexible. Defaults for the fixed arguments are now included in the documentation.
- Users may now bypass the built-in
controlfunctions altogether for original ICM and network models, because the definition of new and replacement modules occurs within the control functions themselves. The existing control functions should be used as a template if one is considering replacing these parameterization functions.
- Users may also bypass any of the built-in modules in network models (see the list in
control.net) by setting the argument for that module to
NULL. This may be replaced in the future by a user-defined ordered vector of modules.
xargument in netsim may now be a list of
netestobjects. This would be used only if supplying new simulation modules that know how to process that data structure. The motivation for this is to allow original models with multiple networks simulated (e.g., a main partnership network and a casual partnership network).
- Minor updates and bug fixes to the two built-in Shiny applications (accessed via the
epiwebfunction). These apps now benefit from the more stable parameterization functions.
- Updated the
param.netclass to handle parameters that are lists or data frames.
merge.netsimnow ignores any differences in the environment of the
nwstats.formulacontrol, previously preventing proper merging of some network model simulations.
- Added new test cases for running new DCMs, ICMs, and network models, following the vignette examples (see https://www.epimodel.org/).
CRAN release: 2014-08-30
- The trans.rate and trans.rate.g2/m2 parameters have been renamed to inf.prob and inf.prob.g2/m2 to better characterize that they are probabilities, rather than rates, and towards infection of persons in that group/mode.
- Added new documentation for newly exported utility functions for network models, mostly used in the birth/entry modules. Now users may directly edit these modules and use the utility functions without explicitly adding them to the global environment.
- Added warning message for network models in which there is a vertex attribute for status added to the network but not referenced in the formation formula, in which case the initial conditions for status will still be derived from the input for init.net. This does not apply to “serosorting models”, which reference status in the formation formula, and which require setting status as a vertex attribute on the network before calling netest.
- Network models with passed network attributes in the formation formula in open populations now do not generate an error for persistent ID numbers in the latest versions of the tergm and networkDynamic package.
- Fix bug in printing simulation progress in network and ICM class models when verbose is not specified in the control settings.
- Running netdx diagnostics with offset terms in the formation no longer generates an error.
- Simulating an SIR serosorting network epidemic model (status in the formation formula) no longer stops due to missing r.num in init.net.
- Fix bug when calling netdx for one simulation only with a network model fit with the full STERGM method (i.e., using the edapprox = FALSE in netest).
CRAN release: 2014-07-29
- Added coef.form argument to netest for network model formation formulas with offset terms.
- Allow edge duration of 1 in netest when using the edges dissolution approximation (handles one-off partnerships in network models when using the approximation).
- Death modules for network models are now contained in one function, deaths.net, to facilitate replacement death modules from users. This is also now consistent with the death module for ICMs.
- Automated plotting of target statistic lines to plot.netsim formation plots, matching the methods of plot.netdx formation plots.
- netdx now simulates from a different starting network at the begining of each dynamic simulation, eliminating correlation at time 1 across simulations.
- Can now pass status.vector into init.net for bipartite simulations.
- Several plotting and printing bugs fixed.
- Fixed bug in network models for open populations in which an attribute was passed to the network in the formation formula (e.g., serostatus mixing models).
- Added internal test structure for build checking.
- Added a help file document for building ICM modules at ?modules.icm.
- Expanded and clarified tutorial documentation, available at: https://www.epimodel.org/
CRAN release: 2014-06-09
Model parameterization for all model classes has been substantially revised to improve organization and ability for expansion. Whereas previous models required input of parameters directly into the main functions (now: dcm, icm, and netsim), now the parameters are input into three parameter-processing functions: param, init, and control. The param function sets the core epidemic parameters, the init function sets the initial conditions, and the control function specifies other model settings. These functions are class-specific, so each function has a .dcm, .icm, or .net suffix.
Modeling functions have been renamed for clarity and consistency:
dcm is now used for deterministic compartmental models (replaces epiDCM)
icm is now used for stochastic individual contact models (replaces epiICM)
netest is now used for network model estimation (replaces epiNet.est)
netsim is now used for network model simulation (replaces epiNet.simTrans)
Network models with independence between epidemic/demographic processes and network structures (independent models) were previously first simulated with epiNet.simNet, and then those pre-simulated networks were input to epiNet.simTrans. Now the network model simulation is all handled within the simulation function, netsim.
Network model diagnostics have been moved from within the network estimation process (netest) to their own function: netdx. The parameter names for running, printing, and plotting the results of these diagnostics have been updated for consistency. See ?netdx and related functions.
Internal model functions have been significantly revised to improve efficiency.
The dcm function can handle model functions, parameter sets, and initial conditions of arbitrary complexity. See the HTML vignette on this topic at: http://www.epimodel.org/
Moved the package vignettes external to the package to reduce package size and build time.