finalsize | R Documentation |
Computes the proportion of a population expected to be infected over the course of an epidemic, as a function of the basic reproduction number.
finalsize(R0, S0, I0)
R0 |
a numeric vector listing non-negative values for the basic reproduction number. |
S0 , I0 |
numeric vectors listing values in the interval |
At least one of S0
and I0
must be supplied.
If S0
(I0
) is supplied but not I0
(S0
),
then the latter is assigned the value of one minus the former.
R0
, S0
, and I0
are recycled to a common length
(the maximum of their lengths).
A numeric vector listing values in the interval [0,1]
for the
expected epidemic final size.
The basic reproduction number R0
defines the expected
epidemic final size Z
through an implicit equation,
Z = S0 * (1 - exp(-R0 * (Z + I0))) ,
which admits an explicit solution
Z = S0 + (1/R0) * W(-R0 * S0 * exp(-R0 * (S0 + I0))) .
Here, W
denotes the
Lambert W
function.
finalsize
computes this solution, relying on function
lambertW
from package emdbook.
Ma, J. & Earn, D. J. D. (2006). Generality of the final size formula for an epidemic of a newly invading infectious disease. Bulletin of Mathetmatical Biology, 68(3), 679-702. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11538-005-9047-7")}
timescale
, R0
.
R0 <- 10^seq(-3, 1, length.out = 151L)
plot(R0, finalsize(R0, S0 = 1, I0 = 0), type = "l", las = 1,
xlab = "basic reproduction number",
ylab = "final size")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.