ts_forecast.Rd
This function can convert models fit with model or the ts_fit wrapper to forecasted values. The user specifies the horizon out to which forecasts should be generated, as well as any optional covariate data needed for forecasting (e.g. when using a model of incident deaths based on lagged incident cases, the forecast function needs incident cases moving into the forecast horizons; see "new_data" argument). The forecasts generated will include point estimates as well as 23 quantiles: 0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 0.99. By default these quantiles are calculated using the hilo.
ts_forecast(mable, outcome, horizon = 4, new_data = NULL, ...)
mable | A |
---|---|
outcome | Name of the outcome; must be one of |
horizon | Optional horizon periods through which the forecasts should be generated; default is |
new_data | Optional covariate data for forecasts using models that were fit using other variables; should be generated using new_data; default is |
... | Additional parameters passed to the ts_cumulative_forecast helper; only used if the forecast is cumulative |
A tibble
with forecast results, including the name of the model, year and week, value of the forecast estimate, type of estimate (quantile or point), and bin of the quantile (if applicable) for the estimate.