Impulse Responses
Posted: Sat Aug 07, 2010 7:32 am
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.
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")