Question: 5. For this exercise obtain any relevant time series data set (e.g. the Yankees data set of Section 6.5.3 or an artificially generated data set).
5. For this exercise obtain any relevant time series data set (e.g. the Yankees data set of Section 6.5.3 or an artificially generated data set).
(a) Write a program which carries out posterior simulation for the Normal linear regression model with AR(p) errors (or obtain from the website associated with this book the program used to do the empirical illustration in Section 6.5.3 and study and understand it).
(b) Based on your derivations in Exercise 3, write a program which carries out posterior simulation for the independent Student-t linear regression model with AR(p) errors. Use the posterior simulator to calculate posterior means and standard deviations for all model parameters.
(c) Add to your program in part
(b) code to calculate Bayes factors which can be used for choosing p, the lag length of the AR(p) model. Use the Savage–Dickey density ratio. Use this program to choose an optimal value for p for your data set.
(d) Add to your programs in parts
(a) and
(b) code for calculating the marginal likelihood using the Gelfand–Dey method. Use these programs to decide whether Normal or Student-t errors are preferred for your data set.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
