Sets the controls for stochastic individual contact models simulated with simulate_seiqhrf. Similar to EpiModel::control.icm, but allows for model types with additional compartments (e.g. 'SEIQHRF').

control_seiqhrf(
  type = "SEIQHRF",
  nsteps = 366,
  nsims = 8,
  prog.rand = FALSE,
  quar.rand = TRUE,
  hosp.rand = TRUE,
  disch.rand = TRUE,
  rec.rand = FALSE,
  arec.rand = TRUE,
  fat.rand = TRUE,
  a.rand = TRUE,
  d.rand = TRUE,
  initialize.FUN = "initialize.FUN",
  infection.FUN = "infection.FUN",
  recovery.FUN = "recovery.FUN",
  departures.FUN = "departures.FUN",
  arrivals.FUN = "arrivals.FUN",
  get_prev.FUN = "get_prev.FUN",
  verbose = FALSE,
  verbose.int = 0,
  skip.check = FALSE,
  ncores = 4,
  ...
)

Arguments

type

Disease type to be modeled, with the choice of "SI" for Susceptible-Infected diseases, "SIR" for Susceptible-Infected-Recovered diseases, and "SIS" for Susceptible-Infected-Susceptible diseases.

nsteps

Number of time steps to solve the model over. This must be a positive integer.

nsims

Number of simulations to run.

prog.rand

Method for progression from E compartment to I. If TRUE, random binomial draws at prog.rate, if FALSE, random draws from a Weibull distribution (yes, I know it should be a discrete Weibull distribution but it makes little difference and speed of computation matters), with parameters prog.dist.scale and prog.dist.shape

quar.rand

Method for self-isolation transition from I to Q. If TRUE, random binomial draws at quar.rate, if FALSE, random sample with a sample fraction also given by `quar.rate.

hosp.rand

Method for transition from I or Q to H -- that is, from infectious or from self-isolated to requiring hospitalisation. If TRUE, random binomial draws at hosp.rate, if FALSE, random sample with a sample fraction also given by `hosp.rate.

disch.rand

Method for transition from H to R -- that is, from requiring hospitalisation to recovered. If TRUE, random binomial draws at disch.rate, if FALSE, random sample with a sample fraction also given by disch.rate. Note that the only way out of the H compartment is recovery or death.

rec.rand

If TRUE, use a stochastic recovery model, with the number of recovered at each time step a function of random draws from a binomial distribution with the probability equal to rec.rate. If FALSE, then a deterministic rounded count of the expectation implied by that rate.

arec.rand

Method for recovery transition from E to R. If TRUE, random binomial draws at arec.rate, if FALSE, random draws from a random draws from a Weibull distribution, with parameters arec.dist.scale and arec.dist.shape.

fat.rand

Method for case fatality transition from H to F. If TRUE, random binomial draws at fat.rate.base, if FALSE, random sample with a sample fraction also given by fat.rate.base. However, if the current number of patients in the H (needs hospitalisation) compartment is above a hospital capacity level specified by hosp.cap, then the fatality rate is the mean of the base fatality rate weighted by the hospital capacity, plus a higher rate, specified by fat.rate.overcap, weighted by the balance of those requiring hospitalisation (but who can't be accommodated). By setting fat.rate.overcap higher, the effect of exceeding the capacity of the health care system can be simulated. There is also a coefficient fat.tcoeff for the fatality rates that increases them as a linear function of the number of days the individual has been in the H compartment. Use of the co-efficient better approximates the trapezoid survival time distribution typical of ICU patients.

a.rand

If TRUE, use a stochastic arrival model, with the number of arrivals at each time step a function of random draws from a binomial distribution with the probability equal to the governing arrival rates. If FALSE, then a deterministic rounded count of the expectation implied by those rates.

d.rand

If TRUE, use a stochastic departure model, with the number of departures at each time step a function of random draws from a binomial distribution with the probability equal to the governing departure rates. If FALSE, then a deterministic rounded count of the expectation implied by those rates.

initialize.FUN

Module to initialize the model at the outset, with the default function of initialize.icm.

infection.FUN

Module to simulate disease infection, with the default function of infection.icm.

recovery.FUN

Module to simulate disease recovery, with the default function of recovery.icm.

departures.FUN

Module to simulate departures or exits, with the default function of departures.icm.

arrivals.FUN

Module to simulate arrivals or entries, with the default function of arrivals.icm.

get_prev.FUN

Module to calculate disease prevalence at each time step, with the default function of get_prev.icm.

verbose

If TRUE, print model progress to the console.

verbose.int

Time step interval for printing progress to console, where 0 (the default) prints completion status of entire simulation and positive integer x prints progress after each x time steps.

skip.check

If TRUE, skips the default error checking for the structure and consistency of the parameter values, initial conditions, and control settings before running base epidemic models. Setting this to FALSE is recommended when running models with new modules specified.

ncores

Number of physical CPU cores used for parallel computation.

...

Additional control settings passed to model.

Value

A list of control parameters and core functions

Details

control sets the required control settings for any stochastic individual contact model solved with the simulate_seiqhrf function. Controls are required for both base model types and when passing original process modules. For an overview of control settings for base ICM class models, consult the Basic ICMs tutorial. For all base models, the type argument is a necessary parameter and it has no default.

New Modules

Base ICM models use a set of module functions that specify how the individual agents in the population 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.FUN 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.