Learn R Programming

ftsa (version 3.2)

error: Forecast error measure

Description

Computes the forecast error measure.

Usage

error(forecast, forecastbench, true, method = c("me", "mpe", "mae", 
 "mse", "sse", "rmse", "mdae", "mdse", "mape", "mdape", "smape", 
  "smdape", "rmspe", "rmdspe", "mrae", "mdrae", "gmrae", 
   "relmae", "relmse", "mase", "mdase", "rmsse"), giveall = FALSE)

Arguments

Value

A numeric value.

Details

Bias measure: If method = "me", the forecast error measure is mean error. If method = "mpe", the forecast error measure is mean percentage error. Forecast accuracy error measure: If method = "mae", the forecast error measure is mean absolute error. If method = "mse", the forecast error measure is mean square error. If method = "sse", the forecast error measure is sum square error. If method = "rmse", the forecast error measure is root mean square error. If method = "mdae", the forecast error measure is median absolute error. If method = "mape", the forecast error measure is mean absolute percentage error. If method = "mdape", the forecast error measure is median absolute percentage error. If method = "rmspe", the forecast error measure is root mean square percentage error. If method = "rmdspe", the forecast error measure is root median square percentage error. Forecast accuracy symmetric error measure: If method = "smape", the forecast error measure is symmetric mean absolute percentage error. If method = "smdape", the forecast error measure is symmetric median absolute percentage error. Forecast accuracy relative error measure: If method = "mrae", the forecast error measure is mean relative absolute error. If method = "mdrae", the forecast error measure is median relative absolute error. If method = "gmrae", the forecast error measure is geometric mean relative absolute error. If method = "relmae", the forecast error measure is relative mean absolute error. If method = "relmse", the forecast error measure is relative mean square error. Forecast accuracy scaled error measure: If method = "mase", the forecast error measure is mean absolute scaled error. If method = "mdase", the forecast error measure is median absolute scaled error. If method = "rmsse", the forecast error measure is root mean square scaled error.

References

P. A. Thompson (1990) "An MSE statistic for comparing forecast accuracy across series", International Journal of Forecasting, 6(2), 219-227. C. Chatfield (1992) "A commentary on error measures", International Journal of Forecasting, 8(1), 100-102. S. Makridakis (1993) "Accuracy measures: theoretical and practical concerns", International Journal of Forecasting, 9(4), 527-529. R. J. Hyndman and A. Koehler (2006) "Another look at measures of forecast accuracy", International Journal of Forecasting, 22(3), 443-473.

Examples

Run this code
error(forecast = 1:2, true = 3:4, method = "mae")
error(forecast = 1:2, true = 3:4, method = "mse")
error(forecast = 1:5, forecastbench = 6:10, true = 11:15, method = "mrae")
error(forecast = 1:5, forecastbench = 6:10, true = 11:15, method = "mdrae")

Run the code above in your browser using DataLab