Rolling Bivariate VAR
Posted: Fri Aug 19, 2011 7:45 am
Hello,
I am trying to run a rolling bi-variate VAR regression as in Blanchard and Gali (2008): The Macroeconomic Effects Of Oil Price Shocks: Why Are The 2000s So Different From The 1970s?
I would like to obtain the graph of Impulse Response Functions in particular the effect of shocks oil prices on the real effective exchange rate as they evolve and I came up with the following code. However each time I run the code I get an error message that "ROLLIN is not defined in freeze (roliin) var.impulse(12, se=a) op @ cexr @ op cexr ". I would like help in this regard.
' =====================================================================
' SETUP
' =====================================================================
wfcreate(wf=r:\wts\mywork\period\period10) q 1975q1 2010q4 ' creates new WF
read(b2,s=rollreg) r:\wts\mywork\period\data.xls can_reec oilp_wti can_ngdp nor_reec nor_ngdp ' imports data from XLS
scalar window = 124 ' for 5 year data
genr l_oilp = log(oilp_wti) 'log of oil prices
genr oilp = d (l_oilp) 'log difference of oil prices
' =====================================================================
' CANADA
' =====================================================================
genr l_can_reec = log(can_reec) 'log of real effective exchange rate
genr cexr = d (l_can_reec) 'log difference of real effective exchange rate
genr l_can_ngdp = log(can_ngdp) 'log of Canandian Gross Domestic Product
genr cy = d (l_can_ngdp) 'log difference of Candian output
for !i = 1 to window
smpl 1975q1+!i 1979q4+!i
series op = oilp ' specification for OIL
series cexr = can_reec ' specification for EXCHANGE RATE
' VAR estimation
' -----------------------
var var.ls 1 2 op cexr
freeze (roliin) var.impulse(12, se=a) op @ cexr @ op cexr
var.makeresids error_op error_cexr
''VAR diagnostics
' ------------------------
freeze(Q_CAN_{!i}) var.qstats(8) ' a test for serial correlation
freeze(JB_CAN_{!i}) var.jbera(factor=chol) ' a test for normality
freeze(W_CAN_{!i}) var.white ' a test for heteroskedasticity
next
I am trying to run a rolling bi-variate VAR regression as in Blanchard and Gali (2008): The Macroeconomic Effects Of Oil Price Shocks: Why Are The 2000s So Different From The 1970s?
I would like to obtain the graph of Impulse Response Functions in particular the effect of shocks oil prices on the real effective exchange rate as they evolve and I came up with the following code. However each time I run the code I get an error message that "ROLLIN is not defined in freeze (roliin) var.impulse(12, se=a) op @ cexr @ op cexr ". I would like help in this regard.
' =====================================================================
' SETUP
' =====================================================================
wfcreate(wf=r:\wts\mywork\period\period10) q 1975q1 2010q4 ' creates new WF
read(b2,s=rollreg) r:\wts\mywork\period\data.xls can_reec oilp_wti can_ngdp nor_reec nor_ngdp ' imports data from XLS
scalar window = 124 ' for 5 year data
genr l_oilp = log(oilp_wti) 'log of oil prices
genr oilp = d (l_oilp) 'log difference of oil prices
' =====================================================================
' CANADA
' =====================================================================
genr l_can_reec = log(can_reec) 'log of real effective exchange rate
genr cexr = d (l_can_reec) 'log difference of real effective exchange rate
genr l_can_ngdp = log(can_ngdp) 'log of Canandian Gross Domestic Product
genr cy = d (l_can_ngdp) 'log difference of Candian output
for !i = 1 to window
smpl 1975q1+!i 1979q4+!i
series op = oilp ' specification for OIL
series cexr = can_reec ' specification for EXCHANGE RATE
' VAR estimation
' -----------------------
var var.ls 1 2 op cexr
freeze (roliin) var.impulse(12, se=a) op @ cexr @ op cexr
var.makeresids error_op error_cexr
''VAR diagnostics
' ------------------------
freeze(Q_CAN_{!i}) var.qstats(8) ' a test for serial correlation
freeze(JB_CAN_{!i}) var.jbera(factor=chol) ' a test for normality
freeze(W_CAN_{!i}) var.white ' a test for heteroskedasticity
next