Page 1 of 1

just-identified SVAR

Posted: Mon Jan 10, 2011 12:31 pm
by miguel
Hi,

I am not familiar with running Monte Carlos in RATS.
Could anyone please tell me how I must modify the MCVARdodraws procedure so that the factor that was obtained with the shortandlong procedure is
used instead of the standard Cholesky factorization? (for a just-identified SVAR)

The standard MCVARdodraws procedure reads:

Code: Select all

....
compute fxx    =%decomp(%xx)
compute fwish  =%decomp(inv(%nobs*%sigma))
compute betaols=%modelgetcoeffs(model)
compute wishdof=%nobs-%rows(fxx)
.....
infobox(action=define,progress,lower=1,upper=draws) "Monte Carlo Integration"
do draw = 1,draws
   if %clock(draw,2)==1 {
      compute sigmad  =%ranwisharti(fwish,wishdof)
      compute fsigmad =%decomp(sigmad)
      compute betau   =%ranmvkron(fsigmad,fxx)
      compute betadraw=betaols+betau
   }
   else
      compute betadraw=betaols-betau
   compute %modelsetcoeffs(model,betadraw)
   impulse(noprint,model=model,results=impulses,steps=steps,$
     factor=fsigmad)
.....
   dim %%responses(draw)(%rows(impulses)*%cols(impulses),steps)
   ewise %%responses(draw)(i,j)=ix=%vec(%xt(impulses,j)),ix(i)
   infobox(current=draw)
many thanks in advance!

Re: just-identified SVAR

Posted: Mon Jan 10, 2011 2:50 pm
by TomDoan
It's very similar to the BQDODRAWS procedure. As with BQDODRAWS, you need the extra step of recalculating the lag sum matrix for each new set of coefficients. In what you have, you would replace the IMPULSE instruction with

compute phiinv=inv(%modellagsums(model))
@ShortAndLong(lr=lr,sr=sr,masum=phiinv) sigmad sfactor
impulse(noprint,model=model,results=impulses,steps=steps,$
factor=sfactor)

where the LR and SR matrices should already be defined before you start the Monte Carlo loop. There's a full example at:

http://www.estima.com/forum/viewtopic.php?f=8&t=1118

Re: just-identified SVAR

Posted: Tue Jan 11, 2011 2:45 pm
by miguel
Thanks. I did this replacement exactly and the sr and lr matrices are pre-specified, but now I get

## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC.
The Error Occurred At Location 1691 of SHORTANDLONG
Line 123 of SHORTANDLONG
Line 63 of MCVARDODRAWS
.................................
Line 123 of shortandlong reads

compute %psubmat(r,fill,(j-1)*n+1,%xrow(masums,i))

Any idea what is going wrong?

Re: just-identified SVAR

Posted: Wed Jan 12, 2011 9:14 am
by TomDoan
What are your short and long run matrices? You're probably using a model which isn't identified properly.