finalsize {epigrowthfit} | R Documentation |
Compute the Expected Epidemic Final Size
Description
Computes the proportion of a population expected to be infected over the course of an epidemic, as a function of the basic reproduction number.
Usage
finalsize(R0, S0, I0)
Arguments
R0 |
a numeric vector listing non-negative values for the basic reproduction number. |
S0 , I0 |
numeric vectors listing values in the interval |
Details
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).
Value
A numeric vector listing values in the interval [0,1]
for the
expected epidemic final size.
Computation
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.
References
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. doi:10.1007/s11538-005-9047-7
See Also
Examples
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")