Page 1 of 1

Impulse Responses

Posted: Sat Aug 07, 2010 7:32 am
by Shenelle
I am analysing the financial linkages between the US and Trinidad and Tobago(TT) using a Near VAR model
This model assumes that US variables affect TT variables but not vice versa.
Below is the code used to get the VAR, variance decompositions, impulse responses and impulse response graphs.
Now I am trying to decompose the responses into 3 channels, trade, direct and indirect.
The trade channel says that tighter financial conditions in the US (measured through rgrus-interest rates), would slow the US economy(RGDPGUS - real GDP growth),
thereby reducing US imports from TT and thus leading to a reduction in TT output growth (RGDPTT).
The indirect channel says that a tightening of RGRUS leads to a change in RGRTT, thus leading to a change in RGDPTT
and the indirect channel says that a tightening in RGRUS leads to a reduction in RGDPTT.
How do I isolate these financial conditions.
For example, If I want to shut down the trade channel by holding US growth constant or by setting to zero the coefficients of TT variables on contemporaneous and lagged US growth.

Code: Select all

equation infuseq rginfus
# constant  rginfus{1 to 4} rgdpgus{1 to 4} rgrus{1 to 4}


equation gdpuseq rgdpgus
# constant  rginfus{1 to 4} rgdpgus{1 to 4} rgrus{1 to 4}

equation rgruseq rgrus
# constant rginfus{1 to 4} rgdpgus{1 to 4} rgrus{1 to 4}


equation infeq rginf
# constant  rginf{1 to 4} rgdpg{1 to 4} rgr{1 to 4} rginfus{1 to 4}  rgdpgus{1 to 4}  rgrus{1 to 4}

equation gdpeq rgdpg
# constant rginf{1 to 4} rgdpg{1 to 4} rgr{1 to 4} rginfus{1 to 4} rgdpgus{1 to 4} rgrus{1 to 4}


equation rgreq rgr
# constant rginf{1 to 4} rgdpg{1 to 4} rgr{1 to 4} rginfus{1 to 4} rgdpgus{1 to 4} rgrus{1 to 4}



system infuseq gdpuseq rgruseq infeq  gdpeq  rgreq
end(system)
SUR(outsigma=v) 6 1991:1  2009:4
#infuseq ; #gdpuseq ; #rgruseq ; #infeq ; #gdpeq ; #rgreq

compute aic = %nobs*%logdet+2*(3*25+3*13)
compute sbc = %nobs*%logdet+2*(3*25+3*13)*log(%nobs)
dis 'aic=' aic 'sbc=' sbc

GROUP shocks infuseq gdpuseq  rgruseq infeq gdpeq rgreq
ERRORS(MODEL=SHOCKS,STEPS=20,RESULT=DECOMPOSITION)

IMPULSE(MODEL=SHOCKS,STEPS=20,RESULT=RESPONSES)



*****************GRAPH OF IMPULSE RESPONSES NEW PAPER
* MONTESUR.RPF
* Uses Gibbs sampling to analyze the impulse response functions for a
* near-VAR.
*
compute lags=4			   ;*Number of lags
compute steps=20		   ;*Number of response steps
compute nburn =5000		;*Burn-in draws
compute ndraws=25000		;*Keeper draws
*

compute nvar=%modelsize(shocks)

@SURGibbsSetup shocks
sur(model=shocks)
compute ntotal=%nreg
compute bdraw=%beta
compute wishdof=%nobs

declare vect[rect] %%responses(ndraws)
*
infobox(action=define,progress,lower=-nburn,upper=ndraws) $
    "Gibbs Sampling"
do draw=-nburn,ndraws

 compute covmat=SURGibbsSigma(bdraw)

   *
   compute hdraw=%ranwishartf(%decomp(inv(covmat)),wishdof)

   @SURGibbsDataInfo hdraw hdata hbdata

  compute hpost=hdata
   compute vpost=inv(hpost)
   compute bpost=vpost*hbdata
   compute bdraw=bpost+%ranmvnormal(%decomp(vpost))
   infobox(current=draw)
   if draw<=0
      next

   compute %modelsetcoeffs(shocks,bdraw)
   impulse(noprint,model=shocks,factor=%decomp(hdraw),results=impulses,steps=steps)

 dim %%responses(draw)(nvar*nvar,steps)
   ewise %%responses(draw)(i,j)=ix=%vec(%xt(impulses,j)),ix(i)
end do draw
infobox(action=remove)
source mcgraphirf
@MCGraphIRF(model=shocks,center=median,page=one,percentile=||.05,.95||,HEADER="IMPULSE RESPONSES")

Re: Impulse Responses

Posted: Sat Aug 07, 2010 2:49 pm
by TomDoan
Shenelle wrote:I am analysing the financial linkages between the US and Trinidad and Tobago(TT) using a Near VAR model
This model assumes that US variables affect TT variables but not vice versa.
Below is the code used to get the VAR, variance decompositions, impulse responses and impulse response graphs.
Now I am trying to decompose the responses into 3 channels, trade, direct and indirect.
The trade channel says that tighter financial conditions in the US (measured through rgrus-interest rates), would slow the US economy(RGDPGUS - real GDP growth),
thereby reducing US imports from TT and thus leading to a reduction in TT output growth (RGDPTT).
The indirect channel says that a tightening of RGRUS leads to a change in RGRTT, thus leading to a change in RGDPTT
and the indirect channel says that a tightening in RGRUS leads to a reduction in RGDPTT.
How do I isolate these financial conditions.
For example, If I want to shut down the trade channel by holding US growth constant or by setting to zero the coefficients of TT variables on contemporaneous and lagged US growth.
There really isn't a good way to do that with a fairly general VAR. Controlling shocks is relatively easy (the HISTORY instruction lets you see what happens when you shut down shocks), but controlling the endogenous variables isn't, since the future endogenous variables are the sum of the shocks across both time and variables. The closest thing to what you want is conditional forecasting (see the User's Guide), which works exactly the same way for a near-VAR as it does for a VAR.

What probably makes more sense it to try to form your restrictions into a state-space model. With that, you can have more shocks (once you include measurement errors) than with a VAR, so you can more tightly restrict the behavior of some of the shocks.