Forecasts Cases for a Rt Forecasts
forecast_cases.RdForecasts Cases for a Rt Forecasts
Usage
forecast_cases(
cases = NULL,
fit_samples = NULL,
serial_interval = NULL,
forecast_date = NULL,
horizon = NULL,
rdist = NULL
)Arguments
- cases
A dataframe containing
dateandcasesvariables- fit_samples
A dataframe as produced by
EpiSoon::forecast.- serial_interval
A numeric vector describing the probability distribution the serial interval. See
EpiNow::covid_serial_intervalfor an example of the format.- forecast_date
A character string date (format "yyyy-mm-dd") indicating the forecast date. Defaults to
NULLin which case it will be assumed that the forecast date is the day before the first date present in thefit_samplesdataframe- horizon
Numeric, the time horizon over which to predict.
- rdist
A function to be used to sample the number of cases. Must take two arguments with the first specfying the number of samples and the second the mean. Defaults to
rpoisif not supplied
Examples
if (FALSE) { # \dontrun{
## Rt forecast
forecast <- forecast_rt(EpiSoon::example_obs_rts[1:10, ],
model = function(...) {
EpiSoon::bsts_model(model = function(ss, y) {
bsts::AddAutoAr(ss, y = y, lags = 10)
}, ...)
},
horizon = 7, samples = 10
)
forecast_cases(EpiSoon::example_obs_cases,
fit_samples = forecast,
serial_interval = EpiSoon::example_serial_interval
)
} # }