Problem with Ramsey policy / solver

Hi everyone,
I have a technical problem with Ramsey policy in Dynare. As far as I understood, the Ramsey routine tries different initial values of the instruments in the process of finding the steady state. I am not sure if I got this right, can you help me understand the routine?

In my analitical steady state, I need to use the solver to obtain one of the values. However, for a particular range of initial values, some variables assume complex numbers. So, when I call the solver inside the Ramsey process in Dynare, I get the following error:

Objective function is returning undefined values at initial point. FSOLVE cannot continue.

I think this occurs due to the problem I just described, but I am not totally sure about it. Anyhow, if this is the case, is there a way to tackle this issue?

Thank you very much for your help,
Have a nice day!

A_ne_ss.m (419 Bytes)
forum.mod (6.3 KB)

You need proper error handling both when calling the solver and in the steady_state_model-block:
A_ne_ss.m (498 Bytes)
forum_ramsey.mod (6.4 KB)

Ramsey is unable to find a steady state. From what I can see, t goes to minus infinity and v_e is not modified at all. Most likely, there is an issue with the model setup.

Dear Professor, really thank you for the extensive answer.

Sorry to bother again.

I tried to run the attached files. I did not understand two things:

  1. Why did you add another initval section just before the planner’s problem? (I assume that proceeding this way my mod file first solves the steady state and then it checks for different values of initial values; is it correct?)
  2. When I run the mod file, It seems that I get error from the solver, since some variables return Nans (as set by the catch statement you made). However, when I try to solve the steady state in another matlab file (specific for that purpose), it seems that no problem occurs (even if, for certain values of the initial instruments, I may have complex solutions).
    This puzzles me a bit, since I cannot fully understand the problem you described in your post.

Could you please help me better understand your intuition?

Thank you again,
Have a nice afternoon!

  1. Dynare will try to find the steady state values of the instruments using numerical techniques. But that steady state finding needs to start at some place. Unless specified otherwise with initval, these values are taken to be 0. I tried what happens if I modify the starting values.
  2. I am not sure I understand your second point. There are values for the instruments that Dynare tries where the solver fails.

Dear Professor, thank you again for the answer.

So, if I got it correctly, it could be tha case that the values found with the solver don’t match the values which could let the Ramsey routine work.
If this is correct, couldn’t be possible to constraint the resolution of the problem to a specific range of guesses? (thus avoiding those values which return complex solutions).

Really thank you a lot for the precious help!
Have a nice day

The problem is finding the steady state for the Ramsey problem, including the Lagrange multipliers and the instruments. I already trapped problematic values via the try-catch. But that did not help in finding the required instrument values. As I pointed out above, the solver stops with

Dear Professor Pfeifer,
thank you very much, I think now I got it clearly.

Have a nice day!