This function derives a sample of plausible R values from an earlyR object (as returned by get_R). The probability of each returned values of R are directly proportional to their likelihood.

sample_R(x, n = 100)

Arguments

x

An earlyR object.

n

The number of R values to sample.

Author

Thibaut Jombart thibautjombart@gmail.com

Examples

if (require(incidence)) { x <- incidence(c(1, 5, 5, 12, 45, 65)) plot(x) res <- get_R(x, disease = "ebola") res plot(res) sample_R(res, 10) hist(sample_R(res, 1000), col = "grey", border = "white") }