library(tseries)
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
library(forecast)
d2s=AirPassengers
plot(d2s)
El comportamiento de los datos es de forma multiplictiva, por lo tanto
procedemos a realizar la transformacion de los mismos
d2sl=log(d2s)
plot(d2sl)
adf.test(d2sl)
## Warning in adf.test(d2sl): p-value smaller than printed p-value
##
## Augmented Dickey-Fuller Test
##
## data: d2sl
## Dickey-Fuller = -6.4215, Lag order = 5, p-value = 0.01
## alternative hypothesis: stationary
La serie en logaritmos es estacionario, por que el p-valor es menor que alfa.
mod=auto.arima(d2sl,trace = T)
##
## ARIMA(2,1,2)(1,1,1)[12] : Inf
## ARIMA(0,1,0)(0,1,0)[12] : -434.799
## ARIMA(1,1,0)(1,1,0)[12] : -474.6299
## ARIMA(0,1,1)(0,1,1)[12] : -483.2101
## ARIMA(0,1,1)(0,1,0)[12] : -449.8857
## ARIMA(0,1,1)(1,1,1)[12] : -481.5957
## ARIMA(0,1,1)(0,1,2)[12] : -481.6451
## ARIMA(0,1,1)(1,1,0)[12] : -477.2164
## ARIMA(0,1,1)(1,1,2)[12] : Inf
## ARIMA(0,1,0)(0,1,1)[12] : -467.4644
## ARIMA(1,1,1)(0,1,1)[12] : -481.582
## ARIMA(0,1,2)(0,1,1)[12] : -481.2991
## ARIMA(1,1,0)(0,1,1)[12] : -481.3006
## ARIMA(1,1,2)(0,1,1)[12] : -481.5633
##
## Best model: ARIMA(0,1,1)(0,1,1)[12]
mod
## Series: d2sl
## ARIMA(0,1,1)(0,1,1)[12]
##
## Coefficients:
## ma1 sma1
## -0.4018 -0.5569
## s.e. 0.0896 0.0731
##
## sigma^2 = 0.001371: log likelihood = 244.7
## AIC=-483.4 AICc=-483.21 BIC=-474.77
\((y_t-y_{t-1})-(y_{t-12}-y_{t-13})=-0.40\epsilon_{t-1}-0.5569\epsilon_{t-12}\)