recurs_predict: Bayesian recursive one-step-ahead prediction via EpiFilter...

View source: R/recursPredict.R

recurs_predictR Documentation

Bayesian recursive one-step-ahead prediction via EpiFilter (internal)

Description

Modified from the original recursPredict.R (Parag KV, EpiFilter): the original hardcodes its internal prediction grid to 0:800 and errors out if any predicted mean incidence exceeds 720. This version takes the grid's upper bound as a parameter (maxI) instead, so it doesn't break on larger outbreaks. The Poisson-renewal/quantile logic is otherwise unchanged from the original.

Usage

recurs_predict(Rgrid, pR, Lday, Rmean, a, maxI = 800)

Arguments

Rgrid

grid on reproduction numbers

pR

posterior over R (filtered or smoothed), from epi_filter()/epi_smoother()

Lday

total infectiousness at each time point

Rmean

mean R estimate at each time point

a

tail probability defining the reported credible interval

maxI

upper bound of the internal prediction grid; set comfortably above the data's peak incidence

Details

From: Parag KV. (2021) "Improved estimation of time-varying reproduction numbers at low case incidence and between epidemic waves." PLOS Computational Biology 17(9): e1009347. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1371/journal.pcbi.1009347")} https://github.com/kpzoo/EpiFilter

Value

list(pred, predInt): mean one-step-ahead prediction, and a 4 x (n-1) matrix of quantiles (rows: lo95, hi95, lo50, hi50)


RtForecastR documentation built on Nov. 25, 2026, 9:09 a.m.