@@ -251,16 +251,46 @@ all_flatlines <- lapply(
251
251
# same plotting code as in the arx multi-ahead case
252
252
workflow <- all_flatlines[[1]]$epi_workflow
253
253
results <- purrr::map_df(all_flatlines, ~ `$`(., "predictions"))
254
- results %>% filter(target_date == max(target_date))
255
254
autoplot(
256
255
object = workflow,
257
256
predictions = results,
258
257
plot_data = covid_case_death_rates |> filter(geo_value %in% used_locations, time_value > "2021-07-01")
259
258
)
260
259
```
261
260
262
- Note that the ` cdc_baseline_forecaster ` is a slight modification of this method
263
- for use in [ the CDC COVID19 Forecasting Hub] ( https://covid19forecasthub.org/ ) .
261
+ ### ` cdc_baseline_forecaster() `
262
+
263
+ This is a different method of generating a flatline forecast, used as a baseline
264
+ for [ COVID19ForecastHub] ( https://covid19forecasthub.org ) .
265
+
266
+ ``` {r make-cdc-forecast, warning=FALSE}
267
+ all_cdc_flatline <-
268
+ cdc_baseline_forecaster(
269
+ covid_case_death_rates |>
270
+ filter(time_value <= forecast_date, geo_value %in% used_locations),
271
+ outcome = "death_rate",
272
+ args_list = cdc_baseline_args_list(
273
+ aheads = 1:28,
274
+ data_frequency = "1 day"
275
+ )
276
+ )
277
+ # same plotting code as in the arx multi-ahead case
278
+ workflow <- all_cdc_flatline$epi_workflow
279
+ results <- all_cdc_flatline$predictions
280
+ autoplot(
281
+ object = workflow,
282
+ predictions = results,
283
+ plot_data = covid_case_death_rates |> filter(geo_value %in% used_locations, time_value > "2021-07-01")
284
+ )
285
+ ```
286
+
287
+ The median is the same, but the quantiles are generated using
288
+ ` layer_cdc_flatline_quantiles() ` instead of ` layer_residual_quantiles() ` .
289
+ Both rely on the computing the quantiles of the residuals, but this model
290
+ extrapolates the quantiles by repeatedly sampling the initial quantiles to
291
+ generate the next quantiles.
292
+ This results in much smoother quantiles, but ones that only capture the
293
+ one-ahead uncertainty.
264
294
265
295
### ` climatological_forecaster() `
266
296
A different kind of baseline, the ` climatological_forecaster() ` forecasts the
0 commit comments