Selecting lag length that eliminates autocorrelation in ECM
Posted: Wed Aug 03, 2011 6:34 am
Hi, I am currently trying to implement Pesaran-Shin-Smith coinegration procedure for 12 different couples of series (swap and bond yield series of 12 different tenors).
PSS procedure is based on estimating an Unrestricted Error Correction Model of the form;
d(Y) d(X) Y(-1) X(-1) d(Y(-1)) d(X(-1)) d(Y(-2)) d(X(-2)) ... d(Y(-p)) d(X(-p))
Also you can add an intercept or a trend to this model.
In order to get healthy results, I need to determine the lag length which eliminates the autocorrelation of the disturbances and yields the minimum information criterion value (for example Schwarz Criterion).
I need to write a code that at least automatically runs p+1 (max. lag length) different least squares regressions (putting no lags, and then 1 lag of both variables, then 2, then 3...) and writes Schwarz values, Breusch-Godfrey LM stats for different orders of autocorrelation (for instance 1st, 5th and 20th order) to a table or a matrix. Then I can run the code for all 12 series and repeat these steps for the model with intercept.
I need help, Thank you in advance.
PSS procedure is based on estimating an Unrestricted Error Correction Model of the form;
d(Y) d(X) Y(-1) X(-1) d(Y(-1)) d(X(-1)) d(Y(-2)) d(X(-2)) ... d(Y(-p)) d(X(-p))
Also you can add an intercept or a trend to this model.
In order to get healthy results, I need to determine the lag length which eliminates the autocorrelation of the disturbances and yields the minimum information criterion value (for example Schwarz Criterion).
I need to write a code that at least automatically runs p+1 (max. lag length) different least squares regressions (putting no lags, and then 1 lag of both variables, then 2, then 3...) and writes Schwarz values, Breusch-Godfrey LM stats for different orders of autocorrelation (for instance 1st, 5th and 20th order) to a table or a matrix. Then I can run the code for all 12 series and repeat these steps for the model with intercept.
I need help, Thank you in advance.