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

Filtering data using a MS-DSGE model #185

Closed GabrielPestana81 closed 3 months ago

GabrielPestana81 commented 3 months ago

Dear Dr. Maih,

I have a very simple model, and two calibrations that lead to two different regimes. In one calibration, I have a passive fiscal policy, which is a standard model. In the other calibration, I have an active fiscal policy. They differ only by two parameters, which are the monetary policy reaction to inflation ($\alpha_\pi$) and the fiscal policy reaction to the debt size ($\alpha_b$).

Given a set of data, could please point me out how could I use the toolbox to obtain estimates of probability of being in each regime in sample?

Later, I would also like to estimate the parameters in the model. However I would have to set as priors the relevant areas for the parameters that changes between regimes. That is, in the passive fiscal policy the prior must ensure $\alpha_\pi \geq 1$ and $\alphab > 1/\beta - 1$, and with active fiscal policy $\alpha\pi < 1$ and $0 < \alpha < 1/\beta - 1$.

Thanks in advance !

jmaih commented 3 months ago

Dear Gabriel,

If you've set up your model properly, all you need to do is filtering.

e.g. f=filter(m)

where m is a parameterized model object containing all the relevant information for filtration. or alternatively

f=filter(m,varargin)

where you pass the additional options you need.

Once you filter, f will be a structure containing information about the filtered variables, the updated variables and the smoothed variables. Some of those variables are going to be the probabilities of being in the different regimes.

Estimation is just going to be a change in parameters but the same principles will apply.

In terms of restrictions on the parameters, check out an example in \examples\VariousModels\TaoZha\LWZ_Econometrica2013\master_switch

Cheers,

J.

On Sun, May 26, 2024 at 8:36 PM GabrielPestana81 @.***> wrote:

Dear Dr. Maih,

I have a very simple model, and two calibrations that lead to two different regimes. In one calibration, I have a passive fiscal policy, which is a standard model. In the other calibration, I have an active fiscal policy. They differ only by two parameters, which are the monetary policy reaction to inflation ($\alpha_\pi$) and the fiscal policy reaction to the debt size ($\alpha_b$).

Given a set of data, could please point me out how could I use the toolbox to obtain estimates of probability of being in each regime in sample?

Later, I would also like to estimate the parameters in the model. However I would have to set as priors the relevant areas for the parameters that changes between regimes. That is, in the passive fiscal policy the prior must ensure $\alpha_\pi \geq 1$ and $\alphab > 1/\beta - 1$, and with active fiscal policy $\alpha\pi < 1$ and $0 < \alpha < 1/\beta

  • 1$.

Thanks in advance !

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

GabrielPestana81 commented 3 months ago

Thank you so much!

I'll try to implement it, and read the provided example.

Cheers !