jmaih / RISE_toolbox

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

Future regimes in model #173

Closed jortegab closed 1 year ago

jortegab commented 1 year ago

Dear Mr. Maih,

I am currently working with a model which has just one regime-dependent parameter - say $\lambda(s_t)$ -, but this parameter appears both depending on $st$ and on $\mathbb{E} s{t+1}$ in the equations of the model.

I wanted to ask you if there is a recommended way to deal with future regimes appearing in the model. My current approach is to define a compund regime:

$$ \begin{equation} st^* = \begin{cases} 1, \quad \text{if } \mathbb{E} s{t+1} = 1, st=1 \ 2, \quad \text{if } \mathbb{E} s{t+1} = 2, st=1 \ 3, \quad \text{if } \mathbb{E} s{t+1} = 1, st=2 \ 4, \quad \text{if } \mathbb{E} s{t+1} = 2, s_t=2 \end{cases} \end{equation} $$

and transition matrix given by:

$$ \begin{equation} \begin{bmatrix} p{11} & p{12} & 0 & 0 \ 0 & 0 & p{21} & p{22} \ p{11} & p{12} & 0 & 0 \ 0 & 0 & p{21} & p{22} \end{bmatrix} \end{equation} $$

where $p_{ij}$ are the original transition probabilities of $s_t$. Is this the right way or would you recommend using a different approach?

Thank yoy very much in advance, Jose

jmaih commented 1 year ago

Hi Jose,

This is a big fat nothing burger :)

Just index the parameters with time and RISE will take care of the rest.

RISE solves the generic problem Ef(x{t+1},x{t},x{t-1},e{t},theta{t},theta{t+1})=0

where x{t} is the vector of endogenous variables, e{t} the vector of shocks, theta{t} the vector of parameters.

Cheers,

J.

On Wed, Sep 21, 2022 at 6:13 PM Jose Andrés Ortega @.***> wrote:

Dear Mr. Maih,

I am currently working with a model which has just one regime-dependent parameter (say $\lambda(s_t)$), but this parameter appears both depending on $st$ and on $s{t+1}$ in the equations of the model.

I wanted to ask you if there is a recommended way to deal with future regimes appearing in the model. My current approach is to define a compund regime: \begin{equation} s_t^ = \begin{cases} 1, \quad \text{if } s_{t+1} = 1, st=1 \ 1, \quad \text{if } s{t+1} = 2, st=1 \ 1, \quad \text{if } s{t+1} = 1, st=2 \ 1, \quad \text{if } s{t+1} = 2, st=2 \end{cases} \end{equation} and transition matrix given by: \begin{equation} p{11} & p{12} & 0 & 0 \ 0 & 0 & p{21} & p{22} \ p{11} & p{12} & 0 & 0 \ 0 & 0 & p{21} & p{22} \end{equation*} where $p{ij}$ are the original transition probabilities of $s_t$. Is this the right way or would you recommend using a different approach?

Thank yoy very much in advance, Jose

— Reply to this email directly, view it on GitHub https://github.com/jmaih/RISE_toolbox/issues/173, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATKBT5MF6P766KHFWJP5HLV7MX4BANCNFSM6AAAAAAQSHMPKU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jortegab commented 1 year ago

Hi Mr. Maih,

Thank you very much for your answer!

I have just tried indexing the parameter and I got the following error:

`Assigning to 0 elements using a simple assignment statement is not supported. Consider using comma-separated list assignment.

Error in parser.capture_equations

Error in parser.capture_equations

Error in parser.capture_equations

Error in parser.parse_model

Error in parser.parse

Error in dsge

Error in rise (line 64) %

Error in run (line 8)`

Do you have any idea of why is this error popping up?

Regards, Jose

jmaih commented 1 year ago

I will need to update that version of RISE then.

There is a simple workaround.

Define an endogenous variable, say z, and an equation

z=lambda;

where lambda is the switching parameter occurring in the future.

then replace lambda{+1} with z{+1}

Cheers,

J.

On Wed, Sep 21, 2022 at 7:05 PM Jose Andrés Ortega @.***> wrote:

Hi Mr. Maih,

Thank you very much for your answer!

I have just tried indexing the parameter and I got the following error:

`Assigning to 0 elements using a simple assignment statement is not supported. Consider using comma-separated list assignment.

Error in parser.capture_equations

Error in parser.capture_equations

Error in parser.capture_equations

Error in parser.parse_model

Error in parser.parse

Error in dsge

Error in rise (line 64) %

Error in run (line 8)`

Do you have any idea of why is this error popping up?

Regards, Jose

— Reply to this email directly, view it on GitHub https://github.com/jmaih/RISE_toolbox/issues/173#issuecomment-1253989416, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATKBT7QHXNGZJIVIVQAG6LV7M55FANCNFSM6AAAAAAQSHMPKU . You are receiving this because you commented.Message ID: @.***>

jortegab commented 1 year ago

This worked, thank you once again for all the help!

Jose