Bayesian SVAR using cvmodel and Wishart prior

Questions and discussions on Vector Autoregressions
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Bayesian SVAR using cvmodel and Wishart prior

Unread post by TG81 »

Hi,

I want to use a Bayesian SVAR model with normal wishart prior. I try to bring in %%responses as I want to use the @mcprocessirf procedure. However, I get the following error message when I run the attached program:

## MAT2. Matrices with Dimensions 16 x 5 and 10 x 5 Involved in + Operation
The Error Occurred At Location 183, Line 10 of loop/block

I am not able to fix the problem, please help me with this.

Many thanks!
Attachments
testtry.xls
Data
(35.5 KiB) Downloaded 663 times
Codes April 13.txt
Program
(2.69 KiB) Downloaded 847 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Bayesian SVAR using cvmodel and Wishart prior

Unread post by TomDoan »

The "This is the standard setup for MC integration of an OLS VAR" assumes that you've just done an ESTIMATE instruction. You've inserted the CVMODEL between the ESTIMATE and that, and that has reset some of the information used. Move the MC setup up above the CVMODEL.
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Re: Bayesian SVAR using cvmodel and Wishart prior

Unread post by TG81 »

Dear Tom,

Thanks very much for the reply. Now after fixing the program as suggested by you (please see attached), I am getting the results. However, some of the impulse responses are looking very weird. There are possibly more errors which I am not able to see. Can you please help me with that?

TG
Attachments
Codes April 17.txt
Program
(2.69 KiB) Downloaded 832 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Bayesian SVAR using cvmodel and Wishart prior

Unread post by TomDoan »

I think if you take the NOPRINT off the CVMODEL inside the loop, you'll see that you aren't getting reliable estimates. That's a very large model for the small amount of data you have. Even though the model is exactly identified, you're often better off doing importance sample or MH on a model like that if it doesn't have a constructive factor. Whether you can tune one of those correctly when the covariance matrix isn't well-defined by the data is another question entirely.
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Re: Bayesian SVAR using cvmodel and Wishart prior

Unread post by TG81 »

Thanks very much for the reply!
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Re: Bayesian SVAR using cvmodel and Wishart prior

Unread post by TG81 »

Dear Tom,

I am getting sensible results for the current model using MH.

I ran the program, that is SVAR with Whishart prior (attached in my previous thread), on a monthly dataset of 20 years. Again the results show weird impulse responses especially for the variables appearing later in the model. Hence I was wondering if the problem is with the program rather than the data. The same dataset show good results using MH.

TG
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Bayesian SVAR using cvmodel and Wishart prior

Unread post by TomDoan »

That probably shows that you can't reliably fit the CVMODEL "blind", which makes it useless inside a simulation loop.
Post Reply