jmaih / RISE_toolbox

Solution and estimation of Markov Switching Rational Expectations / DSGE Models
BSD 3-Clause "New" or "Revised" License
104 stars 77 forks source link

Estimation of an MS-AR model #64

Closed anettbor closed 6 years ago

anettbor commented 6 years ago

Dear Junior, I am trying to estimate an MS-AR model using RISE. How do I proceed when it comes to the lagged regimes of the constant?

Thanks, Anette

jmaih commented 6 years ago

Hi Anette,

Can you elaborate on what you mean by “lagged regimes of the constant”?

Cheers,

J.

On 6 Nov 2017, at 21:10, anettbor notifications@github.com wrote:

Dear Junior, I am trying to estimate an MS-AR model using RISE. How do I proceed when it comes to the lagged regimes of the constant?

Thanks, Anette

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

anettbor commented 6 years ago

Yes, of course, I apologise for being unclear. The model is the Hamilton (1989) model for US real GNP with four lags, where the growth rate (Constant) has two possible regimes. So that over the four lags in the model, the constant might be switching between two states. I was hence wondering how such a model could be formulated in RISE, as I don’t know how and if I can lag a parameter?

Thank you for your time and patience, Anette

jmaih commented 6 years ago

Hi Anette,

I you write a model as yt=a +b1*y{t-1}+...+bp*y_{t-p}+e_t, RISE will know how to handle it. You don't need to lag parameters.

Cheers,

J.

-- "You can never know everything", Lan said quietly, "and part of what you know is always wrong. Perhaps even the most important part. A portion of wisdom lies in knowing that. A portion of courage lies in going on anyway." Robert Jordan, Winter's Heart, Book IX of the Wheel of Time.

We have not succeeded in answering all of our problems. The answers we have found only serve to raise a whole set of new issues. In some ways we are as confused as ever, but we believe we are confused on a higher level and about more important things. (cited in Øksendal, 1985)

On Mon, Nov 6, 2017 at 2:58 PM, anettbor notifications@github.com wrote:

Yes, of course, I apologise for being unclear. The model is the Hamilton (1989) model for US real GNP with four lags, where the growth rate (Constant) has two possible regimes. So that over the four lags in the model, the constant might be switching between two states. I was hence wondering how such a model could be formulated in RISE, as I don’t know how and if I can lag a parameter?

Thank you for your time and patience, Anette

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jmaih/RISE_toolbox/issues/64#issuecomment-342155915, or mute the thread https://github.com/notifications/unsubscribe-auth/ACagz6ulu51xQHQVPRTT2xO275ALwvm9ks5szxB6gaJpZM4QTJaI .

anettbor commented 6 years ago

Hi again, Thank you for your quick response, and sorry for once again having to clarify what I mean.

As of now, my model formulation looks like; X - mu = phi_1(X{-1} - mu) + phi_2(X{-2} - mu) + phi_3(X{-3} - mu) + phi_4(X{-4} - mu) + std_eepsi; Where the mu’s are switching. However, the mu isn’t just dependent on the current regime, but the past four regimes. So it should look more like: X - mu(s_t) = phi_1(X{-1} - mu(s_{t-1})) + phi2*(X{-2} - mu(s{t-2})) + phi3*(X{-3} - mu(s{t-3})) + phi4*(X{-4} - mu(s{t-4})) + std_e*epsi; where s_t is presumed to follow a two-state markov-chain. How can I incorporate that into the model formulation?

Thanks again,

Anette

jmaih commented 6 years ago

I think I have a better understanding of what you are trying to do. What you are implicitly saying is that the mean growth rate can be different from one period to the other.

One way to address the is issue is to do the following: For a p-order AR process, define (p+1) independent Markov chains. Essentially then your model is

X - mu0 = phi_1(X{-1} - mu1) + phi_2(X{-2} - mu2) + ... + phi_p*(X{-4} - mup) + std_eepsi

Where mu0, mu1, ..., mup are all controlled by different processes.

Another way to go about it is to, alternatively, consider a two-equation system with similar but not necessarily identical implications

X - Y = phi_1(X{-1} - Y{-1}) + phi_2(X{-2} - Y{-2}) + phi_3(X{-3} - Y{-3}) + phi_4(X{-4} - Y{-4}) + std_eepsi;

Y=mu(st);

In this way you put lags on a variable and can assume mu follows a two-state Markov process.

Cheers,

J.

On 6 Nov 2017, at 23:37, anettbor notifications@github.com wrote:

Hi again, Thank you for your quick response, and sorry for once again having to clarify what I mean.

As of now, my model formulation looks like; X - mu = phi_1(X{-1} - mu) + phi_2(X{-2} - mu) + phi_3(X{-3} - mu) + phi_4(X{-4} - mu) + std_eepsi; Where the mu’s are switching. However, the mu isn’t just dependent on the current regime, but the past four regimes. So it should look more like: X - mu(s_t) = phi1(X{-1} - mu(s{t-1})) + phi2*(X{-2} - mu(s{t-2})) + phi3*(X{-3} - mu(s{t-3})) + phi4*(X{-4} - mu(s{t-4})) + std_e*epsi; where s_t is presumed to follow a two-state markov-chain. How can I incorporate that into the model formulation?

Thanks again,

Anette

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

anettbor commented 6 years ago

Perfect, thank you!

Anette