jmaih / RISE_toolbox

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

estimate too slow #150

Closed guderian2015 closed 3 years ago

guderian2015 commented 3 years ago

dear Junior: I am trying to estimate my ms-dsge model in rise now. I want to know why rise need a lot of time to start at a value to estimate. I have tried example files and it only need a few minutes. yours Sincerely Shentu

jmaih commented 3 years ago

Dear Shentu,

The estimation of regime switching DSGE models is definitely slower than that of constant-parameter models :

If you want to increase speed, you may want to turn off option "solve_check_stability" by setting it to false. But then there is no guarantee that when estimation is completed, the resulting optimum will be one for which the model is stable. This applies to models with constant transition probabilities.

If you have time-varying transition probabilities, you have a strong case for turning off the checking of stability since the MSS (mean square stability) criterion used applies only for constant transition probabilities.

Occasionally, there is another cost at the beginning when RISE tries to find a good (an acceptable) initial parameterization, i.e. a parameterization for which the likelihood is non-zero.

I hope this helps,

Cheers,

J.

On Mon, Nov 23, 2020 at 1:33 PM guderian2015 notifications@github.com wrote:

dear Junior: I am trying to estimate my ms-dsge model in rise now. I want to know why rise need a lot of time to start at a value to estimate. I have tried example files and it only need a few minutes. yours Sincerely Shentu

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jmaih/RISE_toolbox/issues/150, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATKBT3LIPSAOYOV5KACRXLSRJJDHANCNFSM4T7NV2UQ .

guderian2015 commented 3 years ago

Dear Shentu, The estimation of regime switching DSGE models is definitely slower than that of constant-parameter models : - the solving of the model is more involved - the computation of the likelihood is more complicated and the time cost increases with the number of regimes. - Depending on whether you want to check stability while you are estimating the model, that is an additional important cost, which could even surpass the two previous ones combined if the model is large. If you want to increase speed, you may want to turn off option "solve_check_stability" by setting it to false. But then there is no guarantee that when estimation is completed, the resulting optimum will be one for which the model is stable. This applies to models with constant transition probabilities. If you have time-varying transition probabilities, you have a strong case for turning off the checking of stability since the MSS (mean square stability) criterion used applies only for constant transition probabilities. Occasionally, there is another cost at the beginning when RISE tries to find a good (an acceptable) initial parameterization, i.e. a parameterization for which the likelihood is non-zero. I hope this helps, Cheers, J. On Mon, Nov 23, 2020 at 1:33 PM guderian2015 @.***> wrote: dear Junior: I am trying to estimate my ms-dsge model in rise now. I want to know why rise need a lot of time to start at a value to estimate. I have tried example files and it only need a few minutes. yours Sincerely Shentu — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#150>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATKBT3LIPSAOYOV5KACRXLSRJJDHANCNFSM4T7NV2UQ .

dear Junior: Thank you for your advice. I'll try it again. yours Sincerely Shentu

guderian2015 commented 3 years ago

Dear Junior: Sorry to disturb you again. When I use optimizer 'bee_gate' to estimate and I get different result with the same setting, I have read your comments on other issues. I want to know if you have any other advice about this problems. Thank you! yours Sincerely Shentu

jmaih commented 3 years ago

Hi Shentu,

Provided each estimation run is complete, you may be getting different local optima, which would point to the problem having several local minima.

Alternatively it may be the case that some or maybe all of your runs are not complete.

J.

On Wed, Dec 2, 2020 at 2:34 AM guderian2015 notifications@github.com wrote:

Dear Junior: Sorry to disturb you again. When I use optimizer 'bee_gate' to estimate and I get different result with the same setting, I have read your comments on other issues. I want to know if you have any other advice about this problems. Thank you! yours Sincerely Shentu

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jmaih/RISE_toolbox/issues/150#issuecomment-736929132, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATKBT2BF34OLZQUEVZL73DSSWKSZANCNFSM4T7NV2UQ .

guderian2015 commented 3 years ago

Dear Junior: Thanks for your attention. If I get different local optima on estimation, what can I do to get a consistent result. yours Sincerely Shentu

jmaih commented 3 years ago

In general you will never know whether you get to the global peak or not. But you can try the following options

  1. Use a deterministic optimizer like fmincon which will consistently give you the same local optimum
  2. Use a stochastic search optimizer that will consistently put you in a region of high density, and if you are lucky and after you have run it for a long time, you may get to the global optimum
  3. do option 2 and then option 1 to finish up the job

On Thu, Dec 3, 2020 at 5:59 AM guderian2015 notifications@github.com wrote:

Dear Junior: Thanks for your attention. If I get different local optima on estimation, what can I do to get a consistent result. yours Sincerely Shentu

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jmaih/RISE_toolbox/issues/150#issuecomment-737666232, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATKBTZFUURHWFFN7L2K6TLSS4LKLANCNFSM4T7NV2UQ .

guderian2015 commented 3 years ago

Dear Junior: Thank you for your quick response. I set bee_gate to run for a long time these days and have got a consistent reult.Thank you for your advice! Cheers, Shentu