################################################# # Exercicio 1 ################################################# delta0 = 0 delta1 = 0.01 sig2 = 1.0 n = 1000 ts = 1:n y = rnorm(n,delta0+delta1*ts,sqrt(sig2)) #(a) #### par(mfrow=c(1,2)) ts.plot(y) acf(y) #(c) #### par(mfrow=c(1,2)) z=diff(y,1) ts.plot(z) acf(z) ################################################# # Exercicio 3 ################################################# alpha = 0.8 sig2 = 1.0 n = 1000 ts = 1:n e = rnorm(n,0,sqrt(sig2)) y = rep(0,n) y[1] = e[1] for (t in 2:n) y[t] = e[t]-alpha*e[t-1] par(mfrow=c(1,2)) ts.plot(y) acf(y) ################################################# # Exercicio 5 ################################################# sig2 = 0.01 n = 100 ts = 1:n phis = c(-1.01,-0.9,-0.5,0.5,0.9,1.01) par(mfrow=c(3,4)) for (phi in phis){ e = rnorm(n,0,sqrt(sig2)) y = rep(0,n) y[1] = e[1] for (t in 2:n) y[t] = phi*y[t-1]+e[t] ts.plot(y,main=paste("phi=",phi,sep="")) acf(y,main="") }