Description Usage Arguments Details Author(s) Examples
Under development, please do not use without contacting the author.
1 | contact_outbreak(lambda, R, r_SI, r_contact, max_cases = 100)
|
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 |
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. |
We recommend using the package distcrete
for generating the serial
interval distribution. See: https://github.com/reconhub/distcrete.
Thibaut Jombart thibautjombart@gmail.com
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))
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.