Challenge with Ramsey Policy

Dear Prof. Pfeifer,

I am attempting to solve the Ramsey policy of a rent-seeking policymaker in a DSGE model with heterogenous households and firms. Upon solving with Dynare 4.5.7, I get the warning and error messages saying:

warning: division by zero

error: Ramsey: The steady state file computation for the Ramsey problem resulted in NaNs at the initial values of the instruments.

II have attached the codes. Please could you help go through it to point out the source(s) of this error?
csae3.mod (2.7 KB)

Your steady state uses W before you ever set it.

Thank you, Prof.,

I have adjusted W in the steady_state as you suggested but it still gives the error message:

Ramsey: The steady state file computation for the Ramsey problem resulted in NaNs at the initial values of the instruments

csae3.mod (2.7 KB)

Now you are using Y_r/N_r and both have not been set. Essentially do the following:

Thank you Prof. Pfeifer.

Dear Prof. Pfeifer,

  1. After battIing with providing the accurate conditional steady-state of the Ramsey problem, I resorted to running a Linear Quadratic Ramsey code which resulted in the non-zero steady-state values below:
    STEADY-STATE RESULTS:

R -0.0783676
W_r 2.51745
W_nr 0.31774
N_r 0.715531
N_nr -0.0353552
RN 2.58452
Y_r -0.30829
Y_nr 0.236298
G 0.728033
AG 1.05565
Pii_rstar -0.0783676
Pii_nrstar -0.0783676
A 0
L -2.677
Pii -0.0783676
Y 0.0783676
b 0.0626941
or 0

Approximated value of planner objective function
- with initial Lagrange multipliers set to 0: 6.6089
- with initial Lagrange multipliers set to steady state: 6.8

Does this make sense since I should be getting steady state values of 0 in a linear model?

  1. Secondly, I ran another Linear Ramsey code where I obtained steady state values of 0. Does this imply that the steady state is non-distorted?

Thank You.

Is your objective purely quadratic? Or does it contain a linear term?

The objective function is quadratic. It was stated as:
planner_objective((gamma_c*(y_r^2))+((1-gamma_c)*(y_nr^2)));

In a linear model, you cannot tell whether the steady state is distorted or not. That is the reason why you generally cannot work with linear models for optimal policy.

It is strange that in a pure linear quadratic case you get non-zero steady states

Thank you, Prof.,

I must have obtained non-zero steady states in the linear-quadratic model because there were Nans in the resid. Going forward, I’ll complement my analysis with the OSR routine.