Convolves a hubverse admission quantile forecast with a length of stay survival vector to produce a hubverse census quantile forecast.
Arguments
- admission_fcast
Hubverse model output tibble of admission quantile forecasts (output of
hubData::collect_hub()). One row per (model, location, reference_date, horizon, quantile).- los
Numeric survival vector
P(LOS > d)of lengthmax_stay + 1. Usespec_los()for literature priors orfit_los()for a data driven fit.- admission_history
Hubverse target time series tibble of observed admissions (output of
hubData::connect_target_timeseries()then collected). Must cover at leastmax_staytime steps immediately before eachreference_dateinadmission_fcast.
Value
A tibble with the same hubverse columns as admission_fcast,
with value now representing census instead of admissions.
Details
Census on the first forecast day depends on admissions before the
forecast starts, because patients already in hospital are still
occupying beds. admission_history supplies those pre forecast
admissions so the convolution can see the full max_stay window.
Groups with fewer than max_stay historical observations before
their reference_date are dropped silently.
