# Modelling a regime shift of a parameter in dynare

Dear all,

I am trying to implement a model where a parameter follows a two-state markov process. That is, a regime shfit. How do I implement it in dynare? Specifically, I have the following in mind:

x_{t+1} = \rho x_t + \epsilon_t+ c_t

where constant c_t takes two values and follows a markov process c \in \{c_l, c_h\}.

Is it possible to model this type of discrete shock (markov process) in dynare? I also hope to conduct impusle response analysis for a shock that switches c_l to c_h (or reverse)

Thanks!

No, Dynare does not support regime-switching DSGE models. Please have a look at Junior Maih’s RISE toolbox.

Thanks, I will check RISE toolbox.

I was thinking of the following implementation. If I only have two regimes – corresponding to a parameter that takes two values.
Can I do probability weighted conditional expectation in every original dynare equation? So in total there will be 2number of endogenous variables and 2 number of equations.

Is there any problem assocaited with doing it this way? Thanks

I am not sure how that would look like.

I was thinking something like:

E_t x^l_t = E_t \rho (p_{ll} x^l(-1) + p_{hl} x^h(-1)) + \epsilon_t + c_l
and
E_t x^h_t = E_t \rho (p_{lh} x^l(-1) + p_{hh} x^h(-1)) + \epsilon_t + c_h
Where p_{ab} is the posterior prob of transiting from a to b between t-1 and t. x^l_t and x^h_t are two variables denoting the value of x in different regime \{l,h \}, corresponding to different drift c_l, c_h.

In dynare it’s all conditional expectation, so we can take out the expectation and just have those prob weighted equations.

x^l_t = \rho (p_{ll} x^l(-1) + p_{hl} x^h(-1)) + \epsilon_t + c_l
x^h_t = \rho (p_{lh} x^l(-1) + p_{hh} x^h(-1)) + \epsilon_t + c_h

Do you think this way of implementing regime-switch is feasible?

In your first post, you had x_{t+1} on the left, now it’s x_t. If you are able to replace all expectations, then it should be fine. But often that’s not feasible as other variables in the future are also a function of the exogenous state that switches.