View source: R/computeLambda.R
| compute_lambda | R Documentation |
Computes the "total infectiousness" Lambda_t: the convolution of
past incidence with a discretized Gamma(mean, variance) generation
interval distribution, as required by epi_filter() and
epi_smoother() alongside raw incidence. Written to avoid a
dependency on the EpiEstim package's overall_infectivity() for
this single step.
compute_lambda(incidence, mean_GI, var_GI, max_si = NULL)
incidence |
numeric vector of case counts, length n |
mean_GI |
mean generation interval, in the same time units as
|
var_GI |
variance of the generation interval, same time units |
max_si |
maximum serial interval to consider (defaults to
|
The Gamma(mean, variance) discretization approach follows the
convention used in get_Rt.m, part of the GrowthPredict toolbox:
Chowell G, Bleichrodt A, Dahal S, Tariq A, Roosa K, Hyman JM, Luo R.
(2024) "GrowthPredict: A toolbox and tutorial-based primer for
fitting and forecasting growth trajectories using phenomenological
growth models." Scientific Reports 14, 1630.
\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1038/s41598-024-51852-8")}
numeric vector of length n; Lambda[1] is NA (no prior
incidence exists to convolve with)
data(measles_cdmx)
Lambda <- compute_lambda(measles_cdmx$cases, mean_GI = 11/7, var_GI = (4/7)^2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.