jmaih / RISE_toolbox

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

treatment of endogenous probabilities in solution and simulation #32

Closed mhardinga closed 8 years ago

mhardinga commented 8 years ago

Hi Junior,

I am working with endogenous switching probabilities defined as ! nk_tp_1_2 = prob_l_h(x_hat); ! nk_tp_2_1 = prob_h_l(x_hat); where prob_l_h and prob_h_l are nonlinear functions of the variable x_hat.

1) I guess RISE will linearize these functions when solving the model, right? Then, for estimation and simulation, the interpretation is that the probabilities are computed as the linear approximation of the nonlinear functions prob_l_h and prob_h_l?

2) after simulation, is it possible to see the values of these probabilities at each point in time? The output shows the variable nk (in what regime is the model), but not the probabilities.

Thank you. Martin

jmaih commented 8 years ago

Hi Martin,

Your intuition is correct. RISE will take an approximation, but not of the probabilities per se. The approximation is taken with respect to the product of the probabilities and the system of equations. So the functions prob_l_h and prob_h_l are not approximated independently.

The probabilities are a function of the realization of the variables they are functions of. They are not returned by RISE since what is actually computed at each point in time is a new transition matrix, which can be a combination of many markov chains. Returning such an element would mean returning a time series of transition matrices, which is different from the time series for individual variables.

What RISE returns at the moment is the history of regimes (combinations of markov chains) and of states of each markov chain.

Cheers,

Junior

jkrenz commented 5 years ago

Hi,

I think since the last posts in this issue, RISE has changed insofar that it now returns the transition probabilities at each point in time. The structure mysims constains nk_1_2, nk_1_1, nk_2_1, nk_2_2 (where nk_1_2+nk_1_1= 1 and nk_2_1+nk_2_2=1) and additionally regime_1_2, regime_1_1, regime_2_1 and regime_2_2 which seem to contain exactly the same information.

However, I have a bit of a problem of understanding how exactly these values are calculated. Above you stated "The probabilities are a function of the realization of the variables they are functions of." However, in my simulations the reported values in nk_1_2 and nk_2_1 don't seem to have the slightest connection to the variables they are functions of.

I specify
@#if ~exogenous_switching ! nk_tp_1_2 = alfaswitch_1/(alfaswitch_1+exp( -psi_1Nstar)); % NB to B
! nk_tp_2_1 = alfaswitch_2/(alfaswitch_2+exp( psi_2
multstar )); % B to NB

@#end

with psi_2=3; psi_1=3; alfaswitch_1=10; alfaswitch_2=1;

The variables Nstar and multstar are similar as Bstar and Omegahat in the example with the occ. bin. collateral constraint in Binning/Maih (2017). In the first period of my simulation (regime: 1), Nstar takes on a value of 0.3414 which should correspond to a very high transition probability to switch to regime 2, but nk_1_2 is only 0.21. The same behavior is true for the times we are in regime 2 and I look at the connection between multstar and nk_2_1.

Maybe you can help me with the intuition here?

Best, Johanna

jmaih commented 5 years ago

Dearest Johanna,

Sorry I cannot respond as quickly as I would want to. I am currently overstretched and out of town attending a conference.

I guess it should be straight forward to replicate the problem you seem to have. Please send me the relevant files in a private email so that I may check what the issue is.

Cheers, J.

On Wed, Sep 11, 2019 at 2:06 PM jkrenz notifications@github.com wrote:

Hi,

I think since the last posts in this issue, RISE has changed insofar that it now returns the transition probabilities at each point in time. The structure mysims constains nk_1_2, nk_1_1, nk_2_1, nk_2_2 (where nk_1_2+nk_1_1= 1 and nk_2_1+nk_2_2=1) and additionally regime_1_2, regime_1_1, regime_2_1 and regime_2_2 which seem to contain exactly the same information.

However, I have a bit of a problem of understanding how exactly these values are calculated. Above you stated "The probabilities are a function of the realization of the variables they are functions of." However, in my simulations the reported values in nk_1_2 and nk_2_1 don't seem to have the slightest connection to the variables they are functions of.

I specify @#if ~exogenous_switching ! nk_tp_1_2 = alfaswitch_1/(alfaswitch_1+exp( -psi_1 Nstar)); % NB to B ! nk_tp_2_1 = alfaswitch_2/(alfaswitch_2+exp( psi_2multstar )); % B to NB @#end

with psi_2=3; psi_1=3; alfaswitch_1=10; alfaswitch_2=1;

The variables Nstar and multstar are similar as Bstar and Omegahat in the example with the occ. bin. collateral constraint in Binning/Maih (2017). In the first period of my simulation (regime: 1), Nstar takes on a value of 0.3414 which should correspond to a very high transition probability to switch to regime 2, but nk_1_2 is only 0.21. The same behavior is true for the times we are in regime 2 and I look at the connection between multstar and nk_2_1.

Maybe you can help me with the intuition here?

Best, Johanna

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jmaih/RISE_toolbox/issues/32?email_source=notifications&email_token=AATKBTZWYDKUU5QXTC4HJODQJDNLTA5CNFSM4CT2ZIV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OIEOI#issuecomment-530350649, or mute the thread https://github.com/notifications/unsubscribe-auth/AATKBTZKQRP33GPFCW6M77TQJDNLTANCNFSM4CT2ZIVQ .

jkrenz commented 5 years ago

Dear Junior,

thanks for updating RISE! The transition probabilities in our model make sense now.

And actually, some of our results completely changed -- they are more plausible now. I was wondering what the problem had been before, as other users don't seem to have experienced our problems?

Best, Johanna

jmaih commented 5 years ago

Dear Johanna,

Thanks for the feedback. The problem was corrected long long time ago but unfortunately not on the public version of RISE that’s currently online.

The most up-to-date version, which I have been using for teaching, is slightly different from the online version and is not public yet.

Cheers, J.

Sendt fra min iPhone

  1. sep. 2019 kl. 11:24 skrev jkrenz notifications@github.com:

Dear Junior,

thanks for updating RISE! The transition probabilities in our model make sense now.

And actually, some of our results completely changed -- they are more plausible now. I was wondering what the problem had been before, as other users don't seem to have experienced our problems?

Best, Johanna

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.