MASE: MASE - Mean Absolute Scaled Error

Description Usage Arguments Value Examples

View source: R/ErrorMeasures.R

Description

MASE = 1/T ∑_{t=1}^T ( ( e_t )/((T/(T-1)) ∑_{i=2}^T Y_i-Y_{i-1}))

Usage

1
MASE(y, y_hat, result_type = c("measure", "raw"))

Arguments

y
  • True values of the time series

y_hat
  • Forecasted values of the time series

result_type
  • String indicating whether the function should return the raw values ("raw"), or the computed measure ("measure")

Value

According to the value of result_type:

Examples

1
2
3
4
5
6
7
8
y <- AirPassengers
splitting_point <- round(2*length(y)/3)
y_train <- y[1:splitting_point]
h <- 5

y_test <- y[(splitting_point+1):(splitting_point+h)]
y_hat_naive <- rep(tail(y_train,1),h)
results <- MASE(y_test,y_hat_naive)

jdestefani/UEMTS documentation built on Dec. 20, 2021, 10:05 p.m.