sim.epid: Epidemic outbreak simulation

View source: R/sim.epid.R

sim.epidR Documentation

Epidemic outbreak simulation

Description

Generates several epidemic curves with specified distribution and reproduction number.

Usage

sim.epid(
  epid.nb,
  GT,
  R0,
  epid.length,
  family,
  negbin.size = NULL,
  peak.value = 50
)

Arguments

epid.nb

Number of epidemics to be simulated (defaults to 1)

GT

Generation time distribution from generation.time().

R0

Basic reproduction number, in its core definition.

epid.length

Maximum length of the epidemic (cases infected after this length will be truncated).

family

Distribution of offspring. Can be either "poisson" (default) or "negbin".

negbin.size

If family is set to "negbin", sets the size parameter of the negative binomial distribution.

peak.value

Threashold value for incidence before epidemics begins decreasing

Details

This function is only used for simulation purposes. The output is a matrix of n columns (number of outbreaks) by m rows (maximum length of an outbreak).

When using rnbinom with mean and size moments, the variance is given by mean + mean^2/size (see stats::rnbinom()). One should determine the size accordingly to the R0 value to increase the dispersion. From the previous formula for the variance, Var(X) = k*R_{0} implies that size = R0/(k-1).

Value

A matrix with epidemics stored as columns (incidence count).

Author(s)

Pierre-Yves Boelle, Thomas Obadia

Examples

#Loading package
library(R0)

## In this example we simulate n=100 epidemic curves, with peak value at 150 incident cases, 
## and maximum epidemic length of 30 time units.
## Only the outbreak phase is computed. When the peak value is reached, the process is stopped 
## and another epidemic is generated.
sim.epid(epid.nb=100, GT=generation.time("gamma",c(3,1.5)), R0=1.5, 
         epid.length=30, family="poisson", peak.value=150)

# Here, a 30*100 matrix is returned. Each column is a single epidemic.

R0 documentation built on Sept. 26, 2023, 5:10 p.m.

Related to sim.epid in R0...