Bjornland-Leitemo JME 2009

Use this forum for posting example programs or short bits of sample code.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Bjornland-Leitemo JME 2009

Unread post by TomDoan »

bjornland_leitemo_jme_2009.zip is a replication for for Bjørnland, Hilde C. and Kai Leitemo (2009): "Identifying the Interdependence between US Monetary Policy and the Stock Market", Journal of Monetary Economics, vol 56, pp 275-282. This uses the @ShortAndLong procedure to estimate a structural VAR on a five variable system, and includes Monte Carlo integration of the IRF's.

If you are looking for a more basic example of short- and long-restrictions with error band calculations, see https://estima.com/forum/viewtopic.php?f=8&t=2335.

Detailed Description
shengyang
Posts: 4
Joined: Mon Sep 10, 2012 12:00 pm

Re: Bjornland-Leitemo JME 2009

Unread post by shengyang »

I revised the program by expanding to 7-variable matrix. However, it keeps showing an error "ShortAndLong failed to converge to a solution". I greatly appreciate if you could give me some advices.

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

Re: Bjornland-Leitemo JME 2009

Unread post by TomDoan »

What are your SR and LR matrices?
shengyang
Posts: 4
Joined: Mon Sep 10, 2012 12:00 pm

Re: Bjornland-Leitemo JME 2009

Unread post by shengyang »

SR and LR matrices are as follows; if the LR restriction is removed, the error message will change to "## MAT5. Needed Matrix with Dimensions 7 x 1, Got 5 x 1 Instead"

input lr
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . 0 . . . .
. . . . . . .
. . . . . . .
input sr
. 0 0 0 0 0 0
. . 0 0 0 0 0
. . . 0 0 0 0
. . . . 0 0 0
. . . . . . 0
. . . . . . 0
. . . . . . .
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Bjornland-Leitemo JME 2009

Unread post by TomDoan »

How are you distinguishing your 5 and 6 shocks? You're also failing the Rubio-Ramirez-Wagonner-Zha counting rule.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: SVAR Montesvar command

Unread post by TomDoan »

cczzwhy wrote:Thank you very much! I also get a question on the dataset in Bjørnland, Hilde C. and Kai Leitemo (2009): "Identifying the Interdependence between US Monetary Policy and the Stock Market" paper.Can you tell me how you calculate the monthly data of pi from cpi?
Questions about data should generally be addressed to the authors. However, it's fairly clear that it's 100.0*(log(cpi)-log(cpi{12}))
cczzwhy
Posts: 48
Joined: Tue Jun 16, 2015 3:47 am

Re: Bjornland-Leitemo JME 2009

Unread post by cczzwhy »

Hello,Tom!I got a question about graphing error bands in irf. I am trying to generate a irf with two different error bands like

Code: Select all

@MCGraphIRF(model=varmodel,shocklabels=shocklabels,varlabels=varlabels,$
 center=input,impulses=baseirfs,percent=||.025,.16,.84,.975||,$
 footer="Figure 7. Pointwise 68% and 95% Posterior Bands, B-Q Model")
,but my model is a svar,so should I use the code

Code: Select all

@MCProcessIRF(model=varvix,percentiles=||.025,.16,.84,.975||,center=median,lower=lower,upper=upper,irf=irf)
?

What should I do to take the two different pairs of lower and upper vectors out?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Bjornland-Leitemo JME 2009

Unread post by TomDoan »

You would have to do two separate @MCPROCESSIRF's to get two sets of lower and upper (use different names). However, why can't you use @MCGRAPHIRF?
cczzwhy
Posts: 48
Joined: Tue Jun 16, 2015 3:47 am

Re: Bjornland-Leitemo JME 2009

Unread post by cczzwhy »

Thanks for your reply.It is because i am trying to generate a graph like Figure 7-26 in[Introduction to rats*],by using

Code: Select all

graph(row=1,col=1,header=varlabels(5),nodates,ovcount=3,overlay=fan,ovsame) 3
,what should I do to generate the fan area if using mcgraphirf?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Bjornland-Leitemo JME 2009

Unread post by TomDoan »

@MCProcessIRF(model=varvix,percentiles=||.025,.975||,center=median,lower=lower95,upper=upper95,irf=irf)
@MCProcessIRF(model=varvix,percentiles=||.16,.84||,center=median,lower=lower68,upper=upper68,irf=irf)
...

for i = target and j = shock the graph would be something like

graph(overlay=fan,other options) 5
# irf(i,j)
# lower95(i,j)
# lower68(i,j)
# upper68(i,j)
# upper95(i,j)
zoe_z
Posts: 2
Joined: Thu Jun 05, 2014 9:19 am

Re: Bjornland-Leitemo JME 2009

Unread post by zoe_z »

Dear Tom,

I have a quick question. If I want to use MC simulation to generate 68% probability bands for impulse responses using Cholesky factorization, can I simply use the same model as for SR-LR but only use SR block, while not restricting LR block?

dec rect lr(5,5) sr(5,5)
input lr
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
input sr
. 0 0 0 0
. . 0 0 0
. . . 0 0
. . . . 0
. . . . .


This would be a quick way of switching between Cholesky and SR-LR models while getting consistent probability bands for IRFs.

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

Re: Bjornland-Leitemo JME 2009

Unread post by TomDoan »

Yes. That would work.
cczzwhy
Posts: 48
Joined: Tue Jun 16, 2015 3:47 am

Re: Bjornland-Leitemo JME 2009

Unread post by cczzwhy »

Hello Tom!I have no idea about how to generate the variance composition in this procedure ,is there any examples?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Bjornland-Leitemo JME 2009

Unread post by TomDoan »

The variance decomposition is included in the original program. Look for "errors(". It has to use the factor matrix before standardizing the shocks.
istiak
Posts: 29
Joined: Sun Nov 11, 2012 9:03 pm

Re: Bjornland-Leitemo JME 2009

Unread post by istiak »

Hi Tom,
There are some numbers in the 5 variable model code that I do not understand. For example, in one line I see that
"@varirf(model=varstockp,steps=nsteps,factor=f,page=byshock,$
shocks=shocklabels,varlabels=varlabels,accumulate=||2,3,4||)"
In another line, I see that
"option vect[int] accum ||1||"
In another line, I see that
"@SRLRDoDraws(accum=||2,3,4||,steps=nsteps,model=varstockp,lr=lr,sr=sr)"
My question is what do the numbers in ||....||indicate?
If I use a 6 variable or 4 variable or 3 variable model, how do the numbers in the above ||....|| will change?
Thank you so much.
Post Reply