Generalized Impulse Responses

Questions and discussions on Vector Autoregressions
guillaume
Posts: 7
Joined: Wed Jun 17, 2009 9:21 am

Generalized Impulse Responses

Unread post by guillaume »

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.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Impulse response function

Unread post by TomDoan »

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 Cholesky 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>>
nazif

Re: Generalized Impulse Responses

Unread post by nazif »

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||)
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Generalized Impulse Responses

Unread post by TomDoan »

(Response updated August 2016 to use FFUNCTION option, added with version 9)


Create the following FUNCTION

Code: Select all

function GIRFFactor sigma model
type rect   GIRFFactor
type symm   sigma
type model  model
*
compute GIRFFactor=%ddivide(sigma,%sqrt(%xdiag(sigma)))
end
and use FFUNCTION=GIRFFACTOR in either @MonteVAR or @MCVARDODRAWS depending upon whether you want the standard IRF graphs or want to create a different type.
justin
Posts: 3
Joined: Thu Aug 04, 2016 6:31 pm

Re: Impulse response function

Unread post by justin »

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 Cholesky 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.

I assume this only holds true if the errors have a multivariate normal distribution, correct? see footnote 2 http://citeseerx.ist.psu.edu/viewdoc/do ... 1&type=pdf
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Generalized Impulse Responses

Unread post by TomDoan »

No. There are plenty of distributions for which that would still be true (any elliptical distribution for instance). And if it's defined based upon linear projection rather than conditional expectation (since the Wold Decomposition is written in terms of linear projections), it's true regardless of the distribution.
justin
Posts: 3
Joined: Thu Aug 04, 2016 6:31 pm

Re: Generalized Impulse Responses

Unread post by justin »

Thanks Tom. That makes sense. Yet, I find the result not intuitive in the sense that the cholesky decomposition does not depend upon normally (or elliptically) distributed error terms from what I understood. I do not see intuitively why one would get the equivalence result for normally (or elliptically) distributed terms in the generalised impulse responses and not for some other distribution. Is there an intuitive reason for this?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Generalized Impulse Responses

Unread post by TomDoan »

For a general multivariate distribution, the conditional expectation (which is how they're defining this) isn't necessarily conveniently calculated using the covariance matrix. (For instance, the relationship between x and y in the tails could be completely different from the relationship near the means). However, it is if it's elliptical because the joint relationship always looks the same no matter where you are in the marginal.

Again, this isn't an issue for the standard handling of impulse responses and FEVD's because those are based upon linear projections (which depend only upon second moments) rather than conditional expectations (which depend upon the complete distribution function).
bok1234
Posts: 86
Joined: Tue Jan 11, 2011 8:14 pm

Re: Generalized Impulse Responses

Unread post by bok1234 »

Dear Mr.Doan,

I think that I made it. I am gonna tell you the way, then please check it.
1. I did not change anything in the code of @montevar.
2. I just inserted code lines as below into my 'IMPULSES.RPF'.

*** 이하 GIR (GENERALIZED IMPULSE RESPONSES)
function GIRFFactor sigma model
type rect GIRFFactor
type symm sigma
type model model
*
compute GIRFFactor=%ddivide(sigma,%sqrt(%xdiag(sigma)))
end


3. Finally, I inserted 'ffunction=girffactor' into @montevar option as below.
@montevar(draws=4000,model=canmodel,steps=nsteps,$
shocks=implabel,varlabels=implabel,ffunction=girffactor)

Although there was no error message in output window, I am not 100% sure whether I am right or not.
Do you think that my solution is right? If I am right, let me ask one more thing.
If I applied your GIR code to my rpf, the results should be same regardless of ordering of VAR variables.
How can I confirm this? Just by checking the 6 IRF graphs for 6 ordering cases?
Because I have 3 variables, permutation of them is 6, as you know.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Generalized Impulse Responses

Unread post by TomDoan »

Yes. That's correct. If you want to check (you really don't need to) you would just need to do a couple of orderings---there's effectively no way that anything that's independent of ordering would give the same results only for two distincts orderings.
Post Reply