Page 1 of 1

Problem with @MCVARDoDraws

Posted: Thu Aug 04, 2011 10:53 am
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

Re: Problem with @MCVARDoDraws

Posted: Thu Aug 04, 2011 12:29 pm
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

Re: Problem with @MCVARDoDraws

Posted: Thu Aug 04, 2011 1:00 pm
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

Re: Problem with @MCVARDoDraws

Posted: Thu Aug 04, 2011 1:38 pm
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.

Re: Problem with @MCVARDoDraws

Posted: Thu Aug 04, 2011 2:42 pm
by alvarezcc
Problem solved. Thaks!!