How to use ramsey_constraints

Dear Professor Pfeifer,

I was wondering if I can ask you a question regarding how to impose ramsey_constraints. I know someone has asked a similar question on Dyanre forum before. However, by reading the old post I still cannot solve the problem I have.

I have a standard neoclassical model with endogenous labor supply and variable capital utilisation. Ramsey policy maker has three distortionary taxes: consumption, labor and capital income taxes. I would like to impose labor income tax to be nonnegative in both steady-state and dynamics. Therefore, I used ramsey_constraints as follows

ramsey_model(planner_discount=beta, instruments = (tauc,tauk,taul));
taul >= 0;

However, the restriction on the labor income tax is not imposed. Reading from your early post, this constraint only works with perfect foresight solver. Should I also need to change solve_algo=1 and stack_solve_algo=0 in the steady and simul, which are currently set as follows,

steady(solve_algo=1, maxit=2000);
simul(periods=1000, stack_solve_algo=0, maxit=10);

Please also find the full dynare code attached.

Best wishes,
Ramsey_tauc.mod (4.8 KB) Xiaoshan

It only works with solvers that can handle it. See

Dear Prof. Pfeifer,

Thanks for your reply and the example code attached. However, can I ask that does “ramsey_constraints” work to restraint policy instrument at the steady-state?

Furthermore, I have followed the example code and rewrote mine. However, it still does not seem to work. The perfect foresight solver took a long time and returned the following results.

Simulation of the perfect foresight model failed!Switching to a homotopy method…
Iter. | Lambda | status | Max. residual
1 | 0.50000 | failed | 4.714020e-01
2 | 0.25000 | failed | 3.062281e-01
3 | 0.12500 | failed | 4.531775e-01
4 | 0.06250 | failed | 3.113380e-01
5 | 0.03125 | failed | 3.737727e-01
6 | 0.01563 | failed | 2.777026e-01
7 | 0.00781 | failed | 3.675499e-01
8 | 0.00391 | failed | 3.912021e-01
9 | 0.00195 | failed | 5.055471e-01

I attached my revised code here. The model I am working with is very standard textbook neoclassical model. Using stack_solve_algo=0, the perfect foresight solution can be found very quickly.

However, when I switch to stack_solve_algo = 7, it returns the above message. Therefore, I am very surprised that such a standard model cannot be solved with perfect foresight solver.

Can you please have a look? I am very appreciated for your help.

Best wishes,
Ramsey_3rates.mod (4.3 KB)