Learn R Programming

EpiModel (version 2.0.1)

control.net: Control Settings for Stochastic Network Models

Description

Sets the controls for stochastic network models simulated with netsim.

Usage

control.net(
  type,
  nsteps,
  start = 1,
  nsims = 1,
  ncores = 1,
  resimulate.network = FALSE,
  tergmLite = FALSE,
  attr.rules,
  epi.by,
  initialize.FUN = initialize.net,
  resim_nets.FUN = resim_nets,
  infection.FUN = NULL,
  recovery.FUN = NULL,
  departures.FUN = NULL,
  arrivals.FUN = NULL,
  nwupdate.FUN = nwupdate.net,
  prevalence.FUN = prevalence.net,
  verbose.FUN = verbose.net,
  module.order = NULL,
  set.control.ergm,
  set.control.stergm,
  save.nwstats = TRUE,
  nwstats.formula = "formation",
  save.other,
  verbose = TRUE,
  verbose.int = 1,
  skip.check = FALSE,
  raw.output = FALSE,
  ...
)

The attr.rules Argument

The attr.rules parameter is used to specify the rules for how nodal attribute values for incoming nodes should be set. These rules are only necessary for models in which there are incoming nodes (i.e., arrivals) There are three rules available for each attribute value:

  • "current": new nodes will be assigned this attribute in proportion to the distribution of that attribute among existing nodes at that current time step.

  • "t1": new nodes will be assigned this attribute in proportion to the distribution of that attribute among nodes at time 1 (that is, the proportions set in the original network for netest).

  • <Value>: all new nodes will be assigned this specific value, with no variation.

For example, the rules list attr.rules = list(race = "t1", sex = "current", status = "s") specifies how the race, sex, and status attributes should be set for incoming nodes. By default, the rule is "current" for all attributes except status, in which case it is "s" (that is, all incoming nodes are susceptible).

New Modules

Base network models use a set of module functions that specify how the individual nodes in the network are subjected to infection, recovery, demographics, and other processes. Core modules are those listed in the .FUN arguments. For each module, there is a default function used in the simulation. The default infection module, for example, is contained in the infection.net function.

For original models, one may substitute replacement module functions for any of the default functions. New modules may be added to the workflow at each time step by passing a module function via the ... argument. Consult the New Network Models tutorial. One may remove existing modules, such as arrivals.FUN, from the workflow by setting the parameter value for that argument to NULL.

Details

control.net sets the required control settings for any network model solved with the netsim function. Controls are required for both base model types and when passing original process modules. For an overview of control settings for base models, consult the Basic Network Models tutorial. For all base models, the type argument is a necessary parameter and it has no default.

See Also

Use param.net to specify model parameters and init.net to specify the initial conditions. Run the parameterized model with netsim.