use_ensemble_criteria: Load models according to inclusion criteria before ensembling

View source: R/use_ensemble_criteria.R

use_ensemble_criteriaR Documentation

Load models according to inclusion criteria before ensembling

Description

Load models according to inclusion criteria before ensembling

Usage

use_ensemble_criteria(
  forecasts,
  exclude_models = NULL,
  exclude_designated_other = TRUE,
  return_criteria = TRUE,
  eval_dir = here::here("evaluation", "weekly-summary"),
  rel_wis_cutoff = Inf,
  config_file = here::here("project-config.json")
)

Arguments

forecasts

data.frame containing all the forecasts to be summarised as an ensemble.

exclude_models

optional character vector to exclude over all dates, or data.frame with cols model and forecast_date, to exclude for specific dates

exclude_designated_other

logical: whether to exclude models designated as "other" in their metadata file (default TRUE)

return_criteria

logical : whether to return a model/inclusion criteria grid as well as the ensemble forecast (default TRUE)

eval_dir

character: the path in which to look for evaluation csv files

rel_wis_cutoff

numeric: any model with relative WIS greater than this value will be excluded

config_file

Path to the config file

Details

Steps: Currently, models included based on having:

  1. All quantiles

  2. 4 horizons

  3. Not manually specified for exclusion

  4. Not the hub ensemble

Value

  • if return_criteria = TRUE, a list with the following elements

    • "ensemble" : tibble : a single ensemble forecast

    • "criteria": tibble : all candidate models against criteria for inclusion in ensemble (all locations and horizons)

    • "forecast_date" : date : latest date

  • if return_criteria = FALSE, a tibble of a single ensemble forecast


epiforecasts/forecasthubutils2 documentation built on July 1, 2023, 11:50 a.m.