Discussion 4

For this discusion i will be using the Colombian GDP between 2005 and 2021.

PIB <- ts(PIB_Export$GDP, frequency = 4, start=c(2005))

plot(PIB)

ETS <- ets(PIB)

plot(ETS)

accuracy(ETS)
##                    ME    RMSE      MAE       MPE     MAPE      MASE      ACF1
## Training set 920.9457 8218.59 3503.934 0.2879688 1.676985 0.2277208 0.1059353

In order to make a comparison we will forecast the next 6 months. First with ets and then with an arima model. In both cases we will let R to chose the best model.

forecast_ETS <- forecast(ETS, 6)
#FC <- accuracy(forecast_ETS, PIB_Export$GDP[1:6])
#FC
plot(forecast_ETS, main="ETS M,A,N Forecast")

ARIMA1 <- auto.arima(PIB)
plot(ARIMA1)
## Warning in plot.Arima(ARIMA1): No roots to plot

As we can see, we got an ARIMA(0,1,0) This means that we only have to differentiate one time in order to get a stationary series.

Forecast_ARIMA <- forecast(ARIMA1, 6)
#acc2 <- accuracy(fe2, df$Sales[1:6])
plot(Forecast_ARIMA)

RMSE, MAE and MAPE

test1 <- accuracy(forecast_ETS, PIB_Export$GDP[1:6])
test1
##                        ME      RMSE        MAE          MPE       MAPE
## Training set     920.9457   8218.59   3503.934    0.2879688   1.676985
## Test set     -240527.6745 240529.49 240527.674 -277.4588782 277.458878
##                    MASE      ACF1
## Training set  0.6763552 0.1059353
## Test set     46.4284256        NA
test2<- accuracy(Forecast_ARIMA, PIB_Export$GDP[1:6])
test2
##                         ME       RMSE        MAE          MPE       MAPE
## Training set       1.14173   8127.306   3414.284   -0.2630386   1.685507
## Test set     -246436.28393 246446.441 246436.284 -284.2041831 284.204183
##                    MASE        ACF1
## Training set  0.6590503 -0.02317325
## Test set     47.5689490          NA

Taking a look into the two accuracy tests we will choose the forecast using the ARIMA(0,1,0). Even so, we can see that both methods give us a fairly similar prediction.