Errors bands for VARIRF, MC

Questions and discussions on Vector Autoregressions
Ben
Posts: 7
Joined: Wed Jan 15, 2014 2:04 pm

Errors bands for VARIRF, MC

Unread post by Ben »

Dear All,
I try to apply the Bjørnland, Hilde C. Leitemo and Kai (2009) method for 5 variables (price, production, monetary policy, budgetary policy, and exchange rates).
I applied the code of Bjørnland, Hilde C. Leitemo and Kai (2009) with on short and long restrictions.
I generated the IRFs with VARIRF, then I applied the Monte Carlo method (@ MCProcessIRF) to introduce erros bands to IRFs.
I attach here the program that I wrote.
If you can help me, I want to know:

If IRFs with VARIRF are those of the SVAR?
the procedure for errors bands is right or not?

I want to generate all IRFs for all variables and all the shocks not just two as Bjørnland, Hilde C. Leitemo and Kai (2009) method.


Regards

Ben
Attachments
Application of Bjørnland, Hilde C. Leitemo and Kai (2009) method.RPF
Application Bjørnland, Hilde C. Leitemo and Kai (2009) method
(5.55 KiB) Downloaded 781 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Errors bands for VARIRF, MC

Unread post by TomDoan »

That looks fine. However, they include

*
* The rescaling done in the next two lines is specific to this paper
*
compute fd=%xdiag(factor)
ewise factor(i,j)=factor(i,j)/fd(j)

which normalizes the shocks to units on the diagonal. Particularly with SR-LR shocks, there isn't necessarily a close correspondence between shocks and specific variables the way there is with a simple Cholesky model or even a parametric SVAR. Most applications of MCMC to an SVAR would omit those two lines.
Ben
Posts: 7
Joined: Wed Jan 15, 2014 2:04 pm

Interpret IRFs and confidence intervals

Unread post by Ben »

Think you Tom for your reply and advices.

Finally i applied the method of Bjornland, Hidle, Leitemo and Kai (2009) as you advised me.

I have some other questions, espesly about the IRFs.

1-How to judge the significance of the IRFs through confidence intervals and positioning of zero axe.

2- In the method of Bjorland: shocks are standard deviation or what exactely (i can not found the information by looking at the%% responses) ?

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

Re: Interpret IRFs and confidence intervals

Unread post by TomDoan »

Ben wrote:Think you Tom for your reply and advices.

Finally i applied the method of Bjornland, Hidle, Leitemo and Kai (2009) as you advised me.

I have some other questions, espesly about the IRFs.

1-How to judge the significance of the IRFs through confidence intervals and positioning of zero axe.
If the upper bound is above and the lower is below, then you would conclude that that response step isn't significant.
Ben wrote: 2- In the method of Bjorland: shocks are standard deviation or what exactely (i can not found the information by looking at the%% responses) ?
As was described in the previous reply, they normalize the shocks to unit size.
Ben
Posts: 7
Joined: Wed Jan 15, 2014 2:04 pm

Errors bands and IRFs

Unread post by Ben »

Hello,
Think you Tom for your reactivity, i still need more precision.

1- I omitted the two lines mentioned above. That is why I wonder if this is one standard deviation.
2- You compare bunds to zero or to the reponses line ?
Regards.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Errors bands and IRFs

Unread post by TomDoan »

Ben wrote:Hello,
Think you Tom for your reactivity, i still need more precision.

1- I omitted the two lines mentioned above. That is why I wonder if this is one standard deviation.
Then they would be one standard deviation.
Ben wrote: 2- You compare bunds to zero or to the reponses line ?
If the bounds are on opposite sides of zero, then the response is insignificant.
Ben
Posts: 7
Joined: Wed Jan 15, 2014 2:04 pm

Shock sign

Unread post by Ben »

The shock are always positive, or can they be negatif ?
If this is the case, how to determine it ?
Cordially.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Shock sign

Unread post by TomDoan »

Ben wrote:The shock are always positive, or can they be negatif ?
If this is the case, how to determine it ?
Cordially.
If you're doing an SVAR, it depends upon the normalization that you've used. If it's a Cholesky factor, it will be positive by construction on the "own" variable.
Ben
Posts: 7
Joined: Wed Jan 15, 2014 2:04 pm

Sign of shock

Unread post by Ben »

Hello,
I apply a SVAR program of Bjornland, Hidle, Leitemo and Kai (2009).
1- this is a part of the program. Can you tell me if normalization used here is a positive or negative shock ?

Code: Select all

*****

dec rect lr(5,5)
dec rect sr(5,5)
*
input sr
 . 0 . . .
 . . . . 0
 . . . . .
 . . . . 0
 0 0 . . .
input lr
 . 0 . . .
 . . . . 0
 . . . 0 .
 . . . . .
 0 0 . . .
*
dec vect[strings] shocklabels varlabels
compute shocklabels=||"A","B","C","D","E"||
compute varlabels=||"A1","B2","C3","D4","E5"||
*
@ShortAndLong(sr=sr,lr=lr,masum=inv(%varlagsums)) %sigma f

*
* Point estimates
*
@varirf(model=ben,steps=nsteps,factor=f,page=byshock,$
  shocks=shocklabels,varlabels=varlabels,accumulate=||1,2,3,4,5||)


***************************
* Monte Carlo integration
***************************
*
procedure SRLRDoDraws
*
option model     model
option integer   draws   10000
option integer   steps   40
option vect[int] accum   ||1||
option rect      lr
option rect      sr
*
local integer nvar
local rect    fxx fwish fsigmad factor
local integer wishdof
local rect    betaols betau betadraw
local vect    ix
local symm    sigmad
local integer i j draw
*
if .not.%defined(model) {
   disp "###SRLRDoDraws(MODEL=ben,other options)"
   return
}
compute nvar=%modelsize(model)
*
* Standard setup for drawing from an OLS VAR
*
compute fxx    =%decomp(%xx)
compute fwish  =%decomp(inv(%nobs*%sigma))
compute wishdof=%nobs-%nreg
compute betaols=%modelgetcoeffs(model)
*
local rect[series] impulses(nvar,nvar)
*
* These are global variables
*
declare vect[rect]   %%responses(draws)
*
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)
   *
   * Compute the short-and-long-run factor using the recalculated lag
   * sums of the model.
   *
   @ShortAndLong(lr=lr,sr=sr,masum=inv(%modellagsums(model))) sigmad factor
   *
   * The rescaling done in the next two lines is specific to this paper
   *
*******   compute fd=%xdiag(factor)
*******   ewise factor(i,j)=factor(i,j)/fd(j)
   *
   impulse(noprint,model=ben,factor=factor,results=impulses,steps=steps)
   *
   * Accumulate the responses as requested
   *
   do i=1,%rows(accum)
      do j=1,nvar
         acc impulses(accum(i),j) 1 steps
      end do j
   end do i
   *
   * Store the impulse responses
   *
   dim %%responses(draw)(nvar*nvar,steps)
   ewise %%responses(draw)(i,j)=ix=%vec(%xt(impulses,j)),ix(i)
   infobox(current=draw)
end do draw
infobox(action=remove)
*
* Restore the original coefficients
*
compute %modelsetcoeffs(model,betaols)
*
end SRLRDoDraws
*
@SRLRDoDraws(accum=||1,2,3,4,5||,steps=nsteps,model=ben,lr=lr,sr=sr)
@MCProcessIRF(model=ben,percentiles=||.16,.84||,center=median,lower=lower,upper=upper,irf=irf)


2- It's possible to explain briefly how to impose positive and négative shock on the program ?
Regards
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Errors bands for VARIRF, MC

Unread post by TomDoan »

With short- and long-run restrictions, the signs of the non-zero impacts are generally not set directly as part of the calculation. You have to figure out what it means for something to be a "positive" shock and flip column signs in the factor as needed to make that happen.
Post Reply