R Markdown

t=seq(2005.01,2021.04, length.out=length(PIB_Export$DATE))
PIB<-ts(PIB_Export$GDP,frequency=4,start=c(2005,1)) 
PIB
##           Qtr1      Qtr2      Qtr3      Qtr4
## 2005  81213.24  83953.56  85294.68  87496.52
## 2006  89908.93  93263.01  98022.59 100409.47
## 2007 103463.74 104380.70 108685.53 111976.03
## 2008 115139.53 116839.32 122631.38 121943.77
## 2009 121223.58 123910.20 127382.01 129058.22
## 2010 131485.23 134488.49 136867.71 141218.57
## 2011 148041.27 152728.68 156737.31 161515.74
## 2012 164593.12 166162.06 165969.55 169782.27
## 2013 171398.88 178531.41 181634.05 182528.67
## 2014 187824.08 188719.50 192213.03 194146.39
## 2015 195694.71 197239.86 205502.26 206255.17
## 2016 210525.11 214181.24 217351.86 221723.79
## 2017 225123.44 227730.89 232394.07 235222.59
## 2018 240255.84 245233.97 250542.36 251758.82
## 2019 256189.49 263579.53 268735.33 271563.65
## 2020 267855.48 219395.20 246298.42 265169.89
## 2021 275303.71 277362.91 303250.95 320776.76
plot(PIB)

The plot allow us to see clearly that the series has the a positive trend, and error. The seasonality is not that clear.

Models

ETS1<-ets(PIB)
ETS1
## ETS(M,A,N) 
## 
## Call:
##  ets(y = PIB) 
## 
##   Smoothing parameters:
##     alpha = 0.8345 
##     beta  = 1e-04 
## 
##   Initial states:
##     l = 77626.3497 
##     b = 2761.1318 
## 
##   sigma:  0.0328
## 
##      AIC     AICc      BIC 
## 1464.601 1465.569 1475.699
plot(ETS1)

ETS2<-ets(PIB, 'AAA')
ETS2
## ETS(A,A,A) 
## 
## Call:
##  ets(y = PIB, model = "AAA") 
## 
##   Smoothing parameters:
##     alpha = 0.9993 
##     beta  = 1e-04 
##     gamma = 1e-04 
## 
##   Initial states:
##     l = 77380.1034 
##     b = 2841.252 
##     s = 1574.835 769.9139 -2512.076 167.3275
## 
##   sigma:  8360.017
## 
##      AIC     AICc      BIC 
## 1524.661 1527.764 1544.636
plot(ETS2)

ETS3<-ets(PIB, 'AAN')
ETS3
## ETS(A,A,N) 
## 
## Call:
##  ets(y = PIB, model = "AAN") 
## 
##   Smoothing parameters:
##     alpha = 0.9759 
##     beta  = 1e-04 
## 
##   Initial states:
##     l = 77555.7805 
##     b = 2761.0176 
## 
##   sigma:  8418.094
## 
##      AIC     AICc      BIC 
## 1521.991 1522.959 1533.088
plot(ETS3)

We could think of using the second model and taking into account seasonality, error and trend. But if we look at the first model, the Akaike criterion tells us that we should use a model with multiplicative decomposition for the error and additive for the variance. In the case of seasonality we will not use decomposition.