In a comment on my post yesterday, "psummers" kindly pointed out that the free econometrics package, gretl, will also produce confidence intervals for Impulse Response Functions (IRFs) generated by a VECM.
I had an earlier post about gretl, and here is a very brief run-down on using it to produce those VECM-IRF confidence intervals.
After starting up the package, I selected "File" / "Open Data" / "Sample File", and chose Johansen's Danish macroeconomic data:
As you can see, I chose all 4 of the variables as "endogenous", so I'll have a 4-equation VECM:
(etc.)
Then I chose "Analysis" / "Impulse Responses":
(etc.)
Then, here's the crucial bit - to get the confidence intervals for the IRF's I chose "Graphs" / "Response of LRM to LRY" (for example), and checked the "include bootstrap confidence interval" box:
Et voilĂ !
I like this even more than JMulTi! Thanks again, "psummers".
And isn't this a terrific example of two packages that are free, providing us with results that we can't get from a commercial package, such as EViews?
p.s.: "Ben" please note - there's no "-0.0" label on the vertical axis of the last graph!
© 2011, David E. Giles
Ben: thanks for the earlier comment ;-)
ReplyDeleteYou're welcome!
ReplyDeleteJust a side note. I think the models with unrestricted deterministic terms should generally be avoided and maybe also excluded from the list of possible models in the software. That is the chosen design in JMulti. Nothing is lost from using the restricted models and you get well behaved test statistics together with a better separation of different statistical questions. The topic is treated in Nielsen and Rahbek (2000), "Similarity issues in cointegration analysis", Oxford Bulletin of Economics and Statistics.
ReplyDeleteDavid,
ReplyDeleteThanks for the shout-out!
I've just started following your blog, so I missed your earlier gretl post. I started using gretl about 5 years ago when I first taught u/grad econometrics. I wanted a free, easy-to-use package for my students. I was pleasantly surprised at the positive reaction I got from them about gretl. I've also started using it more & more for research.
Andreas: gretl has a menu option to control the treatment of deterministic terms in vecms. "Unrestricted constant" is the default, but it's easy to change. The users' guide also has a good discussion of this issue.
PS
@Andreas: Nice point, thanks.
ReplyDelete@psummers: gretl rules again!
Dear Professor Giles,
ReplyDelete1. Is it possible to set up the bootstrap confidence intervals for the structural VAR in Eviews? or gretl?
2. There are three variables in the model and I imposed some restrictions as below.
@e1=0.70*@e3+c(1)*@u2+@u1
@e2=c(2)*@u1+@u2
@e3=c(3)*@e1+c(4)*@e2+@u3
IRF in eviews showed 0 and probably the restrictions here might be wrong as it might be either 0 or 1.
If it's possible could you kindly post any example of structural VAR please?
Thanks,
Best,
Z
Z: Thanks for the comment. Not in either, I'm afraid. In the gretl user's guide it shows up on p.200 as being on the "to do" list.
ReplyDeleteDear Professor Giles,
ReplyDeleteThanks for the reply.
Could you recommend any other Programme?
What about Stata or SAS?
Thanks,
Best,
Z
Not really.....sorry!
DeleteDear Professor Giles,
ReplyDeleteHow we can interpret the impulse response from above graph?
Regards,
SASI
Dear Professor Giles,
ReplyDeleteHow is the syntax of the impulse response from above
graph including the bootstrapped confidence interval?
Thanks for your help
Not sure that I understand your question - sorry!
DeleteDear Professor Giles,
Deletethe syntax to get the impulse- response function of a VECM- model is:
vecm order rank ylist ... -- impulse-response
It prints the impulse response
But how is the syntax (not the click-sequence) to become above graph including the bootstrapped confidence interval
Dear Professor Giles,
Deletethe syntax to get the impulse- response function of a VECM- model is:
vecm order rank ylist ... -- impulse-response
It prints the impulse response
But how is the syntax (not the click-sequence) to become above graph including the bootstrapped confidence interval
Thanks for your help
You can get this from the "HELP" (or from the manual):
DeleteSyntax
var_name.impulse(n, options) ser1 [ser2 ser3 ...] [@ shock_series [@ ordering_series]]
Options
g (default)
Display combined graphs, with impulse responses of one variable to all shocks shown in one graph. If you choose this option, standard error bands will not be displayed.
m
Display multiple graphs, with impulse response to each shock shown in separate graphs.
se=arg
Standard error calculations: "se=a" (analytic), "se=mc" (Monte Carlo).
If selecting Monte Carlo, you must specify the number of replications with the "rep=" option.
Note the following:
(1) Analytic standard errors are currently not available for (a) VECs and (b) structural decompositions identified by long-run restrictions. The "se=a" option will be ignored for these cases.
(2) Monte Carlo standard errors are currently not available for (a) VECs and (b) structural decompositions. The "se=mc" option will be ignored for these cases.
rep=integer
Number of Monte Carlo replications to be used in computing the standard errors. Must be used with the "se=mc" option.
Dear Professor Giles,
Deletethanks for your help, the syntax works in eViews,
but I need it for Gretl.
Soryy - don't know off hand, but contact them directly.
DeleteDear Professor Giles,
ReplyDeletethe syntax to get the impulse- response function of a VECM- model is:
vecm order rank ylist ... -- impulse-response
It prints the impulse response
But how is the syntax (not the click-sequence) to become above graph including the bootstrapped confidence interval
I'm afraid I'm not sure. Why not contact EViews?
DeleteDear Prof. Giles
ReplyDeleteI`ve got a quick one on the VEC model. In case the t- values for the adjustment vector of a VEC model are not statistically significant, can I still use the VEC model and interpret the impulse responses?
Best wishes
Tim
Tim - you can, but I'd be somewhat cautious.
DeleteDG
Dear Prof. Dave,
ReplyDeleteThanks a lot for this post. But may I ask you if it is possible to use this gretl or JMulTi (in another post of yours) to calculate Confidence Intervals if I estimate generalized IRFs based on VECM?
Thank you very much. I look forward to hearing from you soon.
Not sure that I understand your question. This post and the previous one deal with C.I.'s for IRF's from VECM models. What do you mean by "generalized" IRF's?
ReplyDeleteDear Prof.,
DeleteThanks for your reply. IRF using traditional approach is sensitive to the ordering of the variables in the system while generalized approach does not have this shortcoming.
Pesaran, M.H., Shin, Y. 1998. Generalized impulse response analysis in linear multivariate models, Economics Letters 58, 17-29.
To the best of my knowledge, currently there are only Eviews 6,7 and Microfit do estimate generalized IRF but they do not supply standard errors for VECMs as you say.
So my question is if we can calculate Confidence Intervals if I estimate generalized IRFs based on VECM?
Thank you very much.
Thanks - now I understand! I don't think that any of the packages accomodate this. The only option I can see is to bootstrap the CI's.
DeleteDG
Then I guess I have to follow the procedure in this article: A. Benkwitz & H. Lutkepohl, "Comparison of Bootstrap Confidence Intervals for Impulse Responses of German Monetary Systems", Macroeconomic Dynamics, 2001, 5, 81-100.
DeleteSigh... :(
Thank you anyway :)
My final question is: Do you think I can bootstrap the CI's using Eviews? Or which statistical tool is easiest for this procedure? Thank you.
DeleteEViews should be fine.
DeleteDG
thank you! have a nice day!
DeleteDear professor Dave,
ReplyDeleteHow do I calculate a simple hedge ratio for futures contracts for hedging a stock portfolio using VECM coefficients.
Prof Giles,
ReplyDeleteThank you for introducing me to Gretl!
I have a question regarding IRF for VECM on Eviews and Gretl.
On Eviews the IRF (for two variables) gives a decline in Y before a later increase in response to shocks to X. However in Gretl, Y increases in response to shocks to X.
I tried my best to apply the same setting regarding VECM. In your opinion, what's the reason for contradictory results?
One more thing, Do you believe it is correct to report VECM IRF results from Eviews (even though they don't show confidence intervals) in a paper?
I would appreciate your comment!
Amir,
Amir - I have no idea why they would differ. Perhaps you should check with the producers of the 2 packages. Ideally, confidence intervals should be given. You could bootstrap them.
DeleteThank you!
Delete