Write S-Plus (or Matlab) code to implement a Time-Varying AR model (TVAR) based on the random-walk evolution (i.e., dynamic auto-regression) of Section 9.6 and using a single discount factor. Program the sequential updating analysis (including learning the constant observation variance) and retrospective filtering.
The main objective is to compute
Your program outputs for hand-in should include (minimally) graphs of the filtered estimates of the TVAR parameters over time. Also, use some of the earlier S-Plus code to compute, at a selection of time points (not necessarily all) such as t=1,10,20,..., the roots of the AR polynomial at the "current" estimate of the TVAR state vector. Assuming at least one complex component, compute the corresponding estimate of the maximum period/wavelength in the series. Your program should produce a graph of this quantity to show its variation over time (cf. Figure 9.5 in Chapter 9).
Apply this analysis to the new series of EEG recordings linked to the course homepage (also here). You should probably use a TVAR model of order at least 4, probably no more than 20. Run the analysis a few times with differing (but high) values of the discount factor, such as 0.8, 0.9, 0.99. Your class presentation and report to hand in should compare these analyses, comment on differences, and interpret in the context of the EEG problem.
I expect you to contribute beyond these basics. Some items that might be developed include such as ideas for formally choosing between discount values, ways of combining the several analyses, computation and display of the time series decomposition (cf. Figures 9.3 and 4 of Chapter 9), looking at residuals, inferential insights for the EEG problem, etc etc. The assessment will carry meaningful credit for any such developments. Don't feel constrained!