n.sec.cases: Number of secondary cases given range of R values

Description Usage Arguments Value Author(s) Examples

Description

A function that generates random values of the basic reproductive number R when given an estimated an estimated confidence interval for R. The function draws a point estimate for R within the given range and then returns a randomly generated number from a Poisson distribution with this point estimate as the mean.

Usage

1
n.sec.cases(n = 1, R_low, R_high = NULL)

Arguments

n

number of random numbers to generate

R_low

the low estimate of R. If the R_high parameter is NULL, this parameter is taken to be the point estimate of R

R_high

the high estimate of R

Value

an n length numeric vector giving randomly generated R values

Author(s)

John Giles

Examples

1
2
3
4
5
6
7
n.sec.cases(R_low=1.5)
n.sec.cases(n=10, R_low=1.5, R_high=2)

set.seed(1)
hist(n.sec.cases(n=1000, R_low=1.5, R_high=3), main='', xlab='R_0')
abline(v=1.5, lty=2, lwd=2, col='red')
abline(v=3, lty=2, lwd=2, col='red')

gilesjohnr/genpatch documentation built on May 12, 2019, 10:50 a.m.