Problem with @MCVARDoDraws

Questions and discussions on Vector Autoregressions
alvarezcc
Posts: 25
Joined: Wed Mar 25, 2009 8:59 am

Problem with @MCVARDoDraws

Unread post by alvarezcc »

Hi! I tried to obtain confidence intervals for IRF's using this procedure but I get the following error:

@MCVARDoDraws(model= svar_92q3 ,STEPS=20,DRAWS=10000)
## MAT2. Matrices with Dimensions 36 x 5 and 13 x 5 Involved in + Operation
The Error Occurred At Location 0425 of MCVARDODRAWS
Line 50 of MCVARDODRAWS


I am using a factorization matrix obtained by CVMODEL from the estimation of a A-B model. Can anybody please explain me what I'm doing wrong and how to solve it.

Thanks in advance
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Re: Problem with @MCVARDoDraws

Unread post by moderator »

The problem is probably with this line in the procedure

compute betadraw=betaols+betau

The error message suggests the dimensions of the two arrays (betaols and betau) don't match. Did you change the earlier line that computes betau, or that defines the FSIGMAD matrix used in that computation?

If so, that's probably not what you wanted to do. Change that code back to the way it was originally.

Instead, if you want to use your own factorization (such as one estimated using CVMODEL), the section of code you want to change is the following:

* The next line is where a particular factorization of sigmad is
* input into the calculation. This does the Cholesky factorization in
* standard order, which is what is used above in drawing the
* coefficients.
*
compute factor=fsigmad

You can replace that COMPUTE with whatever code you need to compute the appropriate FACTOR matrix (for example, defining FACTOR as the output from the CVMODEL).

Regards,
Tom Maycock
alvarezcc
Posts: 25
Joined: Wed Mar 25, 2009 8:59 am

Re: Problem with @MCVARDoDraws

Unread post by alvarezcc »

Hi! Thank you very much for your prompt response. I didn't change the compute betadraw.... line. I only changed the line you mention to use the factor matrix I calculated using cvmodel but I still keep receiving the same error mesage. Can you figure out what else could it be?

Thanks in advance
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Problem with @MCVARDoDraws

Unread post by TomDoan »

alvarezcc wrote:Hi! Thank you very much for your prompt response. I didn't change the compute betadraw.... line. I only changed the line you mention to use the factor matrix I calculated using cvmodel but I still keep receiving the same error mesage. Can you figure out what else could it be?

Thanks in advance
You're probably doing ESTIMATE for the VAR followed by CVMODEL. @MCVARDODRAWS assumes that the last estimation instruction before the procedure is the ESTIMATE for the VAR, as it pulls information out of the variables defined by that. Just re-do your ESTIMATE instruction after the CVMODEL.
alvarezcc
Posts: 25
Joined: Wed Mar 25, 2009 8:59 am

Re: Problem with @MCVARDoDraws

Unread post by alvarezcc »

Problem solved. Thaks!!
Post Reply