Generalized Impulse Responses

Questions and discussions on Vector Autoregressions

Generalized Impulse Responses

Postby guillaume » Thu Jul 02, 2009 4:36 am

Hi
Is there a procedure to obtain directly GIR and their confidence intervals in a VAR? I can not find any example with the procedure and example browser on estima website.
guillaume
 
Posts: 7
Joined: Wed Jun 17, 2009 9:21 am

Re: Impulse response function

Postby TomDoan » Thu Jul 02, 2009 9:48 am

guillaume wrote:Hi
Is there a procedure to obtain directly GIR and their confidence intervals in a VAR? I can not find any example with the procedure and example browser on estima website.


This is from the July 2002 RATS newsletter

<<quote>>
Generalized Impulse Responses (Pesaran and Shin, (1998), “Generalized Impulse Response Analysis in Linear Multivariate
Models”, Economics Letters, 58, 17-29) are an attempt to avoid the difficulties of identifying orthogonal shocks in VAR models. This is not a particularly complicated idea; in fact, all these do is compute the shocks with each variable in turn being first in a Choleski order. These can be done quite easily using RATS; the following:

Code: Select all
declare rect f(n,n)
ewise f(i,j)=sigma(i,j)/sqrt(sigma(j,j))
impulse(decomp=f) etc.


will give you the GIR.

However, while these can, quite easily, be done in RATS, we do not recommend them. While coming up with an orthogonalizing model can, in practice, be somewhat difficult, it is a necessary step. A set of responses to highly correlated
shocks are almost impossible to interpret sensibly. For instance, you can’t run an ERRORS instruction to assess the
economic significance of the responses, since that requires an orthogonal decomposition of the covariance matrix.
<<end quote>>

You can actually do this in-line with

Code: Select all
impulse(decomp=sigmad*inv(%diag(%sqrt(%xdiag(sigmad))),etc.)


If you replace the decomp=swish in montevar with that, you'll get what you want.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Impulse response function

Postby luxu1983 » Tue Aug 18, 2009 12:22 pm

TomDoan wrote:
guillaume wrote:Hi
Is there a procedure to obtain directly GIR and their confidence intervals in a VAR? I can not find any example with the procedure and example browser on estima website.


This is from the July 2002 RATS newsletter

<<quote>>
Generalized Impulse Responses (Pesaran and Shin, (1998), “Generalized Impulse Response Analysis in Linear Multivariate
Models”, Economics Letters, 58, 17-29) are an attempt to avoid the difficulties of identifying orthogonal shocks in VAR models. This is not a particularly complicated idea; in fact, all these do is compute the shocks with each variable in turn being first in a Choleski order. These can be done quite easily using RATS; the following:

Code: Select all
declare rect f(n,n)
ewise f(i,j)=sigma(i,j)/sqrt(sigma(j,j))
impulse(decomp=f) etc.


will give you the GIR.

However, while these can, quite easily, be done in RATS, we do not recommend them. While coming up with an orthogonalizing model can, in practice, be somewhat difficult, it is a necessary step. A set of responses to highly correlated
shocks are almost impossible to interpret sensibly. For instance, you can’t run an ERRORS instruction to assess the
economic significance of the responses, since that requires an orthogonal decomposition of the covariance matrix.
<<end quote>>

You can actually do this in-line with

Code: Select all
impulse(decomp=sigmad*inv(%diag(%sqrt(%xdiag(sigmad))),etc.)


If you replace the decomp=swish in montevar with that, you'll get what you want.


dear TomDoan

Code: Select all
declare rect f(n,n)
ewise f(i,j)=sigma(i,j)/sqrt(sigma(j,j))
impulse(decomp=f) etc.


sigma in the code stands for what ?? it is variance-covariance matrix of the VAR model ?

thanks
luxu1983
 
Posts: 67
Joined: Wed Aug 12, 2009 10:53 pm

Re: Impulse response function

Postby TomDoan » Tue Aug 18, 2009 12:51 pm

luxu1983 wrote:dear TomDoan

Code: Select all
declare rect f(n,n)
ewise f(i,j)=sigma(i,j)/sqrt(sigma(j,j))
impulse(decomp=f) etc.


sigma in the code stands for what ?? it is variance-covariance matrix of the VAR model ?

thanks


Yes. It's the covariance matrix for the VAR.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Generalized Impulse Responses

Postby nazif » Fri Jan 06, 2012 6:43 am

Dear Doan,
I wrote this simple code to measure the oil pass-through under different inflationary environments. Could you please help me to modify this code to produce generalized irfs with 1 standard deviation error bands?

Thanks for your help.
Nazif

Code: Select all
open data oil_output_rats_level_en_eco.xls
calendar(m) 1987
data(format=xls,org=columns) 1987:1 2011:3
*************************************************************************************************
compute [vect[strings]] implabel=|| "dlind","dlcoil", "dlner", "dlgasr", "dlcpi"||
compute  nsteps = 18
compute  p = 3
*
**************************************************************************************************
set low =  DLCPI{1}< 0.01746
set high = DLCPI{1}>=0.01746
**************************************************************************************************
graph(shading=high) 1
# DLCPI
*********High Inflation Regime********************************************************
system(model=poilmodel1)
variables DLINDTR DLROIL DLNER DLgaSCPI DLcPI
lags 1 to p
det constant
end(system)
estimate(resids=varresids, smpl=high)
*
errors(model=poilmodel1,window="Variance Decomposition(High)", steps=nsteps)
impulse(model=poilmodel1, window="Impulse Responses", steps=nsteps, result=impulseshigh)
@MCVARDoDraws(model=poilmodel1, steps=nsteps)
@MCGraphIRF(model=poilmodel1,VARLABELS=implabel,SHOCKLABELS=implabel,$
center=mean,page=all,HEADER='High Inflation',STDDEV=1.0,INCLUDE=||4,5||)
*******Linear VAR******************************************************************************
system(model=poilmodel2)
variables DLINDTR DLROIL DLNER DLgaSCPI DLcPI
lags 1 to p
det constant
end(system)
estimate(resids=varresids)
*
errors(model=poilmodel2,window="Variance Decomposition(linear)", steps=nsteps)
impulse(model=poilmodel2, window="Impulse Responses", steps=nsteps, result=impulses)
@MCVARDoDraws(model=poilmodel2, steps=nsteps)
@MCGraphIRF(model=poilmodel2,VARLABELS=implabel,SHOCKLABELS=implabel,$
center=mean,page=all,HEADER='Linear VAR',STDDEV=1.0,INCLUDE=||4,5|| )

******Low inflation Regime************************************************
system(model=poilmodel3)
variables DLINDTR DLROIL DLNER DLgaSCPI DLcPI
lags 1 to 4
det constant
end(system)
estimate(resids=varresids, smpl=low, noprint)
*
errors(model=poilmodel3,window="Variance Decomposition(Low)", steps=nsteps)
impulse(model=poilmodel3,window="Impulse Responses", steps=nsteps, result=impulseslow)
@MCVARDoDraws(model=poilmodel3, steps=nsteps)
@MCGraphIRF(model=poilmodel3,VARLABELS=implabel,SHOCKLABELS=implabel,$
center=mean,page=all,HEADER='Low Inflation',STDDEV=1.0,INCLUDE=||4,5||)
nazif
 

Re: Generalized Impulse Responses

Postby TomDoan » Fri Jan 06, 2012 8:34 am

Make a copy of MCVARDoDraws (renamed both the procedure file and the procedure itself) and modify it for GIRF by following the directions in

http://www.estima.com/forum/viewtopic.php?f=7&t=333

It's a one-line change.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm


Return to VARs (Vector Autoregression Models)

Who is online

Users browsing this forum: No registered users and 1 guest