Skip to contents

This is a simple forecasting model for epiprocess::epi_df data. It uses the most recent observation as the forecast for any future date, and produces intervals based on the quantiles of the residuals of such a "flatline" forecast over all available training data.

Usage

flatline_forecaster(epi_data, outcome, args_list = flatline_args_list())

Arguments

epi_data

An epiprocess::epi_df

outcome

A scalar character for the column name we wish to predict.

args_list

A list of dditional arguments as created by the flatline_args_list() constructor function.

Value

A data frame of point (and optionally interval) forecasts at a single ahead (unique horizon) for each unique combination of key_vars.

Details

By default, the predictive intervals are computed separately for each combination of key values (geo_value + any additional keys) in the epi_data argument.

This forecaster is very similar to that used by the COVID19ForecastHub

Examples

jhu <- case_death_rate_subset %>%
  dplyr::filter(time_value >= as.Date("2021-12-01"))

out <- flatline_forecaster(jhu, "death_rate")