as_forecast_sample: Create a 'forecast' object for sample-based forecasts

as_forecast_sampleR Documentation

Create a forecast object for sample-based forecasts

Description

Create a forecast object for sample-based forecasts

Usage

as_forecast_sample(
  data,
  forecast_unit = NULL,
  observed = NULL,
  predicted = NULL,
  model = NULL,
  sample_id = NULL
)

Arguments

data

A data.frame (or similar) with predicted and observed values. See the details section of as_forecast() for additional information on required input formats.

forecast_unit

(optional) Name of the columns in data (after any renaming of columns) that denote the unit of a single forecast. See get_forecast_unit() for details. If NULL (the default), all columns that are not required columns are assumed to form the unit of a single forecast. If specified, all columns that are not part of the forecast unit (or required columns) will be removed.

observed

(optional) Name of the column in data that contains the observed values. This column will be renamed to "observed".

predicted

(optional) Name of the column in data that contains the predicted values. This column will be renamed to "predicted".

model

(optional) Name of the column in data that contains the names of the models/forecasters that generated the predicted values. This column will be renamed to "model".

sample_id

(optional) Name of the column in data that contains the sample id. This column will be renamed to "sample_id". Only applicable to sample-based forecasts.

See Also

Other functions to create forecast objects: as_forecast, as_forecast_binary(), as_forecast_nominal(), as_forecast_point(), as_forecast_quantile()


epiforecasts/scoringutils documentation built on Aug. 20, 2024, 9:58 p.m.