n=1000 theta = 0.5 w = rnorm(n+1) u = rnorm(n+1) x = rep(0,n+1) y = rep(0,n+1) for (i in 2:(n+1)){ x[i] = 0.98*x[i-1] + w[i] y[i] = 1 + w[i] + u[i] + theta*u[i-1] } x=ts(x[-1]) y=ts(y[-1]) z = cbind(x,y) plot(z)
acf( z,lag.max=20)