Encontrar la funcion de autocorrelacion para el proceso definido por:
\[ Y_t = 5 + e_t - \frac{1}{2} e_{t-1} + \frac{1}{4} e_{t-2} \]
\[ Corr(Y_t,Y_{t-1}) = -\frac{10}{21}\sigma² \] \[ Corr(Y_t,Y_{t-2})= \frac{4}{21} \sigma² \]
Graficar la funcion de autocorrelacion para los siguientes modelos MA(2) con los parametros.
a <-ARMAacf(ma=c(-0.5,-0.4), lag.max = 12)
plot(y = a[-1], x = 1:12, type = "h"); abline(h=0)
b<- ARMAacf(ma=c(-1.2, 0.7), lag.max = 12)
plot(y = b[-1], x = 1:12, type = "h"); abline(h=0)
c<- ARMAacf(ma=c(1, .6), lag.max = 12)
plot(y = c[-1], x = 1:12, type = "h"); abline(h=0)
Mostrar que cuando θ se reemplaza por 1/θ, la funcion de autocorrelacion de un MA(1) no cambia.
\[ \frac{\theta}{1+\theta²} = \frac{\frac{1}{\theta}}{1+\frac{1}{\theta²}} \] Si sustituimos para cualquier valor de θ diferente de 1, el resultado sera el mismo para cualquiera de las dos formulas. Por lo que se demuestra que la autocorrelacion para un MA(1) sera el mismo sin importar si se pone θ o 1/θ
Calcular y graficar las funciones de autocorrelacion para los siguientes modelos AR(1). Graficar con un numero suficientes de rezagos para que la funcion de autocorrelacion decrezca a casi cero.
a1<- ARMAacf(ar=.6, lag.max = 12)
plot(y = a1[-1], x = 1:12, type = "h"); abline(h=0)
b1<- ARMAacf(ar=-.6, lag.max = 14)
plot(y = b1[-1], x = 1:14, type = "h"); abline(h=0)
c1<- ARMAacf(ar=.95, lag.max = 20)
plot(y = c1[-1], x = 1:20, type = "h"); abline(h=0)
d1<- ARMAacf(ar=.3, lag.max = 5)
plot(y = d1[-1], x = 1:5, type = "h"); abline(h=0)
Describa las caracteristicas generales de la funcion de autocorrelacion para los siguientes procesos: a) MA(1), b) MA(2), c) AR(1), d) AR(2) y e) ARMA(1,1)
Un proceso MA(1), representado por \[Y t = e t + θe tâ1\] , tiene las propiedades: \[E (Y t ) = 0\] \[Var (Y t ) = Ï e 2 (1 + θ 2 )\] \[Cov (Y t , Y tâ1 ) = Î¸Ï e 2\] \[Cov (Y t , Y tâ2 ) = 0\] \[Corr (Y t , Y tâ1 ) = Ï 1 = \frac{(θ)}{(1 + θ 2 )}\] \[Corr (Y t , Y tâ2 ) = Ï k = 0\] para k ⥠2
Un proceso MM(2) descrito por, Y t = e t + θ 1 e tâ1 + θ 2 e tâ2 presenta las propiedades \[E (Y_t ) = 0\] \[Var (Y_t ) = (1 + θ² _{1} + θ²_2 )ϲ e \] \[Cov (Y_t , Y t_1 ) = (θ_1 + θ_1 θ_2 )ϲ e \] \[Cov (Y_t , Y_{tâ2} ) = θ_2 ϲ e \] \[Corr(Y_t,Y_{t-1}= \rho_1= \frac{θ_1 + θ_1 θ_2}{1+θ²_1 θ²_2}\] \[Corr (Y_t , Y_{tâ2} ) = Ï_2 = \frac{θa_2}{1+θ²_1 + θ²_2}\]
\[ Corr(Y_t,Y_{t-1}) = rho_k = k > 3 \] c) \[E (Y t ) = 0\] \[Var (Y t ) = \frac{ϲ_e}{1â ϲ}\]
\[γ_k = Ï_k\frac{\sigma²}{1-ϲ}\] y asà \[Ï_k = \frac{\gamma_k}{\gamma0} = Ï^k \]
Usar la formula recursiva \[Ï k = Ï 1 Ï k â 1 + Ï 2 Ï k â 2\] (ecuacion Yule-Walker) para calcular y graficar las funciones de autocorrelacion para los siguientes procesos AR(2) con los parametros especificados. En cada caso especifique si las raices de la ecuacion caracteristica son reales o complejas.
rho=NULL; phi1=0.6; phi2=0.3; max.lag=25
rho1=phi1/(1-phi2); rho2=(phi2*(1-phi2)+phi1^2)/(1-phi2)
rho[1]=rho1; rho[2]=rho2
for (k in 3:max.lag) rho[k]=phi1*rho[k-1]+phi2*rho[k-2]
rho
## [1] 0.8571429 0.8142857 0.7457143 0.6917143 0.6387429 0.5907600 0.5460789
## [8] 0.5048753 0.4667488 0.4315119 0.3989318 0.3688126 0.3409671 0.3152241
## [15] 0.2914246 0.2694220 0.2490806 0.2302749 0.2128891 0.1968159 0.1819563
## [22] 0.1682186 0.1555180 0.1437764 0.1329212
plot(y=rho,x=1:max.lag,type='h',ylab='ACF',xlab='Lag',ylim=c(-1,+1)); abline(h=0)
rho=NULL; phi1=-0.4; phi2=0.5; max.lag=25
rho1=phi1/(1-phi2); rho2=(phi2*(1-phi2)+phi1^2)/(1-phi2)
rho[1]=rho1; rho[2]=rho2
for (k in 3:max.lag) rho[k]=phi1*rho[k-1]+phi2*rho[k-2]
rho
## [1] -0.8000000 0.8200000 -0.7280000 0.7012000 -0.6444800 0.6083920
## [7] -0.5655968 0.5304347 -0.4949723 0.4632063 -0.4327687 0.4047106
## [13] -0.3782686 0.3536627 -0.3305994 0.3090711 -0.2889281 0.2701068
## [19] -0.2525068 0.2360561 -0.2206758 0.2062984 -0.1928573 0.1802921
## [25] -0.1685455
plot(y=rho,x=1:max.lag,type='h',ylab='ACF',xlab='Lag',ylim=c(-1,+1)); abline(h=0)
rho=NULL; phi1=1.2; phi2=-0.7; max.lag=10
rho1=phi1/(1-phi2); rho2=(phi2*(1-phi2)+phi1^2)/(1-phi2)
rho[1]=rho1; rho[2]=rho2
for (k in 3:max.lag) rho[k]=phi1*rho[k-1]+phi2*rho[k-2]
rho
## [1] 0.70588235 0.14705882 -0.31764706 -0.48411765 -0.35858824
## [6] -0.09142353 0.14130353 0.23356071 0.18136038 0.05413996
plot(y=rho,x=1:max.lag,type='h',ylab='ACF',xlab='Lag',ylim=c(-1,+1)); abline(h=0)
rho=NULL; phi1=-1; phi2=-0.6; max.lag=11
rho1=phi1/(1-phi2); rho2=(phi2*(1-phi2)+phi1^2)/(1-phi2)
rho[1]=rho1; rho[2]=rho2
for (k in 3:max.lag) rho[k]=phi1*rho[k-1]+phi2*rho[k-2]
rho
## [1] -0.62500 0.02500 0.35000 -0.36500 0.15500 0.06400 -0.15700
## [8] 0.11860 -0.02440 -0.04676 0.06140
plot(y=rho,x=1:max.lag,type='h',ylab='ACF',xlab='Lag',ylim=c(-1,+1)); abline(h=0)
rho=NULL; phi1=0.5; phi2=-0.9; max.lag=15
rho1=phi1/(1-phi2); rho2=(phi2*(1-phi2)+phi1^2)/(1-phi2)
rho[1]=rho1; rho[2]=rho2
for (k in 3:max.lag) rho[k]=phi1*rho[k-1]+phi2*rho[k-2]
rho
## [1] 0.26315789 -0.76842105 -0.62105263 0.38105263 0.74947368
## [6] 0.03178947 -0.65863158 -0.35792632 0.41380526 0.52903632
## [11] -0.10790658 -0.53008597 -0.16792707 0.39311384 0.34769128
plot(y=rho,x=1:max.lag,type='h',ylab='ACF',xlab='Lag',ylim=c(-1,+1)); abline(h=0)
rho=NULL; phi1=-0.5; phi2=-0.6; max.lag=13
rho1=phi1/(1-phi2); rho2=(phi2*(1-phi2)+phi1^2)/(1-phi2)
rho[1]=rho1; rho[2]=rho2
for (k in 3:max.lag) rho[k]=phi1*rho[k-1]+phi2*rho[k-2]
rho
## [1] -0.312500000 -0.443750000 0.409375000 0.061562500 -0.276406250
## [6] 0.101265625 0.115210937 -0.118364844 -0.009944141 0.075990977
## [11] -0.032029004 -0.029580084 0.034007444
plot(y=rho,x=1:max.lag,type='h',ylab='ACF',xlab='Lag',ylim=c(-1,+1)); abline(h=0)
Graficar las funciones de autocorrelacion para cada uno de los siguientes procesos ARMA: a) ARMA(1,1) con Ï=0.7 y θ=-0.4 b) ARMA(1,1) con Ï=0.7 y θ=0.4
a2<-ARMAacf(ar= .7 , ma= -.4, lag.max = 20)
plot(y=a2[-1],x=1:20,xlab='Lag',ylab='a2',type='h'); abline(h=0)
b2<-ARMAacf(ar= .7 , ma= .4, lag.max = 20)
plot(y=b2[-1],x=1:20,xlab='Lag',ylab='b2',type='h'); abline(h=0)
Considere dos procesos MA(2), uno con \(θ_1 = θ_2 = -1/6\) y otro con \(θ_1=1 y θ_2 =-6\)
ARMAacf(ma=c(-1/6,-1/6))
## 0 1 2 3
## 1.0000000 -0.1315789 -0.1578947 0.0000000
ARMAacf(ma=c(1,-6))
## 0 1 2 3
## 1.0000000 -0.1315789 -0.1578947 0.0000000
Observe que \(1 - \frac{1}{6}x-\frac{1}{2}x²= -\frac{1}{6} (x+3)(x-2)\) mientras que \(1 + x-6x²= -6(x+\frac{1}{3})(x-\frac{1}{2})\). Entonces las raices de los dos polinomios son reciprocos uno de otro. Solo el modelo MA(2) con \(\theta_1=\theta_2=-1/6\) es invertible.
Considere un proceso AR(1) \(Y_t = Y_{t â 1} + e_t\) . Mostrar que si \(|Ï| = 1\) el proceso no puede ser estacionario. (Pista: Tomar varianzas de ambos lados).
\(Var(Y_t)=\phi² Var(Y_{t-1})+\sigma²e\) ó \(Var(Y_t)=\frac{\sigma²e}{1-\phi²}\). Si \(|Ï|=1\) esto es imposible y se tiene prueba de que existen contradicciones.
Considere un proceso MA(6) con \(θ_1 =-0.5, θ_2 =0.25, θ_3 =-0.125, θ_4 =0.0625, θ_5 =-0.0325 and θ_6 =0.015625.\) Encontrar un modelo mas simple que tenga casi los mismos \(Ψ\)-pesos.
ARMAacf(ma=c(-0.5, 0.25, -0.125, 0.0625, -0.0325, 0.015625))
## 0 1 2 3 4 5
## 1.00000000 -0.49995181 0.24987336 -0.12474625 0.06199227 -0.03023441
## 6 7
## 0.01171876 0.00000000
ARMAacf(ar= -0.5, lag.max = 7)
## 0 1 2 3 4 5
## 1.0000000 -0.5000000 0.2500000 -0.1250000 0.0625000 -0.0312500
## 6 7
## 0.0156250 -0.0078125