Page 5 of 6

Re: Kilian and Vigfusson (2011)

Posted: Sat Sep 12, 2020 11:46 am
by TomDoan
You can certainly do something like that---one great advantage of the KV type of model is that the estimation can be done quite simply since the explanatory variables are all observable functions of the data. One problem you would have is that maxGDP and GDP differ only for a relatively small number of observations.

Re: Kilian and Vigfusson (2011)

Posted: Sun Sep 13, 2020 8:40 am
by cancla
TomDoan wrote:You can certainly do something like that---one great advantage of the KV type of model is that the estimation can be done quite simply since the explanatory variables are all observable functions of the data. One problem you would have is that maxGDP and GDP differ only for a relatively small number of observations.
Thank you. I'm going to change the code and will update you. I do have some doubts on the part concerning the "definitional identities". If I construct the variable outside RATS and estimate the model in levels, then do I need those identities?

Re: Kilian and Vigfusson (2011)

Posted: Sun Sep 13, 2020 12:35 pm
by TomDoan
The definitional identities are needed for doing any out-of-sample calculations (forecasts; impulse responses, etc.). Before you worry about those, you need to see whether you can come up with some transformation(s) of the lagged variables that give you a better fit than a simple VAR.

Re: Kilian and Vigfusson (2011)

Posted: Mon Sep 14, 2020 5:07 am
by cancla
TomDoan wrote:Before you worry about those, you need to see whether you can come up with some transformation(s) of the lagged variables that give you a better fit than a simple VAR.
Thank for the advice. Now, I'll try to estimate a simple VAR in levels even though it could have some problems.
TomDoan wrote:The definitional identities are needed for doing any out-of-sample calculations (forecasts; impulse responses, etc.).
Here comes part of my problems.
I'm interested in the relationship between GDP and Consumption. I thought that we could consider the variable XPLUS as the partial sum of X, meaning that if X is the GDP (in logs) than XPLUS is the (partial) summation of %max(0.0, dGDP). To obtain this summation I use the ACCUMULATE instruction in RATS. However, I do not really know how to enter it in the definitional identities for XPLUS (I suppose that for consumption, = Y in the model, the identity is simply cons = log(consumption) or it can even be omitted).

Here I attach the initial part of the code in which I define the variables so the previous lines may be better understood.

Code: Select all

end(reset)
*
* DATA IMPORT AND MANIPULATION
*
open data usa_quart.xlsx
*
calendar(q) 1947:1
*
data(format=xlsx,org=columns,sheet="Sheet1") 1947:01 2019:4 income consumption
*
set yd = log(income)
set cons  = log(consumption)
*
set dyd = yd-yd{1}
set dydplus = %max(0.0,dyd)
*
set x = yd
set y = cons
*
* MAKING PARTIAL SUM
accum dydplus / xplus
*
* DEFINITIONAL IDENTITIES
*
frml xplusdef ... ?


Re: Kilian and Vigfusson (2011)

Posted: Mon Oct 26, 2020 1:32 am
by tasnim223
Dear Tom,

Hope you are fine. Here you have used the mork transformation. How do I use the other two transformations used in this paper. Also , it will be really great if you show how to change the identity. for these transformations..

Many thanks

Tasnim

Re: Kilian and Vigfusson (2011)

Posted: Mon Oct 26, 2020 1:48 pm
by tasnim223
Dear Tom,

I want to use the following conversion;x+net ,

"where x+net = max[0, x − x* ] and x* is the maximum of x over the t
preceding year (or 3 years, alternatively), following Hamilton (1996, 2003)."

I have done the following ;

mvstats(max=max12,span=12) ro

set y = ro-max12

set xnet = %max(0.0,y)
However, for xnet I get all 0 values.
It would be great if you tell me where I went wrong
Thanks..
Best wishes,
Tasnim

Re: Kilian and Vigfusson (2011)

Posted: Wed Oct 28, 2020 11:45 am
by TomDoan
For that to make sense, x*(t) would have to be the max over t-1 to t-12. MVSTATS will give you the max over t to t-11 (that is, it includes the current entry in the range). So you need to shift that backwards:

set y = ro-max12{1}

Re: Kilian and Vigfusson (2011)

Posted: Fri May 28, 2021 3:19 am
by Sanjiv Kumar
Hi all

I am sorry for the late discussion. I have one doubt about the provided codes for Kilian & Vigfusson(2011). When I downloaded the code and ran it. The file filefig6 shows that these codes are the Generation of figure 6 (non-linear IRF's with different sized shocks). However, these codes show figure 5 of the paper, but the code claim that it is for figure 6.

second doubt: files of irftest which title claim Generation of table 3 (GDP columns) does not match with results in the paper? any suggestions or clarification on that?

Re: Kilian and Vigfusson (2011)

Posted: Sun May 30, 2021 11:37 am
by TomDoan
Sanjiv Kumar wrote:Hi all

I am sorry for the late discussion. I have one doubt about the provided codes for Kilian & Vigfusson(2011). When I downloaded the code and ran it. The file filefig6 shows that these codes are the Generation of figure 6 (non-linear IRF's with different sized shocks). However, these codes show figure 5 of the paper, but the code claim that it is for figure 6.
I was working off the working paper version of the paper, but unless the figures changed in the published paper, our Figure 6 program does Figure 6.
Sanjiv Kumar wrote: second doubt: files of irftest which title claim Generation of table 3 (GDP columns) does not match with results in the paper? any suggestions or clarification on that?
As described in the initial post, "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."

Re: Kilian and Vigfusson (2011)

Posted: Mon May 31, 2021 6:57 am
by Sanjiv Kumar
Hi Tom,
Thank you for your prompt reply. I really appreciate your efforts. I have some queries; if you could address these issues on the RATS forum, that would be really useful for me and well RATS users. I am hoping for a response.
Thank you so much in advance.

First, the provided IRF test and slope-based test for checking symmetric bivariate test only? (Just want to clarify this point, thanks) If not, then if we have a four-variable model, do we need to generalize the RATS codes accordingly?

Second, the provided IRF test code for GDP is 1-SD shock and 2-SD shock only; if I want to include 3-SD shock as well, in that scenario, what changes am I supposed to make? For instance, (Ülke and Berumentn, 2016) have included 3- SD shock as well and got better results; that is the reason I have this question.

Does while writing VAR codes, ordering matter in RATS? If YES, then

Third, I want to use Cholesky decomposition in that set-up the ordering of the variables is important. In this situation, how do we ensure the ordering of the variable while setting the code in RATS?
For instance, I want to assess the effects of change in the oil price (POIL) on GDP, but rather than including only two variables or a bivariate model, I want to incorporate CPI and URATE as an extra variable. So in my model, there are four variables.
Let suppose theoretically identified ordering of the variable is (POIL, GDP, CPI, URATE) (just for an example). In this case, How do we write code in RATE according to the ordering of the variable? Ülke and Berumentn (2016) talk about Cholesky decomposition ordering of the variable; therefore, this issue arises.

Finally, is there any way to incorporate dummies for the financial crisis or COVID-19 crisis?

Attaching a generalized four variable code for your reference, if you could suggest anything, would be a great help.

Re: Kilian and Vigfusson (2011)

Posted: Wed Sep 20, 2023 3:32 am
by TR2018
Hello tom,
ı would like to ask you a question about how to add dummy in code for figure6.
thanks in advance

Re: Kilian and Vigfusson (2011)

Posted: Wed Sep 20, 2023 8:25 am
by TomDoan
Just add the dummy into the two equations:
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}

Re: Kilian and Vigfusson (2011)

Posted: Wed Sep 20, 2023 9:20 am
by TR2018
Hi tom,
if i add dummy ı have to modify the bootstarping and forecsating part
ı tried several things, but didnt work.
ı guess ı have to add dummy with group command, and in forcast part some path?
ı really appreciate any help for dummy part

Re: Kilian and Vigfusson (2011)

Posted: Wed Sep 20, 2023 10:12 am
by TomDoan
You just need to extend the dummy out beyond the end of the data (since the IRF calculations need to extend out there). For instance:

set dummy * %allocend()+h = t>=2000:1

Re: Kilian and Vigfusson (2011)

Posted: Thu Sep 21, 2023 1:48 am
by TR2018
Thank you Tom,
I am going to try.