Create a forecast
object for point forecasts
Source: R/class-forecast-point.R
, R/class-forecast-quantile.R
as_forecast_point.Rd
When converting a forecast_quantile
object into a forecast_point
object,
the 0.5 quantile is extracted and returned as the point forecast.
Usage
as_forecast_point(data, ...)
# Default S3 method
as_forecast_point(
data,
forecast_unit = NULL,
observed = NULL,
predicted = NULL,
...
)
# S3 method for class 'forecast_quantile'
as_forecast_point(data, ...)
Arguments
- data
A data.frame (or similar) with predicted and observed values. See the details section of for additional information on the required input format.
- ...
Unused
- forecast_unit
(optional) Name of the columns in
data
(after any renaming of columns) that denote the unit of a single forecast. Seeget_forecast_unit()
for details. IfNULL
(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".
Required input
The input needs to be a data.frame or similar with the following columns:
observed
: Column of typenumeric
with observed values.predicted
: Column of typenumeric
with predicted values.
For convenience, we recommend an additional column model
holding the name
of the forecaster or model that produced a prediction, but this is not
strictly necessary.
See the example_point data set for an example.
See also
Other functions to create forecast objects:
as_forecast_binary()
,
as_forecast_nominal()
,
as_forecast_ordinal()
,
as_forecast_quantile()
,
as_forecast_sample()