sample_R: Get a sample of plausible Reproduction Numbers

Description Usage Arguments Author(s) Examples

View source: R/sample_R.R

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

1
sample_R(x, n = 100)

Arguments

x

An earlyR object.

n

The number of R values to sample.

Author(s)

Thibaut Jombart thibautjombart@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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")
}

earlyR documentation built on Oct. 27, 2020, 9:07 a.m.