forecast_comp {Tcomp}R Documentation

Four standard forecasts of a competition dataset

Description

Applies four modelling strategies (ARIMA, ETS, Theta and naive or seasonally naive) to a dataset with class Mdata, returns accuracy statistics and (optionally) a summary graphic

Usage

forecast_comp(the_series, tests = list(the_series$h), plot = FALSE, ...)

Arguments

the_series

a list of class Mdata eg from the Mcomp or Tcomp package. Crucially, must include elements x (the training set), xx (the test set) and h (the forecast horizon)

tests

a list of the forecast horizons over which to return the MAPE and MASE, passed to accuracy

plot

whether or not to draw basic plot of the four forecast model

...

other parameters to pass to plot.forecast()

Details

This is just a convenience function for fitting four different standard time series forecasts to an object from an M competition or the tourism competition. Mainly of interest to analysis wishing to re-produce published results or create a benchmark against which other methods can be compared.

Value

A data frame of eight rows and length(tests) + 1 columns with first column as method and each other column containing the Mean Absolute Percentage Error (MAPE, first four rows) and Mean Absolute Scaled Error (MASE, final four rows) at the horizon indicated by the column name

Examples

forecast_comp(tourism$Y18, test = list(1, 2, 3, 4, 1:2, 1:4), plot = TRUE)
forecast_comp(tourism$Q4, test = list(1, 2, 3, 4, 5, 6, 7, 8, 1:4, 1:8), plot = FALSE)

[Package Tcomp version 1.0.1 Index]