Page 1 of 1

Interpretation of TVAR results

Posted: Wed Nov 23, 2011 5:07 pm
by nazif
Dear Doan,

I am planning to measure the asymmetric effects of oil prices on output using a simple two-regime TVAR model. For this purpose I wrote the following code. In order to split my sample according to two different oil price change periods, i.e. increases and decreases, I used NOPI (net oil price increase) variable in the seminal paper of Hamilton (2003). But I have a problem with interpreting the results. Is it possible to interpret the responses of output to positive oil shocks as negative when the oil prices are below the threshold level (NOPIN<0.0) ? Or can I changed flipper2=||1.0,1.0,1.0,1.0,1.0|| with flipper2=||1.0,-1.0,1.0,1.0,1.0|| in order to get negative shocks?

Thanks for your help.

Code: Select all

open data oil_output_rats_6.xls
calendar(m) 1988
data(format=xls,org=columns) 1988:1 2011:3
table
@VARLagSelect(lags=13,crit=aic)
# DLNER DLROIL DLWPI DINTRATE DLGDP
compute  nsteps = 36
compute  p = 4
*
****
set low =  NOPIN<0.0
set high = NOPIN>=0.0

graph(shading=high) 1
# Dlroil

system(model=poilmodel)
variables DLNER DLrOIL  DLWPI DINTRATE DLGDP
lags 1 to p
det constant DFFR DLINDUS
end(system)
estimate(resids=varresids, smpl=high)
*
dec frml[rect] bfrml
nonlin cr1 rf1 rf2 uf1 uf2 uf3 tf1 tf2 tf3 tf4
frml  bfrml = ||1.0,0.0,0.0,0.0,0.0|$
                cr1,1.0,0.0,0.0,0.0|$
        			 rf1,rf2,1.0,0.0,0.0|$
					 uf1,uf2,uf3,1.0,0.0|$
					 tf1,tf2,tf3,tf4,1.0||

compute cr1=rf1=rf2=uf1=uf2=uf3=tf1=tf2=tf3=tf4=0.0
cvmodel(b=bfrml,method=bfgs,pmethod=genetic,factor=bfactorhigh) %sigma
compute flipper1=||1.0,1.0,1.0,1.0,1.0||
compute f1_1=bfactorhigh*%diag(flipper1)
impulse(model=poilmodel,factor=f1_1, window="Impulse Responses", steps=nsteps, result=impulseshigh)

***** IRF's************
* responses to LRER *****************
set rer_high1 1 36 = impulseshigh(1,1)
set rer_high2 1 36 = impulseshigh(2,1)
set rer_high3 1 36 = impulseshigh(3,1)
set rer_high4 1 36 = impulseshigh(4,1)
set rer_high5 1 36 = impulseshigh(5,1)


* responses to LCoil***********
set coil_high1 1 36 = impulseshigh(1,2)
set coil_high2 1 36 = impulseshigh(2,2)
set coil_high3 1 36 = impulseshigh(3,2)
set coil_high4 1 36 = impulseshigh(4,2)
set coil_high5 1 36 = impulseshigh(5,2)

* responses to LWPI
set wpi_high1 1 36 = impulseshigh(1,3)
set wpi_high2 1 36 = impulseshigh(2,3)
set wpi_high3 1 36 = impulseshigh(3,3)
set wpi_high4 1 36 = impulseshigh(4,3)
set wpi_high5 1 36 = impulseshigh(5,3)

* responses to int
set int_high1 1 36 = impulseshigh(1,4)
set int_high2 1 36 = impulseshigh(2,4)
set int_high3 1 36 = impulseshigh(3,4)
set int_high4 1 36 = impulseshigh(4,4)
set int_high5 1 36 = impulseshigh(5,4)

* responses to gdp
set gdp_high1 1 36 = impulseshigh(1,5)
set gdp_high2 1 36 = impulseshigh(2,5)
set gdp_high3 1 36 = impulseshigh(3,5)
set gdp_high4 1 36 = impulseshigh(4,5)
set gdp_high5 1 36 = impulseshigh(5,5)


***************************
system(model=poilmodel1)
variables  DLNER DLrOIL  DLWPI DINTRATE DLGDP
lags 1 to p
det constant DFFR DLINDUS
end(system)
estimate(resids=varresids, smpl=low)
impulse(model=poilmodel1,window="Impulse Responses(LOW)", steps=nsteps)
*
dec frml[rect] bfrml
nonlin cr1 rf1 rf2 uf1 uf2 uf3 tf1 tf2 tf3 tf4 af1
frml  bfrml = ||1.0,0.0,af1,0.0,0.0|$
                cr1,1.0,0.0,0.0,0.0|$
        			 rf1,rf2,1.0,0.0,0.0|$
					 uf1,uf2,uf3,1.0,0.0|$
					 tf1,tf2,tf3,tf4,1.0||


compute cr1=rf1=rf2=uf1=uf2=uf3=tf1=tf2=tf3=tf4=af1=0.0
cvmodel(b=bfrml,method=bfgs,pmethod=genetic,factor=bfactorlow) %sigma
compute flipper2=||1.0,1.0,1.0,1.0,1.0||
compute f1_2=bfactorlow*%diag(flipper2)
impulse(model=poilmodel1,factor=f1_2, window="Impulse Responses", steps=nsteps, result=impulseslow)
***** IRF's************

* responses to LRER
set rer_low1 1 36 = impulseslow(1,1)
set rer_low2 1 36 = impulseslow(2,1)
set rer_low3 1 36 = impulseslow(3,1)
set rer_low4 1 36 = impulseslow(4,1)
set rer_low5 1 36 = impulseslow(5,1)

* responses to LCOILPPI
set coil_low1 1 36 = impulseslow(1,2)
set coil_low2 1 36 = impulseslow(2,2)
set coil_low3 1 36 = impulseslow(3,2)
set coil_low4 1 36 = impulseslow(4,2)
set coil_low5 1 36 = impulseslow(5,2)

* responses to LWPI
set wpi_low1 1 36 = impulseslow(1,3)
set wpi_low2 1 36 = impulseslow(2,3)
set wpi_low3 1 36 = impulseslow(3,3)
set wpi_low4 1 36 = impulseslow(4,3)
set wpi_low5 1 36 = impulseslow(5,3)


* responses to intrate
set int_low1 1 36 = impulseslow(1,4)
set int_low2 1 36 = impulseslow(2,4)
set int_low3 1 36 = impulseslow(3,4)
set int_low4 1 36 = impulseslow(4,4)
set int_low5 1 36 = impulseslow(5,4)

* responses to GDP
set gdp_low1 1 36 = impulseslow(1,5)
set gdp_low2 1 36 = impulseslow(2,5)
set gdp_low3 1 36 = impulseslow(3,5)
set gdp_low4 1 36 = impulseslow(4,5)
set gdp_low5 1 36 = impulseslow(5,5)

******Accumulated Responses
****Crude Oil*********
****low*******
accumulate coil_low1 / coil_low1
accumulate coil_low2 / coil_low2
accumulate coil_low3 / coil_low3
accumulate coil_low4 / coil_low4
accumulate coil_low5 / coil_low5
****high*****
accumulate coil_high1 / coil_high1
accumulate coil_high2 / coil_high2
accumulate coil_high3 / coil_high3
accumulate coil_high4 / coil_high4
accumulate coil_high5 / coil_high5

*********Exchange Rate********
*******low*******
accumulate rer_low1 / rer_low1
accumulate rer_low2 / rer_low2
accumulate rer_low3 / rer_low3
accumulate rer_low4 / rer_low4
accumulate rer_low5 / rer_low5
*******high******
accumulate rer_high1 / rer_high1
accumulate rer_high2 / rer_high2
accumulate rer_high3 / rer_high3
accumulate rer_high4 / rer_high4
accumulate rer_high5 / rer_high5
*******WPI***********
* low
accumulate wpi_low1 / wpi_low1
accumulate wpi_low2 / wpi_low2
accumulate wpi_low3 / wpi_low3
accumulate wpi_low4 / wpi_low4
accumulate wpi_low5 / wpi_low5
* high
accumulate wpi_high1 / wpi_high1
accumulate wpi_high2 / wpi_high2
accumulate wpi_high3 / wpi_high3
accumulate wpi_high4 / wpi_high4
accumulate wpi_high5 / wpi_high5

****intrate**************
*low
accumulate int_low1 / int_low1
accumulate int_low2 / int_low2
accumulate int_low3 / int_low3
accumulate int_low4 / int_low4
accumulate int_low5 / int_low5

*high
accumulate int_high1 / int_high1
accumulate int_high2 / int_high2
accumulate int_high3 / int_high3
accumulate int_high4 / int_high4
accumulate int_high5 / int_high5




com implabels = || 'Positive', 'Negative'||

********responses to oil shocks LRER LCOILPPI LWPI INTRATE LGDP*********
grparm header 20
****responses to whosale crude oil prices****************
spgraph(hfields = 3,vfields = 2, header = "Responses to Crude Oil Price Shocks")
graph(nodate,key=below, patterns, header= "GDP", klabels=implabels) 2
# coil_high5
# coil_low5
graph(nodate,key=below, patterns, header= "Interest Rate", klabels=implabels) 2
# coil_high4
# coil_low4
graph(nodate,key=below, patterns, header= "WPI", klabels=implabels) 2
# coil_high3
# coil_low3
graph(nodate,key=below, patterns, header= "Crude Oil Price", klabels=implabels) 2
# coil_high2
# coil_low2
graph(nodate,key=below, patterns, header= "Real Exchange Rate", klabels=implabels) 2
# coil_high1
# coil_low1
spgraph(done)
**********************
spgraph(hfields = 3,vfields = 2, header = "Responses to Exchange Rate Shocks")
graph(nodate,key=below, patterns, header= "GDP", klabels=implabels) 2
# rer_high5
# rer_low5
graph(nodate,key=below, patterns, header= "Interest Rate", klabels=implabels) 2
# rer_high4
# rer_low4
graph(nodate,key=below, patterns, header= "WPI", klabels=implabels) 2
# rer_high3
# rer_low3
graph(nodate,key=below, patterns, header= "Crude Oil Price", klabels=implabels) 2
# rer_high2
# rer_low2
graph(nodate,key=below, patterns, header= "Real Exchange Rate", klabels=implabels) 2
# rer_high1
# rer_low1
spgraph(done)
*
spgraph(hfields = 3,vfields = 2, header = "Responses to WPI Shocks")
graph(nodate,key=below, patterns, header= "GDP", klabels=implabels) 2
# wpi_high5
# wpi_low5
graph(nodate,key=below, patterns, header= "Interest Rate", klabels=implabels) 2
# wpi_high4
# wpi_low4
graph(nodate,key=below, patterns, header= "WPI", klabels=implabels) 2
# wpi_high3
# wpi_low3
graph(nodate,key=below, patterns, header= "Crude Oil Price", klabels=implabels) 2
# wpi_high2
# wpi_low2
graph(nodate,key=below, patterns, header= "Real Exchange Rate", klabels=implabels) 2
# wpi_high1
# wpi_low1
spgraph(done)
*

Re: Interpretation of TVAR results

Posted: Wed Nov 30, 2011 2:55 pm
by TomDoan
You can change the sign of a shock to make one impact response have the sign that you want. In the case of a Cholesky factorization (which is what you have as it's written), that naturally is a positive own response, so you don't do anything. If you do what you propose, you don't have the response of GDP and the other variables to a positive oil shock--you've converted that to a negative oil shock.