SVAR Montesvar command

Questions and discussions on Vector Autoregressions
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: SVAR Montesvar command

Unread post by TomDoan »

FRegensburg wrote:Dear Mr Doan,

I seem to understand the MONTESVAR procedure is designed for over-identified vars- can it be employed for just-identified vars as well?
Yes. With a just-identified model, you have the option to draw the covariance matrix and estimate a CV model on the drawn covariance matrix inside the loop to get the factor. That works quickly and efficiently for structural models with constructive factors like a B-Q. If it requires ML estimation using CVMODEL, the process of getting the exact factorization might be quite time-consuming, so the Gibbs sampling can also be employed which requires only a single evaluation of the CVMODEL each sweep.

FRegensburg wrote: If so, how would I go about adapting a model such as the one attached (which is a cvmodel with an A and B matrix rather than just an A matrix, as in the example program)? when I add bfrml at the end of the cvmodel line in the example montesvar program I get a sintax error message, but clearly the rest of the code needs to be modified as well for the B matrix, the question is how...
Neither of the program you posted generates a syntax error, so I can't tell why you got one.
FRegensburg wrote: Secondly, if I wanted to use the MONTEVAR procedure instead, does it suffice to run it after I estimate the cv model (as in the second attachment), I'm asking because when I do so, the point estimates of the IRFs are clearly wrong (they obviously tell a completely different story than the ones I get from using errors and then varif).
You need to repeat the CVMODEL inside the loop, applied to the draw for the covariance matrix.
FRegensburg
Posts: 6
Joined: Mon Sep 03, 2012 7:09 pm

Re: SVAR Montesvar command

Unread post by FRegensburg »

Dear Tom,

I apologise, |I didn't make myself clear. If you look at the program attached, once I hit the cvmodel line (where I add bfrml) I get an error message, something like SX17 missing operator or adjacent operator. And I presume much of what follows from then on needs to be modified accordingly as well, would you be so kind to help me with that- I understand what this procedure does, but I have a hard time getting what the sintax means.

Many thanks
Attachments
japan1.xlsx
(19.23 KiB) Downloaded 813 times
montesvarBP.txt
(5.08 KiB) Downloaded 1008 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: SVAR Montesvar command

Unread post by TomDoan »

Use the A and B options instead:

cvmodel(parmset=simszha,dfc=ncoef,pdf=delta,dmatrix=marginalized,method=evaluate,a=afrml,b=bfrml) vmat

However, I would recommend basing your program on the simsirf.rpf program in the Sims-Zha Econometrica 1999 replication. That uses random walk Metropolis rather than importance sampling, and seems to work better in practice.
FRegensburg
Posts: 6
Joined: Mon Sep 03, 2012 7:09 pm

Re: SVAR Montesvar command

Unread post by FRegensburg »

Tom,

sorry to nag on. If I may ask, the estimates of the coefficients, now, using Sims's method, are similar in magnitude to what I get when I estimate the cvmodel without any Bayesian method, but now they're all insignificant, while all three of them are significant with the classical approach, why would that be?

I've attached the program-does it look sensible to you?

What's the reasoning behind the numbers in nudraw=6 and that 0.35 in the line 'compute f=decomp(%xx)*.35'?

How do I tease out the impact multipliers?

How should I interpret the vertical scale as it is now in the IRFs? How shall I express it in % changes?

For some reason my university doesn't have rats- this software of yours is a goldmine for econometrics, and I've asked the department to buy it.

Many thanks
Attachments
fiscalSimsIRF.txt
(3.97 KiB) Downloaded 990 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: SVAR Montesvar command

Unread post by TomDoan »

FRegensburg wrote:Tom,

sorry to nag on. If I may ask, the estimates of the coefficients, now, using Sims's method, are similar in magnitude to what I get when I estimate the cvmodel without any Bayesian method, but now they're all insignificant, while all three of them are significant with the classical approach, why would that be?

I've attached the program-does it look sensible to you?
You forgot your CALENDAR instruction so it ends up with only 48 annualized values. You'll get better results with the original quarterly data.

In the following segment, you need to adapt for the factor that you have an A-B model rather than just an A model. The "diagonalizer" matrix in an A-B model is inv(B)*A rather than just A. This is the correct coding:

compute vdiag =%mqformdiag(%sigma,tr(inv(b)*a))
ewise lambdadraw(i)=(%nobs/2.0)*vdiag(i)/%rangamma(.5*(%nobs-ncoef)+delta+1)
*
* Draw coefficients conditioned on the factor generated by theta and
* lambda. Again, we don't need to do this during the burn-in.
*
compute fsigmad=inv(a)*b*%diag(%sqrt(lambdadraw))
FRegensburg wrote: What's the reasoning behind the numbers in nudraw=6 and that 0.35 in the line 'compute f=decomp(%xx)*.35'?
You can experiment with those if the acceptance probability is too high or too low. 75% may be a bit high, but isn't unreasonable. A higher value to replace .35 means it tries larger changes, and a lower value of nudraw has a similar effect. The high acceptance probability on a random walk M-H usually means the increments are too small, so you might see about bumping that up a bit. (Target around 30-40% acceptances). I'm guessing it will make little difference in the results.
FRegensburg wrote: How do I tease out the impact multipliers?
They're just the 0 step responses. You can use MCPROCESSIRF to get the hard numbers.
FRegensburg wrote: How should I interpret the vertical scale as it is now in the IRFs? How shall I express it in % changes?
Assuming the input data are in logs, yes. They would be % changes.
FRegensburg wrote: For some reason my university doesn't have rats- this software of yours is a goldmine for econometrics, and I've asked the department to buy it.
Many thanks
Thank you. That would certainly be appreciated by both us and (we hope) your department.
cczzwhy
Posts: 48
Joined: Tue Jun 16, 2015 3:47 am

Re: SVAR Montesvar command

Unread post by cczzwhy »

Hello Tom,I want to ask about if there is any difference between using a code like

Code: Select all

dec frml[rect] afrml
nonlin g25 g34 g42 ...
frml afrml = ||1.0 ...
....
and

Code: Select all

input sr
. 0 0 0 0
. . 0 0 0
. . . 0 0
. . . . .
. . . . .
when place a cosntraint on var model.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: SVAR Montesvar command

Unread post by TomDoan »

Short and long run restrictions are a "B" form model, not "A", as is indicated by the description of the parametric form. However, if you have a model which is described entirely by SR restrictions (what you show isn't identified), then that would be equivalent to a parametric "B" model with freely estimated parameters at the non-zero slots in the SR matrix. However, if you need both short- and long-run restrictions, you can't write that in a simple form because the LR restrictions are implicit.
Post Reply