Description Usage Arguments Details Value Author(s) References Examples
Returns range of summary measures of the forecast accuracy. If x
is provided, the function measures out-of-sample (test set) forecast accuracy
based on x-f. If x
is not provided, the function only produces in-sample (training set) accuracy measures of the forecasts based on f["x"]-fitted(f).
All measures are defined and discussed in Hyndman and Koehler (2006).
1 |
f |
An object of class |
x |
An optional numerical vector containing actual values of the same length as object, or a time series overlapping with the times of |
test |
Indicator of which elements of x and f to test. If |
d |
An integer indicating the number of lag-1 differences to be used for the denominator in MASE calculation. Default value is 1 for non-seasonal series and 0 for seasonal series. |
D |
An integer indicating the number of seasonal differences to be used for the denominator in MASE calculation. Default value is 0 for non-seasonal series and 1 for seasonal series. |
The measures calculated are:
ME: Mean Error
RMSE: Root Mean Squared Error
MAE: Mean Absolute Error
MPE: Mean Percentage Error
MAPE: Mean Absolute Percentage Error
MASE: Mean Absolute Scaled Error
ACF1: Autocorrelation of errors at lag 1.
By default, the MASE calculation is scaled using MAE of in-sample naive forecasts for non-seasonal time series, in-sample seasonal naive forecasts for seasonal time series and in-sample mean forecasts for non-time series data.
See Hyndman and Koehler (2006) and Hyndman and Athanasopoulos (2014, Section 2.5) for further details.
Matrix giving forecast accuracy measures.
Rob J Hyndman
Hyndman, R.J. and Koehler, A.B. (2006) "Another look at measures of forecast accuracy". International Journal of Forecasting, 22(4), 679-688. Hyndman, R.J. and Athanasopoulos, G. (2014) "Forecasting: principles and practice", OTexts. Section 2.5 "Evaluating forecast accuracy". http://www.otexts.org/fpp/2/5.
1 2 3 4 5 6 7 8 | fit1 <- rwf(EuStockMarkets[1:200,1],h=100)
fit2 <- meanf(EuStockMarkets[1:200,1],h=100)
accuracy(fit1)
accuracy(fit2)
accuracy(fit1,EuStockMarkets[201:300,1])
accuracy(fit2,EuStockMarkets[201:300,1])
plot(fit1)
lines(EuStockMarkets[1:300,1])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.