El modelo a Simular es \(Y_t=e_t +\theta* y_{t-2}\)
set.seed(12345)
par(mfrow=c(1,2))
theta=runif(300,0,1)[1]
theta
## [1] 0.7209039
e=rnorm(300,0,1)
y=c()
for (t in 3:300) y[t] =e[t]-theta*e[t-2]
y1=y[-(1:2)]
El modelo anterior es una MA(2) entonces el rezago mas significativo es el numero 2
Z #ACF
##
## Autocorrelations of series 'y1', by lag
##
## 0 1 2 3 4 5 6 7 8 9
## 1.000 -0.011 -0.475 -0.030 0.053 0.083 -0.105 -0.068 0.075 0.057
## 10 11 12 13 14 15 16 17 18 19
## -0.048 -0.002 0.030 -0.080 -0.007 0.043 0.031 0.005 -0.070 0.012
## 20 21 22 23 24
## 0.088 0.023 -0.086 -0.060 0.045
El modelo a Simular es \(Y_t=\phi*y_{t-1} +e_t\)
set.seed(12345)
par(mfrow=c(1,2))
e=rnorm(300)
phi=runif(300,0.0001,0.9999)[1]
phi
## [1] 0.6992232
y=c()
y=e[1]
for (t in 2:300) y[t] =phi*y[t-1]+e[t]
El modelo anterior es una AR(1) entonces el rezago mas significativo es el numero 1 y es muy similar al valor de \(\phi\)
X #ACF
##
## Autocorrelations of series 'y', by lag
##
## 0 1 2 3 4 5 6 7 8 9
## 1.000 0.667 0.425 0.276 0.172 0.118 0.021 -0.002 -0.049 -0.018
## 10 11 12 13 14 15 16 17 18 19
## 0.039 0.039 0.048 0.030 0.019 0.023 0.016 0.067 0.083 0.046
## 20 21 22 23 24
## 0.020 0.001 -0.029 -0.039 -0.049