Learn R Programming

dLagM (version 0.0.8)

MASE: Compute mean absolute scaled error (MASE)

Description

A function that computes mean absolute scaled error.

Usage

MASE(observed, fitted)

Arguments

observed

Observed time series data.

fitted

Fitted values of the model for which the MASE value will be calculated.

Value

MASE

Mean absolute scaled error (MASE) for the observed and fitted series sent into the function.

Details

Let \(e_{t} = Y_{t}-\hat{Y}_{t}\) be the one-step-ahead forecast error. Then, a scaled error is defined as

$$ q_{t}=\frac{e_{t}}{\frac{1}{n-1}\sum_{i=2}^{n}|Y_{i}-Y_{i-1}|}, $$ which is independent of the scale of the data. Mean absolute scaled error is defined as

$$ MASE = mean(|q_{t}|). $$ (Hyndman and Koehler, 2006)

References

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

Examples

Run this code
# NOT RUN {
data(warming)
model.poly = polyDlm(x = warming$NoMotorVehicles , y = warming$Warming , 
q = 2 , k = 2 , show.beta = TRUE ,  show.summary = TRUE)
MASE(observed = warming$Warming, fitted = model.poly$model$fitted.values)
# }

Run the code above in your browser using DataLab