RE: RE - Relative Error

Description Usage Arguments Value Examples

View source: R/ErrorMeasures.R

Description

RE = (Y-Y_hat)/(Y-Y_hat_bench)

Usage

1
RE(y, y_hat, y_hat_bench)

Arguments

y
  • True values of the time series

y_hat
  • Forecasted values of the time series

y_hat_bench
  • Forecasted values of the time series using the benchmark model

Value

RE value

Examples

1
2
3
4
5
6
7
8
9
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)
y_hat_average <-  rep(mean(y_train),h)
results <- RE(y_test,y_hat_average,y_hat_naive)

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