Kilian and Vigfusson (2011)

Use this forum for posting example programs or short bits of sample code.
TR2018
Posts: 9
Joined: Tue Nov 13, 2018 6:18 am

Re: Kilian and Vigfusson (2011)

Unread post by TR2018 »

Dear Tom,
I would like to compare the nonlinear IR from this code with the linear IR.

so, my equations would be

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{1 to p} y{1 to p}
group linearvar xeq yeq lydef ??? does not work.

How can i get the IR from linear bivariate VAR system for the level y?
Thanks in advance
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

If you define LYDEF (which is the same as in the asymmetric VAR), that will work. You can just do an IMPULSE instruction to get the equivalent of the Figure 6---the linear responses aren't dependent upon either the size of the shock or the initial conditions.

Note that you want to include current X in the linear Y equation if you did that in the non-linear model.
TR2018
Posts: 9
Joined: Tue Nov 13, 2018 6:18 am

Re: Kilian and Vigfusson (2011)

Unread post by TR2018 »

Dear Tom,
thank you for the reply,
I would like to compare nonlinear IRs with linear IRs.
so, in order to get IR for the level of y,
my code for the bivariate linear model is

frml(identity) lydef ly = ly{1}+y
set ly dstart hend = 0.0
*******
linreg(define=xeq) x / ux
# constant x{1 to p} y{1 to p}

linreg(define=yeq) y / uy
# constant x{0 to p} y{1 to p}
group symmvar0 xeq yeq lydef
impulse(model=symmvar0,steps=20, results=impulses11)
I get the error ## FO11. Instruction IMPULSE can't handle MODEL with FRMLs.
I think the frml(identity) lydef ly = ly{1}+y is in nonlinear form, so it does not work with impulse command,
any suggestion
Best
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

That works with version 10. It does not work before that. If you don't have version 10, you need to do the LYDEF in EQUATION form.

EQUATION(IDENTITY,COEFFS=||1.0,1.0||) LYDEF LY
# LY{1} Y
ABDHUT123
Posts: 13
Joined: Thu Aug 02, 2018 9:37 am

Re: Kilian and Vigfusson (2011)

Unread post by ABDHUT123 »

how to define xplus = 1 or 3-year net increase in oil price instead of %max(0.0,x)......what are modification I need to do....if we define so....
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

The whole point of K & V is to have a VAR which has asymmetrical effects on positive and negative values of X (hence the definition of XPLUS, which is, by definition, the "plus" part of X, and not just some created variable). If you want to do a completely different model, you will need a different approach for analysis.
ABDHUT123
Posts: 13
Joined: Thu Aug 02, 2018 9:37 am

Re: Kilian and Vigfusson (2011)

Unread post by ABDHUT123 »

I have a question......in this model xplus is a censored variable...calculated as max(0.0,x)...........suppose if I set xplus = z (say an exiting computed censored variable instead of max(0.0,x)).....then, in this case, should I replace all the other max(0.0,x) with xplus or z in the programme??......can you suggest me what are the modifications I need to do?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

It's not "censored". It's perfectly observable. As I said before, the whole point of this is that the model has asymmetric effects for the positive and negative values. There's nothing unknown or unobservable about anything in it. The only technical complication is that the model is non-linear out of sample because of the plus and minus terms. A model with latent variables would have to be analyzed in a completely different way.
ABDHUT123
Posts: 13
Joined: Thu Aug 02, 2018 9:37 am

Re: Kilian and Vigfusson (2011)

Unread post by ABDHUT123 »

Dear Tomdoan......this is from The original "Are the responses of the U.S. economy asymmetric in energy price increases and decreases?" paper.....in their net model they have replaced xplus with xnet which is net increase in oil price from previous 1 year or 3 years high..... I am trying to modify the code based on net increase model.....
Attachments
Oil price NET model.PNG
Oil price NET model.PNG (157.32 KiB) Viewed 26292 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

You can use MVSTATS to compute the maximum value of a series over a certain number of periods. In this MAX4 is the maximum over T-3 to T and MAX12 is the maximum over T-11 to T.

Code: Select all

open data "kvqedata.rat"
calendar(q) 1973:1
data(format=rats,compact=last) 1973:01 2007:4 urate cpi pgas cgas poil gdp
*
set rpoil  = log(poil/cpi)
*
mvstats(max=max4,span=4) rpoil
mvstats(max=max12,span=12) rpoil
ABDHUT123
Posts: 13
Joined: Thu Aug 02, 2018 9:37 am

Re: Kilian and Vigfusson (2011)

Unread post by ABDHUT123 »

Do I need to change the all other parts of the code....for xplus....like frml identify and all other stuffs
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

Isn't the whole point of the paper that using that type of constructed variable is a bad idea?
ABDHUT123
Posts: 13
Joined: Thu Aug 02, 2018 9:37 am

Re: Kilian and Vigfusson (2011)

Unread post by ABDHUT123 »

The idea is to replace xplus with xnet....which is constructed from the same X variable....I wrote an email to the original author Vigfussion sir.... regarding whether the model is correct or not....he said....that not at all wrong....that is what they have exactly done in their net increase model......all the estimation procedure is same....my question is if we define a constructed variable like xnet......do I need to change those identify and all other things for the constructed variable....
tasnim223
Posts: 13
Joined: Sat Apr 07, 2018 12:15 am

Re: Kilian and Vigfusson (2011)

Unread post by tasnim223 »

Dear Tom,

is it possible to test the asymmetry between 1sd positive shock against a 2 sd positive shock.

It would be great if you kindly tell what changes I need to make.

Thanks in advance.

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

Re: Kilian and Vigfusson (2011)

Unread post by TomDoan »

tasnim223 wrote:Dear Tom,

is it possible to test the asymmetry between 1sd positive shock against a 2 sd positive shock.

It would be great if you kindly tell what changes I need to make.

Thanks in advance.

Rosen
I'm not sure what you mean. The IRFTEST program does both 1 and 2 s.d. shocks.
Post Reply