Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
This is a rough implementation of Ehrmann, Ellison, Valla (2003), "Regime-dependent impulse response functions in a Markov-switching vector autoregression model", Economics Letters, Vol. 78, pp. 295-299. The data set is a reconstruction rather than the author's original data set (from their working paper). This does MCMC rather than bootstrapping for the generation of error bands for the IRF's. It does two sets of impulse responses at each kept draw, and "interleaves" them so there are six "shocks" for use in @MCGRAPHIRF, in order the first in regime1, first in regime 2, second in regime 1, etc.
This model is estimated several different ways as part of the Structural Breaks and Switching Models course. Note well that this is a very technically demanding type of model. If you have no experience with Markov switching models and MCMC methods, you're better off getting used to the issues on a simpler model first.
Zip with programs/data
Detailed description
This model is estimated several different ways as part of the Structural Breaks and Switching Models course. Note well that this is a very technically demanding type of model. If you have no experience with Markov switching models and MCMC methods, you're better off getting used to the issues on a simpler model first.
Zip with programs/data
Detailed description
-
nazif
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Dear Tom,
Is it possible to produce regime transition probabilities and also regime properties similar to original Ox code of Ehrmann?
and I come to another question when I am plotting irfs. Could you please explain to me what are irf(3,8) and irf(4,8) in the four-variable system? for example is irf(3,8) the response of the third variable to the fourth shock in the second regime?
Thanks
Nazif
Is it possible to produce regime transition probabilities and also regime properties similar to original Ox code of Ehrmann?
and I come to another question when I am plotting irfs. Could you please explain to me what are irf(3,8) and irf(4,8) in the four-variable system? for example is irf(3,8) the response of the third variable to the fourth shock in the second regime?
Thanks
Nazif
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Sure. You have to save the draws for the P matrices and analyze them.nazif wrote:Dear Tom,
Is it possible to produce regime transition probabilities and also regime properties similar to original Ox code of Ehrmann?
The i in IRF(i,j) is the variable whose response is being computed. The shocks are interleaved, so j=1 and j=2 are for the first shock in the two regimes; j=3 and j=4 for the second shock, etc. So j=8 is the 4th shock, 2nd regime.nazif wrote: and I come to another question when I am plotting irfs. Could you please explain to me what are irf(3,8) and irf(4,8) in the four-variable system? for example is irf(3,8) the response of the third variable to the fourth shock in the second regime?
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Dear Tom,
We get some referee comments for our paper they are also asking variance decompositions. Therefore I would like to ask you if there is a code to calculate regime dependent forecast error decompositions based on markov regime regime switching models. I am using version 8.1
Thanks
We get some referee comments for our paper they are also asking variance decompositions. Therefore I would like to ask you if there is a code to calculate regime dependent forecast error decompositions based on markov regime regime switching models. I am using version 8.1
Thanks
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
FEVD's aren't really compatible with the IRF analysis, since the IRF's are using Cholesky factors standardized to unit variances to highlight the differences in dynamics rather than the differences in variances.ege_man wrote:Dear Tom,
We get some referee comments for our paper they are also asking variance decompositions. Therefore I would like to ask you if there is a code to calculate regime dependent forecast error decompositions based on markov regime regime switching models. I am using version 8.1
Thanks
The two calculations that look like:
compute factor=%decomp(sigmav(1)),factor=factor*inv(%diag(%xdiag(factor)))
impulse(noprint,model=MSSysRegModel,results=impulses1,steps=steps,factor=factor)
would need to have IMPULSE replaced with ERRORS, and would need to use just the %DECOMP(...) factor rather than the rescaled one.
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Hi, tom
I am confused about "Draw 'xxxx' Redrawing regimes with regime of size 'x.xx' " in running "Draw the regimes" of the code(x means a integer),and it was still redrawing after 12 hours, i had to abort it.my model contain 3 variables, sample period:2002M02-2013M03,lag order is 2 based on hq.Thanks a million.
Best wishes
I am confused about "Draw 'xxxx' Redrawing regimes with regime of size 'x.xx' " in running "Draw the regimes" of the code(x means a integer),and it was still redrawing after 12 hours, i had to abort it.my model contain 3 variables, sample period:2002M02-2013M03,lag order is 2 based on hq.Thanks a million.
Best wishes
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
That's a rather strong indication that the second regime isn't necessary---it can't get more than five data points in one of the regimes.rawraw wrote:Hi, tom
I am confused about "Draw 'xxxx' Redrawing regimes with regime of size 'x.xx' " in running "Draw the regimes" of the code(x means a integer),and it was still redrawing after 12 hours, i had to abort it.my model contain 3 variables, sample period:2002M02-2013M03,lag order is 2 based on hq.Thanks a million.
Best wishes
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Hi, tom
Could you please explain to us what does IMPULSESk(i,j) mean?(k=1,2) what is the difference between IMPULSESk(i,j) and IRF(i,j)? Thanks.
Best wishes
Could you please explain to us what does IMPULSESk(i,j) mean?(k=1,2) what is the difference between IMPULSESk(i,j) and IRF(i,j)? Thanks.
Best wishes
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
IMPULSES1 are the responses in regime 1 and IMPULSES2 are the responses in regime 2. Those are generated for each draw and get combined into a single set of responses so @MCPROCESSIRF can process them together. IRF will have the medians after the post processing for the combined responses.
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Just add this after the estimation is finished. This will do the responses to shocks normalized to unit impacts, as they do in the paper.
Code: Select all
@MSSysRegSetModel(regime=1)
compute factor=%decomp(sigmav(1)),factor=factor*inv(%diag(%xdiag(factor)))
impulse(noprint,model=MSSysRegModel,results=impulses1,steps=steps,factor=factor)
*
* Save IRF's for regime 2
*
@MSSysRegSetModel(regime=2)
compute factor=%decomp(sigmav(2)),factor=factor*inv(%diag(%xdiag(factor)))
impulse(noprint,model=MSSysRegModel,results=impulses2,steps=steps,factor=factor)Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
I got "## SX11. Identifier STEPS is Not Recognizable. Incorrect Option Field or Parameter Order?>>>>ulses1,steps=steps,<<<<" when I add the code after the EM estimation is finished ,what can I do next? Thanks!TomDoan wrote:Just add this after the estimation is finished. This will do the responses to shocks normalized to unit impacts, as they do in the paper.
Code: Select all
@MSSysRegSetModel(regime=1) compute factor=%decomp(sigmav(1)),factor=factor*inv(%diag(%xdiag(factor))) impulse(noprint,model=MSSysRegModel,results=impulses1,steps=steps,factor=factor) * * Save IRF's for regime 2 * @MSSysRegSetModel(regime=2) compute factor=%decomp(sigmav(2)),factor=factor*inv(%diag(%xdiag(factor))) impulse(noprint,model=MSSysRegModel,results=impulses2,steps=steps,factor=factor)
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
You have to define STEPS as the number of steps of IRF's that you want.
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Thanks!TomDoan wrote:You have to define STEPS as the number of steps of IRF's that you want.
(1) What do "k","i","j" in IMPULSES"k"(i,j) mean?
(2) I can get the IMPULSES"k"(i,j),but how can I get the IRF(i,j),LOWER(i,j),UPPER(i,j) in EM algorithm?
(3) There is only P(1,1) in results of EM estimation,so how can I get P(2,2)?P(2,2)=1-P(1,2) ?
(4) There is only BETA in results of EM estimation, how can I get BETASYS(k)(i,j)?
The code please! Thanks again.
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
I answered about the K above. IMPULSE defines its results as an array of series where i is the target variable and j is the shock.rawraw wrote: (1) What do "k","i","j" in IMPULSES"k"(i,j) mean?
You can't. That's why we didn't put IRF's into the EM and ML programs.rawraw wrote: (2) I can get the IMPULSES"k"(i,j),but how can I get the IRF(i,j),LOWER(i,j),UPPER(i,j) in EM algorithm?
EM actually generates the whole matrix. It's cut down to P(1,1), P(1,2) for the ML polishing byrawraw wrote: (3) There is only P(1,1) in results of EM estimation,so how can I get P(2,2)?P(2,2)=1-P(1,2) ?
compute p=%xsubmat(p,1,1,1,2)
If you add
compute pmatrix=p
before that, you can then reference the whole matrix as pmatrix.
The NONLIN needs to be changed torawraw wrote: (4) There is only BETA in results of EM estimation, how can I get BETASYS(k)(i,j)?
nonlin(parmset=regparms) betasys sigmav
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Dear Tom,
I am new to rats and having some problems . I am running a 3 variable ms-var simailar to ehrmann -ellison-valla(2003). I am estimating it with em. I want to generate negative shocks . My three variables are house price growth (hpp) , real gdp growth rate (gdpp) and change in monetary policy. i have attached my file. I tried the flipper option but it doesn't work. It would be great if you have a look (attached file: var4) Hi taom I have attached the data set.
My second question is is it possible to generate the standard errors using boot straps in my work.
It would be realy great if you can help me.
All the best
Rosen
I am new to rats and having some problems . I am running a 3 variable ms-var simailar to ehrmann -ellison-valla(2003). I am estimating it with em. I want to generate negative shocks . My three variables are house price growth (hpp) , real gdp growth rate (gdpp) and change in monetary policy. i have attached my file. I tried the flipper option but it doesn't work. It would be great if you have a look (attached file: var4) Hi taom I have attached the data set.
My second question is is it possible to generate the standard errors using boot straps in my work.
It would be realy great if you can help me.
All the best
Rosen