Learn R Programming

R0 (version 1.2-10)

sim.epid: 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 outbreaks to be generated.

GT

Generation time distribution for the pathogen. Must be a R0.GT-class object.

R0

Basic reproduction number.

epid.length

Length of the epidemic.

family

Distribution type for the new cases, either "poisson" or "negbin".

negbin.size

Over-dispersion parameter, if family is set to "negbin".

peak.value

Threashold value for incidence before epidemics begins decreasing

Author

Pierre-Yves Boelle, Thomas Obadia

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 ?rnbinom). One should determine the size accordingly to the R0 value to increase the dispersion. From the previous variance formula, if Var(X) = k*R0, size = R0/(k-1)

Examples

Run this code
#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.

Run the code above in your browser using DataLab