Skip to contents

Combine multiple forecasts' output into a single ensemble. Presently, only a general average ensemble is available.


  main = ".",
  method = "unwtavg",
  forecasts_groups = NULL,
  forecasts_ids = NULL,
  forecast_table = NULL,
  historic_end_newmoonnumber = NULL,
  models = NULL,
  dataset = NULL,
  species = NULL



character value of the name of the main component of the directory tree.


character value of the name of the ensemble method to use. Presently, only "unwtavg" (unweighted average) is allowed.


integer (or integer numeric) value of the forecasts groups to combine with an ensemble. If NULL (default), the most recent forecast group is ensembled.


integer (or integer numeric) values representing the forecasts of interest for restricting ensembling, as indexed within the directory in the casts sub folder. See the forecasts metadata file (forecasts_metadata.csv) for summary information.


Optional data.frame of forecast table outputs. If not input, will be loaded.


integer (or integer numeric) newmoon number of the forecast origin. Default value is NULL, which equates to no selection.


character value(s) of the name of the model to include. Default value is NULL, which equates to no selection with respect to model. NULL translates to all models in the table.


character value of the rodent data set to include Default value is NULL, which equates to the first data set encountered.


character vector of the species code(s) or "total" for the total across species) to be plotted NULL translates to the species defined by forecasting_species called by prefab_species.


data.frame of ensembled forecasts.


A pre-loaded table of forecasts can be input, but if not (default), the table will be efficiently (as defined by the inputs) loaded and trimmed.
The forecasts can be trimmed specifically using the forecasts_ids input, otherwise, all relevant forecasts from the stated forecast_groups will be included.

See also

Core forecasting functions: evaluate forecasts, portalcast(), process forecast output


if (FALSE) {
   main1 <- file.path(tempdir(), "ensemble")
   setup_production(main = main1)

   forecasts_ids <- select_forecasts(main     = main1, 
                                     datasets = "controls", 
                                     species  = "DM")$forecast_id

   ensemble_forecasts(main          = main1, 
                      forecasts_ids = forecasts_ids)

   unlink(main1, recursive = TRUE)