| ME | R Documentation |
Accuracy measures for point forecast residuals.
ME(resid, na.rm = TRUE)
MAE(resid, na.rm = TRUE, ...)
MSE(resid, na.rm = TRUE, ...)
RMSE(resid, na.rm = TRUE, ...)
MPE(resid, actual, na.rm = TRUE, ...)
MAPE(resid, actual, na.rm = TRUE, ...)
MASE(
resid,
train,
demean = FALSE,
na.rm = TRUE,
period,
d = period == 1,
D = period > 1,
...
)
RMSSE(
resid,
train,
demean = FALSE,
na.rm = TRUE,
period,
d = period == 1,
D = period > 1,
...
)
point_measures
resid |
A numeric vector of residuals from either the validation or the test data. |
na.rm |
If |
... |
Additional arguments for each measure. |
actual |
A numeric vector of the realised values matching the forecasts. Required by the percentage measures. |
train |
A numeric vector of responses used to train the model. Required by the scaled measures. |
demean |
Should the response be demeaned (for |
period |
The seasonal period of the data. Required by the scaled measures. |
d |
Should the response model include a first difference? Defaults to
|
D |
Should the response model include a seasonal difference? Defaults
to |
An object of class list of length 8.
For the individual functions (ME, MAE, MSE,
RMSE, MPE, MAPE, MASE, RMSSE), a
single numeric scalar giving the requested accuracy measure.
For the exported object point_measures, a named list of functions
that can be supplied to higher-level accuracy routines.
interval_measures for the interval counterparts, and
accuracy.cvforecast, which applies these measures to a
cross-validation or a conformal prediction object.
# Toy residuals and data
set.seed(1)
y_train <- rnorm(50)
y_test <- rnorm(10)
fcast <- y_test + rnorm(10, sd = 0.2)
resid <- y_test - fcast
# Basic measures
ME(resid)
MAE(resid)
RMSE(resid)
# Percentage measures require 'actual'
MPE(resid, actual = y_test)
MAPE(resid, actual = y_test)
# Scaled measures require training data (and seasonal period if applicable)
MASE(resid, train = y_train, period = 1)
RMSSE(resid, train = y_train, period = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.