build_quantile_ensemble: Create quantile (weighted or unweighted) ensemble using mean...

View source: R/build_quantile_ensemble.R

build_quantile_ensembleR Documentation

Create quantile (weighted or unweighted) ensemble using mean or median

Description

Create quantile (weighted or unweighted) ensemble using mean or median

Usage

build_quantile_ensemble(
  forecast_data,
  weights_df = NULL,
  method = c("median", "mean"),
  model_name,
  forecast_date,
  location_data = NULL,
  location_col_name = "fips"
)

Arguments

forecast_data

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

weights_df

data.frame containing weights for all the models included in forecast_data to create a weighted ensemble, should include a model column and weight column. Defaults to NULL, which creates an unweighted ensemble.

method

One of median (default) or mean.

model_name

character string for model column in output; if NULL no such column will be added

forecast_date

character string interpretable as a date which will populate the forecast_date column of the ensemble data frame

location_data

an optional data.frame with metadata about location. If present it will be left joined with the ensemble data frame on the column location_col_name. This is useful when passing the ensemble to plot_forecasts which requires full location names.

location_col_name

character string giving the column name in location_data matching with the location column in forecast_data. Defaults to "fips".

Value

ensemble model


reichlab/hubEnsembles documentation built on Sept. 14, 2023, 12:37 a.m.