sample_R {earlyR} | R Documentation |
Get a sample of plausible Reproduction Numbers
Description
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.
Usage
sample_R(x, n = 100)
Arguments
x |
An |
n |
The number of R values to sample. |
Author(s)
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")
}
[Package earlyR version 0.0.5 Index]