ergm.ego.popsize argument to netest() exposing the popsize parameter of ergm.ego::ergm.ego(). Defaults to 0 (preserves prior behavior); set to 1 for per-capita scaling of the edges coefficient, which lets the fitted model be applied to networks of arbitrary size. Closes #936.list_special_params so param.net_from_table correctly fails if a reserved parameter name is passed in the parameter table.cumulative.edgelist recording of the head and tail of nodes. Previously it was inverted. This had no effect on undirected networks but would on directed onesparam.net so that values supplied via data.frame.params (notably act.rate, and the vital-dynamics parameters a.rate / ds.rate / di.rate / dr.rate) are no longer overwritten by the constructor's defaults. Closes #1029 and #1031.create_scenario_list and generate_random_params so they no longer fail when their input data.frame (a scenarios.df, or a param.random.set) contains a single parameter column. Closes #1045.netsim() now validates that each per-step module returns the netsim_dat object. When a custom module forgets return(dat) (or otherwise returns the wrong type), the simulation now stops with a clear error naming the offending module and pointing at the likely cause, instead of failing on the next module with the cryptic argument "dat" is missing. Closes #987.?icm, ?param.icm, and ?init.icm that lingered after #980. The help pages now state plainly that ICMs support the built-in SI, SIR, and SIS disease types only and direct custom-model users to netsim() / control.net(type = NULL, ...). Closes #1032.make_module_list verbosity. It now messages if control$module.order is not provided and list the modules and there order.control.net() now validates module.order at construction time. Entries that don't correspond to a .FUN argument supplied to control.net() (typos, or names whose function was never passed) now produce a clear error rather than a cryptic NULL-as-function failure at runtime. initialize.FUN and verbose.FUN are explicitly rejected from module.order since they run outside the per-step module loop and would double-execute if included. Additionally, control.net() now warns at construction time when a custom module.order is set but omits resim_nets.FUN, summary_nets.FUN, or nwupdate.FUN — three built-ins whose absence typically produces silently incorrect simulations rather than visible errors. The warning is suppressed for built-ins that the user has explicitly disabled by passing NULL. Resolves the remaining cryptic-error footgun from #988 and the silent-failure surface that motivated #1030.control.icm() no longer accepts .FUN arguments (e.g., infection.FUN, departures.FUN), skip.check, or additional modules via ...; ICMs now exclusively support the built-in SI, SIR, and SIS disease types. Users with custom modules should migrate to netsim() / control.net(), which provides full extension model support. Closes #634.trans.rate / trans.rate.g2 → inf.prob / inf.prob.g2; .m2 suffix → .g2; births.FUN / deaths.FUN → arrivals.FUN / departures.FUN; depend → resimulate.network; b.rate / b.rate.g2 → a.rate / a.rate.g2 (the last now produces a standard R unused-argument error). Closes #989.legend in plot.icm() from TRUE to NULL. The legend is now auto-shown only when y is auto-populated; when the caller supplies y explicitly, no legend is drawn unless legend = TRUE is passed. Matches the plot.netsim(type = "epi") policy and avoids single-entry legends. Closes #1012.netsim cumulative edgelist (cumulative.edgelist = TRUE) to include edges from the initial network state and to share the networkDynamic time origin. Previously, update_cumulative_edgelist() was first called at at = 2 from resim_nets(), so persistent cross-section edges received start = 2 (off-by-one) and edges active during the initial ERGM→TERGM step but not at at = 1 were silently dropped. The cumulative edgelist is now seeded at the end of sim_nets_t1() so persistent cross-section edges get start = 0, stop = NA; edges formed during the first TERGM step get start = 1, stop = NA; edges active in the cross-section but dissolved by the first TERGM step get start = 0, stop = 0 (mirroring networkDynamic spells [0, 1)). It now matches as.data.frame(get_network(sim)) row-for-row. In tergmLite mode the cross-section edgelist is captured before simulate_dat() overwrites it. Epidemic outputs still begin at at = 1; only the network time origin shifts. Closes #1016.saveout.net to preserve NULL values when saving simulation outputs across multiple runs. Previously, assigning NULL via out[[name]][[s]] <- value silently dropped the list entry, causing misaligned simulation indices. Closes #800.get_sims(), merge.netsim(), and get_param_set() to preserve and report per-simulation random.params draw metadata correctly. Subsetting now subsets param$random.params.values; merging compatible netsim objects now appends those values instead of retaining only the first object's; one-simulation outputs with vector-valued random parameters are now reported correctly.mutate_epi() to replicate scalar constants across all simulations/runs and use existing column names instead of hardcoding "run1". Closes #984.ylim in both plot.netsim(type = "epi") and plot.icm() so the auto-range expands to fit quantile polygons when mean.line = FALSE. The previous guards only triggered for specific qnts / mean.line combinations, leaving polygons clipped at default settings. Closes #1009, #1012.bpal palette in plot.icm() beyond three entries so a fourth and later compartments no longer render as NA. Closes #1012.crosscheck.dcm() where checks for rec.rate.g2 and r.num.g2 were nested after stop() calls. Closes #982.mean.lwd defaults in plot.netsim() where dead-code is.null branches used inconsistent values (1.5 vs 2.5). Closes #983.paste0(..., sep = ", ") misuse in as.data.frame.icm() epi repair messages (caused malformed output with trailing commas). Closes #985.plot.epi.data.frame to correctly display the truncated time axis.on.exit() handler registration in comp_plot() and the internal plot_stats_table() helper so graphical parameters and the scipen option are restored on both error and normal exit, per CRAN policy. Previously the handler was registered after the par() / options() mutations, leaving user state modified if plotting errored in between.dat$run$nw[[network]] accesses with get_network() / set_network() across edgelists.R, net.fn.utils.R, net.mod.init.R, net.mod.nwupdate.R, saveout.R, and update.R. Closes #977.plot.netsim(type = "epi") and plot.icm() so the disp.qnts setup, mean.lwd / mean.lty expansion, and draw_qnts() / draw_means() calls are not repeated across the ylim-calc and drawing phases, and aligned remaining stylistic differences between the two sibling paths to keep them structurally symmetric. Closes #997, #1010, #1012; the remaining shared-helper refactor is tracked in #1018.plot_netsim_stats() and plot.netdx() into a shared validate_stats_selection() helper; added xlim, xlab, ylim, ylab parameters to plot.netdx() for parity with plot.netsim(type = "formation"). Closes #998.control.net() docs that module.order is independent of resimulate.network, and that tergmLite = TRUE forces resimulate.network = TRUE; changed the tergmLite override from message() to warning() so it surfaces in batch/HPC logs. Closes #466.Intro, attributes-and-summary-statistics, model-parameters, network-objects) to reflect the current API and accessor patterns. Closes #976.?net-accessor, ?update_params). Closes #1024.control.dcm() from "rk4" (fixed-step Runge-Kutta 4) to "lsoda" (adaptive step-size). The "lsoda" solver automatically adjusts its internal step size, preventing numerical instability (negative compartment sizes, NaN values) that could occur with "rk4" for models with high transmission rates or stiff dynamics. Users who require the previous behavior can set odemethod = "rk4" explicitly in control.dcm(). The "lsoda" method is also the default solver in the deSolve package.init.dcm() (e.g., i.num = c(1, 5, 10)) now produce multiple model runs, one per element, just like vector-valued parameters in param.dcm(). Vectors may be used in both param.dcm() and init.dcm() simultaneously, provided all vectors have the same length. Plotting, as.data.frame, summary, and print methods all work with the multi-run output. Closes #408.epiweb() Shiny applications for both DCM and ICM model classes with a modern interface built on bslib (Bootstrap 5), the Atkinson Hyperlegible font, and interactive plotly visualizations.epiweb("dcm")) is now fully reactive with no run button, includes scenario presets (Flu-like, STI-like, Measles-like), intervention modeling with visual indicators, sensitivity analysis with blue-to-red color ramp, vital dynamics, a narrative Summary tab with R0 and epidemic timeline statistics, and a comprehensive Guide tab.epiweb("icm")) features a Run Model button for on-demand stochastic simulation, mean trajectory lines with IQR ribbons across multiple simulations, the same scenario presets adapted for smaller populations, intervention and vital dynamics support, a Summary tab with stochastic variation statistics, and a Data tab with switchable views (means, standard deviations, individual simulations).make_restart_point function that takes in a netsim simulation object, truncate it to the smallest set of elements required to restart new simulations from. See ?make_restart_point.truncate_sim into an S3 generic with class-specific methods for supported object classes. truncate_sim now supports the dcm model class, along with icm and netsim classes as previously supported. Additionally, there is a new reset.time argument to the function that allows flexibility in whether to reset the truncated model object to a new "time zero".future and future.apply instead of foreach and doParallel for parallelization. The default parallelization behavior being multisession (PSOCK cluster) with a future.use.plan flag / control to use a user defined future::plan. This new default behavior gives a more robust default by avoiding fork based parallelization that can negatively impact many external libraries (e.g. BLAS/LAPACK).numericInput returns integer-class values, which were silently excluded by init.icm's internal sapply(init, class) == "numeric" filter, causing a population size of zero and an "invalid first argument" error in sample().get_sims related to variable subsetting with the var argument.plot.dcm ignoring custom legend names when nruns = 1 and multiple compartments are plotted.df2epi and plot.epi.data.frame to work without warnings with epi.data.frame from truncated simulations.requireNamespace checks for DT and plotly in epiweb() to provide clear installation instructions if these packages are missing.ellipsis (...) was not passed correctly to the base::plot in the plot.netsim function.MCMC.maxchanges to .Machine$integer.max as default for TERGM MCMC. Lift the check on the maximum number of MCMC changes per step for bigger or dense networks.arg = NULL in function definition instead of missing(arg) in function body when possible.messages when a function restarts from a checkpointed state.as.data.frame.icm and as.data.frame.net resistant to cases where some summary statistic ("epi") trackers are smaller than the rest, usually due to restarting. See ?as.data.frame.icm and ?as.data.frame.net.epi trackers as integers by default for improved performance. Automatic numeric coercion occurs when necessary.options() state in plotting functions (comp_plot) to comply with CRAN policy.trim_netest now also removes $summary from netest, massively reducing the final object size.get_core_attributes function to list the core attributes with their types.get_discordant_edgelist where the attribute used to assess discordance as well as the values for each group can be specified.param.net_from_table and param.net_to_table helper functions to convert parameter list and parameter data.frames used by param.net.save.cumulative.edgelist control argument.dat$run. This removes the need to keep track of all the elements required at the end of a simulation. This requires the EpiModel user to put all elements in dat$run.get_forward_reachable and get_backward_reachable functions that works similarly to but more efficiently than tsna::tPath for multiple nodes and using cumulative edgelists.overwrite_attrs, a helper function to overwrite the attributes of the nodes with a data.frame at the start of the simulation. (see ?overwrite_attrs).as.data.frame for model classes netsim and icm now assign the epi.data.frame class in addition to data.frame.plot.epi.data.frame method to plot epi.data.frame similar to plot.netsim(type = "epi").as.epi.data.frame that assign the epi.data.frame class and validate that the input data.frame is correctly formatted.raw.records and attr.history with collections::queue instead of base::list.save.diss.stats to the checked control values. Prevents undefined values when using control.net wrappers.el.cuml, _last_unique_id, and _last_timestep and attr to dat$run and update the tests; part of the restructuring of the dat object.dat$epi$sim.num(.g2) and replace it with dat$run$num(.g2) (single value). These values keep track of the current size of the network and are only needed during model runs.deleteAttr function deprecated since EpiModel v2.4.0.posit_ids as argument must now pass exclusively a numeric vector. Logical vectors are not accepted anymore as they were making the code heavier and were error prone.ergm.ego is now a suggestion to shorten the dependency chain. It needs to be installed separately to use netest with an egor object.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.get_cumulative_degree function 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.get_network and set_network functions created for more consistent access to the network objects within netsim_dat class objects.update_cumulative_edgelist is now called unconditionally and governed by the cumulative.edgelist control.control.net setting cumulative.edgelist == FALSE causes an error.netsim data objects now properly classed as netsim_dat.icm data objects now properly classed as icm_dat, consistent with netsim objects.ergm objects to address backwards incompatible data structures for ergm package v4.5.0.ergm.ego package estimation is now supported. This is accomplished by passing an egor class object instead of a network class object as the nw argument to netest.end.horizon control 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..traceback.on.error and .dump.frames.on.error controls to print the traceback on error even on multicore settings and dump.frames for remote debugging.get_attr_history would crash when attribute history of posit_ids argument was integer(0).saveout.net: missing elements on some simulations now produce a warning instead of an error. Additionally, elements passed to save.other that are not present in the final object are skipped silently instead of producing an error.networkLite class (sparse network representations needed for epidemic modeling) from EpiModel and placed into its own package on CRAN: https://CRAN.R-project.org/package=networkLite.cumulative.edgelist and truncate.el.cuml controls get default values in netsim_validate_control (FALSE and 0). Better messages and warnings are sent when trying to access an uncreated cumulative edgelist.netdx now 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: help("print.netdx").get_transmat adds a deduplicate argument to randomly select one transmitting act in the case that multiple potential transmissions occur within a time step to the newly infected person.get_sims not properly subsetting el.cuml and _last_unique_id.netsim.tracker.net module 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.transmat) storage by using padded_vector instead of repeated rbind calls. The result of get_transmat(netsim_object) is unchanged.unflatten_params in generate_random_params instead of bespoke code.netdx and netsim objects.use_scenario function. See the Working with Model Parameters vignette for details.trim_netest function has been added to reduce netest object sizes in common use cases.networkLite class now supports some additional functionalities.netsim with tergmLite = FALSE now use tergm simulation to produce a networkDynamic class object, similar to the duration > 1 time step case.netdx now supports heterogeneous dissolution model diagnostics. See the example in help("netdx").plot.netsim now supports type = "duration","dissolution" for homogeneous ("edges-only") dissolution models.param.net via a data.frame. See the Working with Model Parameters vignette for details.fuzzynodematch was added, to support modeling of more generalized notions of homophily.help("control.net).absdiffby and absdiffnodemix are now usable again (due to enabling symbol search).sim_nets_t1 when initializing the network with the non-nested edges dissolution approximation approach in netest.network class internals have been removed from net.utils.R to make the code function properly with networkLites.update_dissolution now correctly handles duration 1 models.get_edgelists and get_cumulative_edgelists now throw informative errors when the network refers to non-existing networks. get_partners and get_cumulative_edgelists_df will throw errors as well as they call those functions internally.netsim with ncores > 1updater.net module was removed as an optional module but its functionalities are now the default behavior for all network models (built-in and custom).param.updater.list and control.updater.list in param.net and control.net respectively were renamed .param.updater.list and .control.updater.list. The leading dot indicates that these are built-in EpiModel elements not to be confused with the user-defined ones.nodefactor term have been deprecated.stergm controls have been deprecated in favor of tergm controls.ergm and tergm simulation, requiring control arguments of class control.simulate.formula and control.simulate.formula.tergm.ndtv is added to "Suggests" (again) and plot.transmat now accepts the transmissionTimeline in the style argument (again).netest and netdx now have default control arguments following R's default argument mechanism.netsim object fields produced via the save.other mechanism.updater.net allowing it to update the model controls as well as the parameters. See the vignette, "Working with model parameters."netsim in the case with a model with an "end horizon" (when the network is not resimulated at the end of the time series).print.netsim, print.param.net, and print.control.net.all.equal in unit tests as requested by CRAN.set_attr for posit_ids to return unchanged dat object.get_partners newly introduced in EpiModel v2.2.0: max.age is renamed to truncate for consistency with the other cumulative edgelist functions; only.active is renamed only.active.nodes to clarify that this argument subsets by nodes and not by partnerships.create_dat_object helper function was added to standardize the creation of the core dat object within initialize.net.netsim simulations is now stored in the dat object and accessible with get_current_timestep. This eliminates the need to explicitly pass at as a function argument, although that is still allowed.get_param_set function that extracts from a netsim object the set of parameters used by each simulation. See the help page: help("get_param_set").netsim simulation. See the vignette, "Working with attributes and summary statistics."netsim simulation. This allows users to avoid updating the prevalence.net module. See the vignette, "Working with attributes and summary statistics."netsim simulations (i.e., time-varying parameters). See the vignette, "Working with model parameters."plot on a netsim object, the arguments in the ellipsis (...) are now correctly passed to the base::plot call.group attribute, netsim will now output a more explicit error if the values used are not only 1 and 2.netdx when edapprox == FALSE that were causing the plotting functions to misbehave.set_transmat function removing the assumption that dat$stats$transmat was to exist only if at != 2 (thanks to @thednainus).netdx and netsim.netsim modules with type == NULL, some built-in modules no longer stop because they required type to be a string.Error, Warning or Message in netsim printing twice.saveout.net, resulting in the unique ids to start a 1 again when restarting a model from a previous simulation.statnet organization on Github.netsim class objects (epidemic simulations) are now available when tergmLite is used. Previously these network statistics were only available when tergmLite = FALSE but updates to the networkLite class in tergmLite made this possible. These network stats are output with save.nwstats and nwstats.formula arguments in control.net.help("param.net").initialize.net, so that the user-facing code in that function is more readable, and the more complex code is put in sim_nets_t1.duration = 1 in dissolution_coefs).update_params function 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.generate_random_params for examples.append_core_attr function 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.dt < 1, fix NA output for any .flow variables.netdx, with updated numerical summaries in print.netdx and 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.netdx to visualize with imputed start times (default = TRUE) or not.statnet.common::trim_env(), used in netest.netest "edges dissolution approximation" for efficient estimation of a temporal ERGM via a cross-sectional ERGM estimation with adjustment of formation model coefficients (see netest help 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).netsim so that epidemic modules with errors or warnings are clearly identified in the console.save.transmat in control.net independently of using tergmLite methods (previously use of tergmLite did not allow for saving these data).infstat parameter to the internal discord_edgelist function used in the infection module, to allow for arbitrary specification of which disease statuses are considered infectious for the purpose of dyad discordance.plot.netsim with type = 'network' with vertex.cex parameter.plot.netdx when plot legend set to FALSE.print.netsim that does not error when displaying new epidemic modules for extension models.netsim for networks with duration of 1 (i.e., one-time contacts handled with cross-sectional ERGMs).dissolution_coefs.netdx if a static ERGM is passed.tergmLite package (to be released).netsim object with print.netsim(x, formation.stats = TRUE).plot.netsim default colors when number of variables exceeds 3.dissolution_coefs documentation.skip.dissolution argument to netdx to skip dissolution diagnostics for computational efficiency.netsim runs.netdx on a cross-sectional ergm.get_sims and unit tests in plot.transmat found during CRAN submission for v1.7.1.get_args and apportion_lr, ported over from EpiModelHIV.absdiffby and absdiffnodemix, ported over from EpiModelHIV.as.data.frame.dcm when dt control setting < 1.keep.tnetwork parameter to netdx to allow for retaining the full networkDynamic object during dynamic network simulations. Relatedly, add support for get_network to extract those networks from netdx objects.as.data.frame function 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.netdx function extracts the timed edgelists directly from a netdx object.get_nwstats function now extracts data frames of network statistics from both netdx and netsim objects.get_sims.plot.netdx and plot.netsim.ncores argument in netdx to prevent over parallelization of simulations.netdx objects.act.rate.m2 for network models in param.net, as this is an unused parameter for built-in models.b.rate; it is now a.rate. Inputs of a b.rate parameter yield a message and will automatically set a.rate to the b.rate value. This is a breaking change that may require updating old code.netdx (when dynamic is 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.netdx now includes a new argument, sequential, for static diagnostics that mirrors the same argument from ergm::simulate.ergm to simulate from MCMC chains based on previous draws versus new draws.mutate_epi output when new variable is a constant.ggplot2 from depend to import.identical function causing some to fail under alternative BLAS/LAPACK implementations.as.data.frame methods for netsim and icm classes 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_bands is a new "geom" for use by ggplot2 to 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, ggplot2 was added as a depend.truncate_sims is a new utility function that takes truncates the time series of a netsim or icm class 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.net allows you to pass in a vector of backwards-looking infection times for those initally infected at t_1 through the infTime.vector parameter. Combined with the status.vector parameter, this provides users maximal control over who is infected and for how long as initial conditions.discord_edgelist function.status.rand argument for init.net and init.icm that 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 status.vector parameter.grid argument to plot functions to overlay a grid on line plots.plot.netdx examples in help file.verbose default for network models to TRUE (reverts change in v1.3.0 specifically for network models).leg argument 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.control.dcm, nsteps may 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_epi for adding new variables to a epidemic simulation object now works for all three model classes.param, init, and control functions are now dual-classed as lists as well as their native classes.new.mod into control.dcm, printing the control.dcm object no longer yields a warning and instead prints the function name.transco to use the base adjustcolor function.NA for the final value, creating issues with analyzing those data. Those NAs are replaced with the penultimate value of that vector.dcm, icm, and netsim objects to list "Variables" together instead of dividing them into compartments, flows, and other.popfrac default for plotting dcm, icm, and netsim objects to FALSE. This avoids any problems when prevalences are already stored within the model simulation.verbose default for control functions to FALSE.print.netsim when sims is mean, min, or `max.print.coefdiss output.plot.netsimdissolution_coefs.mutate_epi function inspired by the dplyr package, to add post-hoc summary statistic calculations to completed network simulations. See the function help file for examples.get_degree function that returns a vector of current network degree for each person in a network.as.phylo.transmat to 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 multiPhylo following the convention of ape::read.tree.netsim. This only supports single-node frameworks currently, using the doParallel package. Run models in parallel by using the ncores parameter in control.net.as.phylo.transmat function to construct the phylo tree with all network vertices as phylo-tips and all transmissions as phylo nodes.plot.netsim now correctly functions for diagnostic plots (type = "formation") when summary statistics contain variable names with numeric values as suffixes.edapprox = FALSE in the netest function).netest when models were fit with the full STERGM method.depend parameter to TRUE in control.net when user passes in any new birth or death modules.ape package and a transmission timeline from the ndtv package. See the help files for the as.phylo.transmat and plot.transmat functions.epiweb(class = "net"). It is also hosted online at shinyapps.get_sims function is used to extract individual simulations from larger netsim objects. This function has been updated to include a var argument that allows for automatic calculation of which simulation is closest to the mean across all simulations for extraction.as.data.frame method for icm and netsim classes. This will provide a data frame of output corresponding to defined quantiles across all simulations contained within a model object.plot.netsim in cases where there are NA values in the epidemiological output.control.net when type is missing, and automatically sets type to "SI". This will impact extensions to EpiModel in the case when the default transmission module is replaced.netdx on calculating summary statistics from models with multiple structural zeros for target statistics.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.icm and init.net are matched in each simulation.netsim_parallel function from the package. See the EpiModelHPC extension package at https://github.com/EpiModel/EpiModelHPC for running network simulations in parallel.check_bip_degdist now uses more tolerant checks of equality when comparing bipartite mode statistics.dcm function.netest to improve performance of fitting models.births.FUN, from the dynamic workflow by setting the argument value for that module to NULL in the control.net inputs.calc_eql function now returns test statistics invisibly.plot.netsim is 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.netdx and plot.netsim now 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.param.icm and param.net classes.dissolution argument to 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_coefs function, the output of which is passed to netest, thereby removing the duplication.as.data.frame methods for stochastic models remove NA from individual simulations when calculating row means.verbose parameter in netest now correctly controls the model fitting output level in the underlying ergm and stergm functions.merge.netsim now correctly checks elements of two objects to be merged when the classes of those elements may be of length greater than 1.... argument to epiweb to pass additional arguments to shiny::runApp.graphics, grDevices, stats, and utils packages as required by CRAN.netsim_parallel function has been deprecated. This functionality has been replaced with model simulation functions within the EpiModelHPC extension package: https://github.com/EpiModel/EpiModelHPCepiweb.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.netest now 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.dcm function, 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 deSolve package.netest will now check to ensure that the formation and dissolution models are in allignment (terms specified in the same order) and that dissolution model is of proper forms (see v1.1.4 notes).dissolution_coefs for examples.use.pids in control.net. See help("persistent.ids") in the networkDynamic package for more background.births.net module that set the default entrTime and exitTime attributes twice for bipartite models (#205).xlab and ylab (#206).get_sims extraction now outputs correct data when object contains single simulation.skip.check argument for control.net is even more flexible, to allow for passing different class elements into netsim with original models.param.error argument for merge.netsim that allows bypassing the stop error if the parameters and control settings from the two merged objects are not identical.control.net has new module.order argument 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_parallel now returns the correct object if used for single simulations or on single cores.plot.icm removes NA values from the data when calculating ylim and the quantile bands.netest now implements an improved "Edges Dissolution Approximation" via the edapprox argument.control.dcm option dede, which if true allows for delayed differential equations to be passed into a new model solved with dcm.netdx to 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).netdx, with the method parameter, to plot boxplots of the simulations against the target statistics. The default is still the line plots (#191).netdx objects, 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.netdx is updated, along with a new statistic for the percent deviation between the simulation means and target statistics (#192).print.netsim (#183).get_sims will subset and extract entire simulations from netsim objects 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.save.other parameter in control.net may now be merged with merge.netsim (#185).plot for ICMs and network models when the y argument is specified (#188).deSolve moved from import to depend (#194).netdx, for the proportion of edges that dissolve per time step, as another diagnostic for the dissolution model (#53).plot.netsim now allow specifying "mean", "min", or "max" to plot the network at with the most average, maximum, and minumum disease prevalence at the specified time step (#73).param.net function has been updated with details (#65).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.plot.netsim fixed (#164).edges_correct, now runs for any dependent network simulations, not just if built-in vital dynamics modules are called (#141).verbose.icm function (#71).save.other control setting in control.net are now printed as output in print.netsim (#174).get_network, get_transmat, and get_nwstats) which extract the network objects, transmission matrices, and data frame of network statistics from a completed netsim simulation. These functions also support extraction of network model simulations with multiple networks (see API note).netsim objects now has an argument, network, for plotting network statistics and static networks (type = "formation" and "network", respectively) in simulations with multiple networks.mean.smooth. If TRUE, this uses a lowess smoother on the outcome variables of interest. This is helpful in visualization of low-count outcomes like disease incidence.netsim_parallel function. Note that this is experimental and has not been tested extensively across platforms, so bug reports are welcome. Two parallel methods are supported: doParallel for multiple cores on a single node, and doMPI for multiple cores across multiple nodes. The latter requires an MPI installation on a linux-based cluster.netdx also accepts a new ncores argument, which will run the diagnostic simulations and calculations on those simulations in parallel on a specified number of cores (single node only).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.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.start, for the control settings in network models, which is a starting time step to resume simulations. In this case, the x argument in netsim is a previously saved netsim object rather than a netest object. The start argument should be one integer higher than the nsteps in that earlier netsim object. The nsteps argument 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.netdx diagnostic simulations for computationally intensive parts of the simulations.netest now 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 ergm object as an element of the netest output. This is mainly for file size efficiency.(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.zeromarg argument has been removed from plot.netsim for 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.all to dat to prevent function name conflicts. Additionally, all summary output is now stored within dat$epi, whereas the previous location was all$out.edges_correct and 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: help(modules.net).param, init, and control functions 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.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.x argument in netsim may now be a list of netest objects. 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).epiweb function). These apps now benefit from the more stable parameterization functions.print method for the param.net class to handle parameters that are lists or data frames.merge.netsim now ignores any differences in the environment of the nwstats.formula control, previously preventing proper merging of some network model simulations.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: https://www.epimodel.org/
Moved the package vignettes external to the package to reduce package size and build time.
The EpiModel package provides functions for building, solving, and plotting mathematical models of infectious disease.
See the main package help function ?EpiModel-package, and the EpiModel tutorials online.