Mathematical Modeling of Infectious Disease Dynamics
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.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 networkLite
s.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.updater.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
).Minor updates for CRAN submission.
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).