jmaih / RISE_toolbox

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

Problem in solving regime-switching model #41

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi Junior,

I was trying to solve a nonlinear medium-scale NK model with switching regimes. If I do not declare 'steady_state_imposed', true, then the model can only be solved in one of the two regimes using any solver. If I declare this, then the model can be solved using 'mn' or 'mnk' solver, but the solution is unstable.

To summarize, here is what I found in the debug mode:

(1) model with switching regimes + any solver -> the model in one regime is solved, but the model in another regime is not solved because lsqnonlin exceeded the iteration limit (Residual = 1e-9, Lambda = 1e-7 when stopped)

(2) model with switching regimes + regular solver + 'steady_state_imposed', true --> not solved

(3) model with switching regimes + 'mn' or 'mnk' solver + 'steady_state_imposed', true --> the model in both regimes are solved, but solution unstable

Would you offer me any advice about how I shall proceed? Thanks!

Best, Zexi

ghost commented 7 years ago

Hi Junior,

I just changed the inflation indexation parameter from 0.5 to 0.4, and the Markov-switching model is solved by either the regular solver or the 'mn' solver. Still, I have no idea why this would happen, and it seems that the IRFs derived from different solvers are not exactly the same. Can I find anywhere the detailed information about each solver in RISE? Thanks!

Best, Zexi

jmaih commented 7 years ago

Hi Zexi,

It is always better that you tell me what error message you get from the interface rather than trying to describe the internals. For instance, I do not remember what Lambda =1e-7 refers to. You could also email me the file that creates the error so that I can replicate the problem.

  1. what do you mean the model can only be solved in one regime? either it solves or it does not, unless you are using the occbin procedure, in which case only the reference regime has a solution.
  2. Maybe you are referring to the steady state? In that case, as I said before, it would take a course just to go through the various options for solving the steady state in RISE.
  3. strictly speaking, solving simply means finding a function xt=T(x{t-1},et) such that Ef(x{t+1},xt,x{t-1},e_t)=0. Nothing guarantees that the solution found will be stable.

Cheers,

Junior

-- "You can never know everything", Lan said quietly, "and part of what you know is always wrong. Perhaps even the most important part. A portion of wisdom lies in knowing that. A portion of courage lies in going on anyway." Robert Jordan, Winter's Heart, Book IX of the Wheel of Time.

We have not succeeded in answering all of our problems. The answers we have found only serve to raise a whole set of new issues. In some ways we are as confused as ever, but we believe we are confused on a higher level and about more important things. (cited in Øksendal, 1985)

On Thu, Mar 9, 2017 at 3:39 PM, Zexi Sun notifications@github.com wrote:

Hi Junior,

I was trying to solve a nonlinear medium-scale NK model with switching regimes. If I do not declare 'steady_state_imposed', true, then the model can only be solved in one regime with any solver. If I do declare this, then the model can be solved using 'mn' or 'mnk' solver, but the solution is unstable.

To summarize, here is what I found in the debug mode:

(1) model with switching regimes + any solver -> the model in one regime is solved, but the model in another regime is not solved because lsqnonlin exceeded the iteration limit (Residual = 1e-9, Lambda = 1e-7 when stopped)

(2) model with switching regimes + regular solver + 'steady_state_imposed', true --> not solved

(3) model with switching regimes + regular solver + 'steady_state_imposed', true --> the model in both regimes are solved, but solution unstable

Would you offer me any advice about how I shall proceed? Thanks!

Best, Zexi

— 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/41, or mute the thread https://github.com/notifications/unsubscribe-auth/ACagz7dDzuiJr_mqORe48u05OZ1q0Ib-ks5rkA8JgaJpZM4MYKe1 .

jmaih commented 7 years ago

Hi Zexi,

The solution to the problem is not necessarily stable or unique. Different solution algorithms may find different solutions and different initial conditions may yield different solutions as well if the problem turns out to have many solutions.

This paper http://www.norges-bank.no/en/Published/Papers/Working-Papers/2015/12015/ and some of the references therein discuss the various issues related to solving regime-switching DSGE models.

Cheers,

Junior

-- "You can never know everything", Lan said quietly, "and part of what you know is always wrong. Perhaps even the most important part. A portion of wisdom lies in knowing that. A portion of courage lies in going on anyway." Robert Jordan, Winter's Heart, Book IX of the Wheel of Time.

We have not succeeded in answering all of our problems. The answers we have found only serve to raise a whole set of new issues. In some ways we are as confused as ever, but we believe we are confused on a higher level and about more important things. (cited in Øksendal, 1985)

On Thu, Mar 9, 2017 at 4:14 PM, Zexi Sun notifications@github.com wrote:

Hi Junior,

I just changed the inflation indexation parameter from 0.5 to 0.4, and the Markov-switching model is solved by either the regular solver or the 'mn' solver. Still, I have no idea why this would happen, and it seems that the IRFs are not exactly the same using different solvers. Can I find anywhere the detailed information of each solver in RISE? Thanks!

Best, Zexi

— 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/41#issuecomment-285379026, or mute the thread https://github.com/notifications/unsubscribe-auth/ACagz0FSHh1fGuCnhuMcmfKQbEJRVi3Hks5rkBdlgaJpZM4MYKe1 .