View source: R/recursPredictQuantiles.R
| recurs_predict_quantiles | R Documentation |
Generalizes recurs_predict() to report an arbitrary set of
quantile levels rather than just 50%/95%, needed for the weighted
interval score (wis()). Same Poisson-renewal/posterior
marginalisation logic; this only widens what's read off the
already-computed CDF, so it never changes point predictions or the
50%/95% values a call to recurs_predict() would give, only how
many quantiles are reported alongside them.
recurs_predict_quantiles(
Rgrid,
pR,
Lday,
Rmean,
quantile_levels = c(0.025, 0.25),
maxI = 800
)
Rgrid |
grid on reproduction numbers |
pR |
posterior over R (filtered or smoothed) |
Lday |
total infectiousness at each time point |
Rmean |
mean R estimate at each time point |
quantile_levels |
vector of probabilities in (0, 0.5), each
producing a nested (level, 1-level) interval. Default matches
|
maxI |
upper bound of the internal prediction grid |
Bracher J, Ray EL, Gneiting T, Reich NG. (2021) "Evaluating epidemic forecasts in an interval format." PLOS Computational Biology 17(2): e1008618. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1371/journal.pcbi.1008618")}
list(pred, quantiles): mean one-step-ahead prediction, and a
named list where quantiles[[as.character(level)]] is a 2 x (n-1)
matrix with rows lo/hi for that (level, 1-level) interval
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.