contact_outbreak: A contact-based outbreak simulator

Description Usage Arguments Details Author(s) Examples

Description

Under development, please do not use without contacting the author.

Usage

1
contact_outbreak(lambda, R, r_SI, r_contact, max_cases = 100)

Arguments

lambda

The average number of contacts per infectious case, taken to be the rate of a Poisson distribution.

R

The average reproduction number, i.e. number of secondary cases per infected individual. Note that this number cannot exceed the average number of contacts lambda.

r_SI

A function generating random delays from the serial interval distribution, i.e. the delay between primary and secondary symptoms. See details for more information on how to specify this distribution.

r_contact

A function generating random delays from onset of symptom to non-infectious contacts.

max_cases

The maximum number of new cases the simulation can be run for.

Details

We recommend using the package distcrete for generating the serial interval distribution. See: https://github.com/reconhub/distcrete.

Author(s)

Thibaut Jombart thibautjombart@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
if (require(distcrete)) {
## get distributions
 SI <- distcrete("gamma", 1L, w = 0, 10, 0.65)
 d_contacts <- distcrete("exp", 1L, w=0, 0.05)

## simulate outbreak and contacts
 set.seed(1)
 x <- contact_outbreak(3, 1.8, SI$r, d_contacts$r)
 x
 plot(x, group = "case_def")

 if (require(incidence)) {
   plot(incidence(x$linelist$onset, 7))
 }
}

thibautjombart/contactsim documentation built on May 31, 2019, 9:56 a.m.