Levin's code for Ramsey policy


Since the ramsey_policy in dynare does not work on the second-order approximation, I tried the code by Levin. However, when I run the example in the package, Bestsw.mod, it shows the error message:

??? Error using ==> dynare at 19
ERROR: there are 91 equations for 195 endogenous var

Some people had this problem before, and said it might be caused by the different ways of parse in the newer version. So I tried the older version such as v3.042, it still didn’t work. I tried my own code, it shows there are 40 equations for 48 endogenous var (37 endogenous, 3 exogenous plus 8 stochastic shocks).

Can anybody tell me why this problem would occur, and which version of dynare would be more appropriate for running Levin’s code, given that it does not work for dynare 4.2?

Or is there any other way to obtain optimal policy from the second-order approximation?

Thanks in advance!


Levin’s code is good for Dynare version 3, not for version 4. There is an option in dynare to compute the Ramsey policy, but I forgot what it is called, probably ramsey_policy or osr.

Hi bigbigben,

Thanks for your reply. However, as far as I know, the ramsey_policy command in dynare does not compute the second-order approximation. This is why I need to go for Levin’s code.