Learn R Programming

hts (version 3.03)

accuracy.gts: Accuracy measures for forecast grouped and hierarchical model

Description

Returns range of summary measures of the forecast accuracy. The function measures out-of-sample forecast accuracy based on (holdout data - forecasts). All measures are defined and discussed in Hyndman and Koehler (2006).

Usage

accuracy.gts(f, x, criterion = c( "all","RMSE","MAE","MAPE","MASE"))

Arguments

f
An object of class gts, containing the forecasted hierarchical time series
x
An object of class gts, containing the holdout hierarchical time series
criterion
Forecast error criterion.

Value

  • Vector (or matrix if criterion=="all") giving forecast accuracy measures.
  • RMSERoot Mean Square Error
  • MAEMean Absolute Error
  • MAPEMean Absolute Percentage Error
  • MASEMean Absolute Scaled Error

Details

MASE calculation is scaled using MAE of in-sample naive forecasts for non-seasonal time series, and in-sample seasonal naive forecasts for seasonal time series.

References

R. J. Hyndman and A. Koehler (2006), Another look at measures of forecast accuracy, International Journal of Forecasting, 22, 679-688.

See Also

hts, plot.gts, forecast.gts, accuracy

Examples

Run this code
data <- window(htseg1, start = 1992, end = 1999)
test <- window(htseg1, start = 2000, end = 2001)
forecast <- forecast(data, h = 2, method = "bu")
accuracy.gts(f = forecast, x = test)

Run the code above in your browser using DataLab