On Ramsey_Example.mod, by Johannes Pfeifer

Dear Professor Pfeifer and the rest of Dynare community,

I am an absolute beginner on Ramsey optimal policy and Dynare, so I understand that you might find that my questions are rather trivial. Regarding the Ramsey_Example.mod file, I would dare to pose a few questions:

  1. If I insert the command “resid(1)” on line 175, the residual for Equation 2 equals 0.009801. Is this acceptable, i.e. close enough to zero?

  2. If I also previously insert the command “steady(solve_algo = #)”, where # goes from 0 to 12 and 14, I obtain this error message “Error using print_info. The steadystate file did not compute the steady state (…)”. What am I doing wrong?

  3. Also, given that equations in the model block include the “[name =’…’]” instruction, why is it that, assuming that the “residuals(1)” command is used, the legends of the equations are not shown? The output only shows the number of each equation.

  4. How could I retrieve the values of the steady states both for i) the competitive equilibrium (for some exogenous R), and ii) the Ramsey optimal equilibrium (optimal R)?

  5. Lastly, assume that per capita variables in this economy grew at a positive rate in the steady state due to, say, some exogenous growth productivity. I understand that variables in the “model” block should be conveniently rewritten. Fine. But would this imply some change(s) for the “planner_objective” command?

Any feedback will be highly appreciated.

Cruz A. Echevarria

1+2. Commands like resid and steady belong after initval and in case of steady also after ramsey_model because otherwise planner_discount is not set.
3. That’s due to a bug. See resid: Fix display of name tags with Ramsey equations (!2017) · Merge requests · Dynare / dynare · GitLab. Thanks for pointing this out.
4. For a given R, you would need to execute your steady_state_model-block manually. For Ramsey, call steady after the ramsey_model-block.
5. That depends on the particular setup. For example, you may need to growth-adjust the planner_discount.

1 Like

Dear Professor Pfeifer,

First of all, thanks a lot for your immediate and certainly helpful response: it has allowed me to make some progress. Still, I would dare to ask you a couple of additional questions regarding the same example.

  1. After solving for the Ramsey optimal policy, I obtain that the “STEADY-STATE RESULTS” thing in the output is a 12 element vector. Fine. However, the “oo_.steady.state” vector contains 11 additional values. Is this explained somewhere? I mean, what do these extra elements stand for? I have not been able to find an explanation on what this vector contains in the context of Ramsey policies.

  2. Following your suggestion, this time I placed the “steady” and “resid(1)” commands after the “ramsey_model” command. Actually, this is clearly stated in the manual, but I overlooked it. So sorry. Convergence to the steady state is obtained. But if I use these two commands, then I get this error message when I attempt to run the “stoch_simul” command: “Error using stoch_simul stoch_simul:: perturbation solutions are not compatible with mixed complementarity problems and their solvers”. What am I doing wrong this time?

As usual, thanks for your help.

Cruz A. Echevarría

  1. Dynare will create auxiliary variables whose value will be contained in oo_.steady_state as well. For Ramsey that will include the Lagrange multipliers. You can see the mapping by looking at M_.endo_names.
  2. Did you specify a solve_algo for the steady-command?

Dear Professor Pfeifer,

  1. Crystal clear.

  2. Right. When the solve_algo command is suppressed, there is no such an error any more. I guess that this is not a big deal (I mean, nothing essential is forgone).

Thanks a lot Professor Pfeifer. I think that I can continue to apply this to my own stuff by myself from now on. Please consider this thread as closed.

Warm regards,
Cruz A. Echevarría

Which solve_algo did you use?

Hi Professor Pfeifer,

Thanks for your concern on this issue. This is the result:

  1. If solve_algo equals 0, 1, 2, 3, 4, 9, 12, 13 or 14, then there is no error message. By the way, the manual for the Dynare release 5.0, pp. 54-55 does not mention the solve_algo = 13 option.

  2. If solve_algo equals 5, 6, 7 or 8, then I obtain this error message: “Error using steady_STEADY: you can’t use solve_algo = {5,6,7,8} without block nor bytecode options (…)

  3. Finally, if solve_algo equals 10 or 11, then I obtain this error message: “Error using stoch_simul stoch_simul:: perturbation solutions are not compatible with mixed complementarity problems and their solvers (…)

By the way, were this relevant, I am using Dynare 5.0 (not Dynare 5.1 yet!) and Matlab 2022a on a Windows machine. Needless to say, I have no objection to share my code with you: I just started from your code, and then introduced some (I hope) minor changes such as output file, comments,…


I see. So you simply specified incompatible options and got the corresponding error messages. That is perfectly normal behavior.