Homework 11

Generate n observations x from an AR(2) process with parameters phi=(phi1,phi2) corresponding to a complex root structure with period lambda and modulus r (see the course Web page for my crude S-Plus code to do this -- it is crude but perfectly efficient and correct, though there are other ways; check the S-Plus function arima.sim(), for example). I want you to experiment with "real" data y with y_t = x_t + nu_t where nu_t is a white noise sequence, N(0,v) for some variance v, i.e., y is x measured with noise. Take v=s^2 so the s.d. of the 'contaminating' noise is s (and this is relative to the innovations noise s.d. of 1). Recall that we know that y is ARMA(2,2) and can be approximated by AR(p) for p big enough.

The S-Plus function ar() uses various algorithms to compute estimates of phi. It does not compute 'our' posterior means, but in some cases (large samples) the resulting estimates can be close. It is useful for initial exploration of time series. The result is a list of objects ..

S-Plus uses the AIC criterion to choose p. It fits orders p=1,2,..,some upper limit and chooses the value with minimum AIC. AIC is not a Bayesian number, but comparing two values of p with their AIC values is something akin to computing a Bayes' factor (AIC usually overestimates p). Again, it is useful in initial exploration (though Bayesian modifications are easy and should be made). Typing a$aic prints the AIC values, standardised so that the 'optimal' p value has AIC=0.

nb: FYI you can fit a specified order by switching off the AIC calculations: e.g., fit an AR(8) via: a_ar(y, aic=F, order=8)