Kilian and Vigfusson (2011)

Use this forum for posting example programs or short bits of sample code.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Kilian and Vigfusson (2011)

Unread post by TomDoan »

This zip has three programs to do the analysis from Kilian and Vigfusson(2011), "Are the responses of the U.S. economy asymmetric in energy price increases and decreases?", Quantitative Economics, vol. 2, no 3, 419-453 which analyzes an an asymmetric VAR

FIGURE6.RPF does the bootstrap calculations in Figure 6. The inner part of the DO I...loop are the calculations for a single "delta". Note that this does a model with a recursive structure, including current energy growth and +'ed energy growth as explanatory variables in the GDP equation so the energy price shock has an impact response on GDP. Note well that the responses are all re-scaled to a common size---due to asymmetry the response to a 10 standard deviation shock will not be 10 times the response to a one-standard deviation shock, but by rescaling, you will get an idea as to the difference in the shape of the response due to the non-linearity.

WALDTEST.RPF does the parametric test statistics for symmetry (bottom line in their Table 2).

IRFTEST.RPF does the test as described in the paper. However, the test is based upon a three layer bootstrapping operation, and is subject to rather considerable simulation error. How many of each layer of the bootstrap are needed for more reliable results is an open question.

kilianvigfusson_qe2011.zip
unitroot
Posts: 6
Joined: Thu Oct 02, 2014 5:50 pm

Re: Kilian and Vigfusson (2011)

Unread post by unitroot »

Thank you very much for this generous help Dr. Doan. I am still learning RATS syntax. So, would be really grateful if you Could please clarify the following doubts:

1. What's the purpose of the lines "dec vector scales" and "compute scales ||1.0, 2.0, 4.0, 10.0||"? What do the vertical bars do in this context?
2. If I were to modify this code for a threshold error correction model, would I just add those explanatory variables to the LINREG command?

Regards,
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

Have you read the paper?

Because the model is non-linear, the effects of shocks of different sizes aren't simple scale-ups of other sizes. They look at 1, 2, 4 and 10 standard deviation shocks. ||....|| is for in-line matrices---see page Int-90 in the Introduction.

A threshold VECM model requires a different set of identities to map the X and Y simulated values to the dX, dY and threshold variables that would be needed. Anything that you put into the regressions other than the original X and Y needs to have a definitional identity.
albeta456
Posts: 5
Joined: Sun Sep 28, 2014 3:20 pm

Re: Kilian and Vigfusson (2011)

Unread post by albeta456 »

How can I change the program codes to obtain the response of GDP to a NEGATIVE energy price shock (instead of positive shock)? I tried to change the code "set xplus = %max(0.0, x)" to "set xplus = %min(0.0, x)". But the results are wrong.

Thanks.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

albeta456 wrote:How can I change the program codes to obtain the response of GDP to a NEGATIVE energy price shock (instead of positive shock)? I tried to change the code "set xplus = %max(0.0, x)" to "set xplus = %min(0.0, x)". But the results are wrong.

Thanks.
All you need to do is change the sign of the delta variable.
albeta456
Posts: 5
Joined: Sun Sep 28, 2014 3:20 pm

Re: Kilian and Vigfusson (2011)

Unread post by albeta456 »

Do you mean just adding a negative sign into this codoe: compute delta=-scales(i)*sigmax ? Nothing else?
No need to change: frml xplusdef xplus = %max(0.0,x)? Then the shocks are still positive shocks, not the negative shocks that I want.

Thank you very much for your help.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

Correct. The XPLUS is to give the desired non-linear behavior. The delta is what determines the shock being evaluated.
ManfredE
Posts: 6
Joined: Tue May 24, 2016 10:44 am

Re: Kilian and Vigfusson (2011)

Unread post by ManfredE »

Dear Mr. Doan, I’ve been working to test whether there are asymmetries in the pass through from commodities to domestic prices. I’m using what is proposed in Kilian & Vigfusson(2011) Are the responses of the U.S. economy asymmetric in energy price increases and decreases? Quantitative Economics, vol. 2, no 3, 419-453 and the codes that were posted in this forum to replicate some results of that paper. I’ve made small changes to the code in order to get the empirical impulse response (IR) to negative shocks and also to get percentiles of the bootstrapped IR as a way to compute confidence intervals. So long everything seems to work right, I just have two doubts on the code that reproduces Figures 6 of the paper. Specifically, when the command “Forecast” is used with the option “paths”. As I understand, the supplementary card that have to be used with this option must contain series with the desired paths of each variable of the model. If this were the case, and since the model has been declared as a group with 4 variables, the supplementary card should contain 4 series. But the supplementary card contain only 3 series. Fist I thought that this was due to the fact that the last two variables are generated by the “frml” command and so it was not necessary to provide a series for the forecast, but then that will leave only two variables to have an associated series in the supplementary card. In the posted code the supplementary card contains 3 series, as I see it the first one is the path of the X series (the one that will be shocked), the second one is a series of zeros (which I don't understad which varible of the model stands for) and the third one seems to be a path of the Y series.

To sum up, my doubts are two: 1) when using the “forecast” command with the option “paths”, Is it necessary to provide a series for EACH of the variables in the model? If this is the case, does the order of those series in the supplementary card follow the same order of the model? If this is the case, does the order of the series in the supplementary card have follow the same order in which the variables are listed in the model? 2) To which variable of the model corresponds the series “zeros” in the supplementary card?

Thanks in advance for your help.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

The fourth equation is an identity, and so has no shocks. The second actually is also a true identity, but because it defines XPLUS whose current value is used in the Y equation, placing it second allows the model to be solved by direct substitution rather than by simultaneous methods. That's why the shocks to the second equation are a series of all zeros.
ManfredE
Posts: 6
Joined: Tue May 24, 2016 10:44 am

Re: Kilian and Vigfusson (2011)

Unread post by ManfredE »

TomDoan wrote:The fourth equation is an identity, and so has no shocks. The second actually is also a true identity, but because it defines XPLUS whose current value is used in the Y equation, placing it second allows the model to be solved by direct substitution rather than by simultaneous methods. That's why the shocks to the second equation are a series of all zeros.
Thank you Mr. Doan. I think I was confused because in the RATS Reference Manual it is stated that one can put an “ * ” on the supplementary card for an equation whose shocks are wanted to be zero. Then it must be the case that by using a series of all zeros the posted code achieves the same thing as if one just put a “ * “ in the second series of the supplementary card.
mightydell37
Posts: 17
Joined: Fri Oct 10, 2014 2:13 am

Re: Kilian and Vigfusson (2011)

Unread post by mightydell37 »

Hi Tom,

How different is the Killian & Vigfusson (2011) to that of Balke (2000). Thank you.

TomDoan wrote:The attached zip has three programs.

FIGURE6.RPF does the bootstrap calculations in Figure 6. The inner part of the DO I...loop are the calculations for a single "delta". Note that this does a model with a recursive structure, including current energy growth and +'ed energy growth as explanatory variables in the GDP equation so the energy price shock has an impact response on GDP.

IRFTEST.RPF does, so far as I can tell, the test as described in the paper. I'm not sure why the results don't match as closely with the published results as one would expect---the K-V code has so many options (obviously from the experimental stage) that it's hard to figure out exactly what is happening with it.
kilianvigfusson_qe2011.zip
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

They're completely different (other than both being bootstraps). Balke is a threshold VAR, that is, the entire VAR changes based upon the threshold criterion. K and V is an asymmetric VAR, which has a single equation for each dependent variable, but with different lag coefficients for positive and negative values. The basic bootstrap in K&V isn't very complicated---what's complicated is the bootstrap within bootstrap to correct for bias. The threshold VAR bootstrap is quite a bit more complicated by its nature.
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: Kilian and Vigfusson (2011)

Unread post by Jules89 »

Hello everybody,

just for clarification. The residuals in the Kilian and Vigfusson (2011) code,

Code: Select all


linreg(define=xeq) x / ux
# constant x{1 to p} y{1 to p}
compute sigmax=sqrt(%sigmasq)
*
linreg(define=yeq) y / uy
# constant x{0 to p} y{1 to p} xplus{0 to p}

, ux and uy, are structural residuals, which are equivalent to residuals estimated from a recursively identified VAR, but do not equal Cholesky identified shocks, right?

Best Jules
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

They would be identical to the Cholesky shocks (in the x,y VAR) if the xplus{0 to p} weren't in the second equation.
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: Kilian and Vigfusson (2011)

Unread post by Jules89 »

Thanks Tom,

so the contemporaneous impact matrix would be

1 0
x 1

making it a recursive model on the endogenous (without xplus, in the sense that xplus does not have its own equation) variables of the system, right?

Best Jules
Post Reply