| 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 test data. |
na.rm |
If |
... |
Additional arguments for each measure. |
actual |
A numeric vector of responses matching the forecasts (for percentage measures). |
train |
A numeric vector of responses used to train the model (for scaled measures). |
demean |
Should the response be demeaned (for MASE and RMSSE)? |
period |
The seasonal period of the data. |
d |
Should the response model include a first difference? |
D |
Should the response model include a seasonal difference? |
An object of class list of length 8.
For the individual functions (ME, MAE, MSE, RMSE, MPE, MAPE, MASE, RMSSE),
returns a single numeric scalar giving the requested accuracy measure.
For the exported object point_measures, returns a named list of functions
that can be supplied to higher-level accuracy routines.
# 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.