benchmark: Execute the benchmark

View source: R/benchmark.R

benchmarkR Documentation

Execute the benchmark

Description

Automatically evaluates and ranks forecasting methods based on their performance.

Usage

benchmark(
  forecaster,
  usecase,
  type = "one",
  output = "benchmark.csv",
  name = "Benchmarked Method",
  reportAll = TRUE
)

Arguments

forecaster

The forecasting method. This method gets a timeseries objekt (ts) and the horizon (h). The method returns the forecast values.

usecase

The use case for the benchmark. It must be either economics, finance, human, or nature.

type

Optional parameter: The evaluation type. It must be either one (one-step-ahead forecast), multi (multi-step-ahead forecast), or rolling (rolling-origin forecast). one by default.

output

Optional parameter: The name of the output file with the structure Folder/subfolder/file. benchmark.csv by default.

name

Optional parameter: The name of the forecasting method. Benchmarked Method by default.

reportAll

Optional parameter: Whether to report the results of the state-of-the-art methods already benchmarked. TRUE by default.

Value

The performance of the forecasting method in comparison with state-of-the-art methods.

Author(s)

Andre Bauer

Examples

# Example usage
benchmark(forecaster,usecase="economics",type="one")

# Example forecasting method
forecaster <- function(ts,h){ return(forecast(ets(ts), h = h)$mean) }

DescartesResearch/ForecastBenchmark documentation built on Sept. 1, 2022, 7:27 p.m.