Optimal policy under commitment (Ramsey)

I was able to solve the model and find the steady state for my non-linear model. The next step, I need to find the optimal monetary policy that maximize the agent’s welfare! I used the following Ramsey’s policy command:

[code]planner_objective((C^(1-chii))/(1-chii)) + (((1-L)^(1-etta))/(1-etta));

ramsey_policy(planner_discount=0.99,order=1);[/code]

The consumption, C, here is a basket of home and foreign consumption, not sure if that matters! The thing is, I’m able to solve the model and find all the impulse response, however, once I replace stoch_simu command with ramsey_policy, I get the following error although as I mentioned the model had the right initial values. Thanks alot for your help!

[code] Starting Dynare (version 4.4.3).
Starting preprocessing of the model file …
Ramsey Problem: added 41 Multipliers.
Found 41 equation(s).
Found 82 FOC equation(s) for Ramsey Problem.
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Computing static model derivatives:
  • order 1
  • order 2
    Processing outputs …done
    Preprocessing completed.
    Starting MATLAB/Octave computing.

Warning: Some of the parameters have no value
(optimal_policy_discount_factor) when using steady. If these
parameters are not initialized in a steadystate file, Dynare
may not be able to solve the model…

In test_for_deep_parameters_calibration at 46
In steady at 33
In Dec04_2014_Ramsey at 961
In dynare at 180

STEADY: The Jacobian contains Inf or NaN. The problem arises from:

STEADY: Derivative of Equation 18 with respect to Variable L (initial value of L: 0.333333)
STEADY: Derivative of Equation 9 with respect to Variable R_star (initial value of R_star: 0.796659)
STEADY: Derivative of Equation 10 with respect to Variable lammbda (initial value of lammbda: 1.26196)
STEADY: Derivative of Equation 27 with respect to Variable lammbda (initial value of lammbda: 1.26196)
STEADY: Derivative of Equation 11 with respect to Variable pn_omega (initial value of pn_omega: 1)
STEADY: Derivative of Equation 12 with respect to Variable pd_omega (initial value of pd_omega: 1)
STEADY: Derivative of Equation 13 with respect to Variable pf_omega (initial value of pf_omega: 1)
STEADY: Derivative of Equation 27 with respect to Variable po_omega (initial value of po_omega: 1)
STEADY: Derivative of Equation 10 with respect to Variable rk (initial value of rk: 0.035101)
STEADY: Derivative of Equation 18 with respect to Variable k (initial value of k: 9.52399)
STEADY: Derivative of Equation 18 with respect to Variable A (initial value of A: 0)
STEADY: Derivative of Equation 18 with respect to Variable Y (initial value of Y: 1.11434)
STEADY: Derivative of Equation 10 with respect to Variable pi (initial value of pi: 1)
STEADY: Derivative of Equation 11 with respect to Variable pi (initial value of pi: 1)
STEADY: Derivative of Equation 12 with respect to Variable pi (initial value of pi: 1)
STEADY: Derivative of Equation 13 with respect to Variable pi (initial value of pi: 1)
STEADY: Derivative of Equation 14 with respect to Variable pi (initial value of pi: 1)
STEADY: Derivative of Equation 27 with respect to Variable pi (initial value of pi: 1)
STEADY: Derivative of Equation 31 with respect to Variable pi (initial value of pi: 1)
STEADY: Derivative of Equation 32 with respect to Variable pi (initial value of pi: 1)
STEADY: Derivative of Equation 29 with respect to Variable pi_d (initial value of pi_d: 1)
STEADY: Derivative of Equation 34 with respect to Variable pi_d (initial value of pi_d: 1)
STEADY: Derivative of Equation 38 with respect to Variable pi_d (initial value of pi_d: 1)
STEADY: Derivative of Equation 30 with respect to Variable pi_f (initial value of pi_f: 1)
STEADY: Derivative of Equation 35 with respect to Variable pi_f (initial value of pi_f: 1)
STEADY: Derivative of Equation 39 with respect to Variable pi_f (initial value of pi_f: 1)
STEADY: Derivative of Equation 2 with respect to Variable pi_star (initial value of pi_star: 1)
STEADY: Derivative of Equation 27 with respect to Variable pi_star (initial value of pi_star: 1)
STEADY: Derivative of Equation 31 with respect to Variable pi_star (initial value of pi_star: 1)
STEADY: Derivative of Equation 32 with respect to Variable pi_star (initial value of pi_star: 1)
STEADY: Derivative of Equation 31 with respect to Variable s (initial value of s: 0.833333)
STEADY: Derivative of Equation 32 with respect to Variable s (initial value of s: 0.833333)
STEADY: Derivative of Equation 18 with respect to Variable q (initial value of q: 0.833333)
STEADY: Derivative of Equation 34 with respect to Variable pd_bar (initial value of pd_bar: 1)
STEADY: Derivative of Equation 35 with respect to Variable pf_bar (initial value of pf_bar: 1)
STEADY: Derivative of Equation 29 with respect to Variable j1 (initial value of j1: 2.8871)
STEADY: Derivative of Equation 34 with respect to Variable j1 (initial value of j1: 2.8871)
STEADY: Derivative of Equation 30 with respect to Variable j2 (initial value of j2: 0.412647)
STEADY: Derivative of Equation 35 with respect to Variable j2 (initial value of j2: 0.412647)
STEADY: Derivative of Equation 40 with respect to Variable Qs (initial value of Qs: 0.150072)
Reference to non-existent field ‘orig_index’.

Error in dynare_solve (line 53)
orig_var_index=M.aux_vars(1,infcol(ii)-M.orig_endo_nbr).orig_index;

Error in evaluate_steady_state (line 66)
[ys,check] = dynare_solve([M.fname ‘_static’],…

Error in steady_ (line 54)
[steady_state,params,info] =
evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);
Error in steady (line 81)
[steady_state,M_.params,info] = steady_(M_,options_,oo_);

Error in Dec04_2014_Ramsey (line 961)
steady;

Error in dynare (line 180)
evalin(‘base’,fname) ;

EDU>> [/code]

1 Like

You cannot use the steady-command when calling Ramsey.

1 Like

Thanks alot for your tremendous help! Highly appreciated! So I use the same objective function I mentioned earlier. With the Ramesy command I get the following results, please point out any odd thing you see!:

[code]STEADY-STATE RESULTS:

kappa 1.0101
b_star -2.59434
v 0
I -1.51698
C -0.10368
Cn -0.151335
Cm -3.165
L -1.18053
R_star 0
lammbda 0.15552
pn_omega -0.00909333
pd_omega 0.228823
pf_omega -0.697749
pm_omega 0.163966
R 0.0100503
rk -3.34953
w 0.578265
k 2.17189
A 0
Z 0.11412
Zn -0.0211192
Y 0.0263423
Yf -0.763383
Yd -0.532274
Yx -0.822289
Yo -2.2749
pi 0
pi_n 0
pi_d 0
pi_f 0
pi_star 0
s -0.182322
q -0.182322
pd_bar 0
pf_bar 0
n1 0.718865
n2 -0.07086
j1 0.901187
j2 0.111462
Sd 1.61939
Qs 0.195522
Y_star 0
pi_o 0
Warning: Matrix is close to singular or
badly scaled. Results may be inaccurate.
RCOND = 9.239227e-19.

In evaluate_planner_objective at 71
In ramsey_policy at 40
In Ramsey_Policy at 1024
In dynare at 180

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

Total computing time : 0h00m11s
Note: 1 warning(s) encountered in the preprocessor
Note: warning(s) encountered in MATLAB/Octave code
EDU>> [/code]

I have the following questions:

  1. Under “STEADY-STATE RESULTS” I see different steady state values for some variables than the one I solved and used as initial values , is that normal? and how different are they than the one I solved? I also get that “Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 9.239227e-19” some posts here say that it should not be a problem but not sure.

  2. I used the utility function as the planner objective function, and I got negative value as reported above, is that normal? are we supposed to see positive value?

  3. I noticed that some codes use the “utility function” as a variable in the model and and specified different function for the planner objective function for Ramsey command like " pi^2+C^2" and claim that the objective now is minimizing the variance of consumption and inflation… can someone elaborate on that? whats the point of adding utility function as variables and how does the objective now minimize the variance? Thanks and I appreciate any feedback.

  1. In principle the optimal Ramsey policy can affect steady states. For example, in a simple New Keynesian framework where the government picks the nominal interest rate, the optimal inflation rate follows from the problem. This inflation rate will at least affect some steady states. Regarding the singularity: this is hard to judge. Try running model_diagnostics after Ramsey. Maybe it reveals new information.

  2. Think about a utility function like beta*(log©+psi*log(1-l)). Typically, c and l are between 0 and 1 (output is often about 1 in most models). Taking logs means that these numbers will be negative. This is to be expected. To avoid numerical problems when taking logs of small numbers, it is often advisable to scale up output by a multiplicative factor when using constant returns to scale production functions. This multiplicative constant will not change anything.

  3. Putting an ad-hoc objective means that people are rather manually using a second-order approximation to the utility function (see for example Gali (2008), Chapter 4). There people care about consumption, but up to second order, the welfare depends on inflation and output fluctuations as measured by their variance. The relative weights between the two variances can be determined from the model. Following this insight, some people have used relatively simple loss functions of the type you describe rather than going for the full optimal welfare.

2 Likes

I really truly appreciated your help… This cleared up alot of confusion I had… the thing is my utility function is not a log function and still the approximated value of planner objective function is negative … is that normal?

Take a CRRA utility function with risk aversion 2 and let consumption be 0.3. Then
u= 0.3^(1-2)/(1-2)=-3.333
which is negative.

1 Like

First, thank you very much for all the help!

I have two questions:

I am considering a CB objective function that minimize a weighted sum of variances of inflation and output as the following:

planner_objective(200*(pi-pi_ss)^2 + 100*(Y-Y_ss)^2); ramsey_policy(planner_discount=0.99, order=1) ;

Does that specification look ok?

I do have the monetary policy rule in the code as following:

code=((exp(Y)/Y_ss)^rho_Y)*((exp(pi)/pi_ss)^rho_pi);
[/code]

However, in order to run ramsey_policy, I need to set the values for the policy coefficient rho_pi and rho_Y but how do I find the optimal policy coefficient that minimize the CB objective function? I understand that osr helps with that but I want to consider the case under commitment.

  1. Yes, that looks OK.
  2. I don’t understand your question. If you are looking Ramsey policy of the central bank, then R is the policy instrument. There is no reason the central bank would commit to a Taylor rule as OSR would do. Rather, you should specify R as the instrument and drop the Taylor rule. Note that you need to specify a conditional steady state file. See the manual for details.

I had the same problem as dynare2014. When I run the “stoch_simul(order=2)” to my model, it works fine. Residuals of the static equations are all zero and it returns the IRFs. But when I replace the “stoch_simul” by “ramsey_policy”, it returns the following error message:

Starting Dynare (version 4.4.3).
Starting preprocessing of the model file ...
Ramsey Problem: added 59 Multipliers.
Substitution of exo leads: added 1 auxiliary variables and equations.
Found 59 equation(s).
Found 120 FOC equation(s) for Ramsey Problem.
Evaluating expressions...done
Computing static model derivatives:
 - order 1
Computing dynamic model derivatives:
 - order 1
 - order 2
Computing static model derivatives:
 - order 1
 - order 2
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.





Residuals of the static equations:

Equation number 1 : NaN
Equation number 2 : NaN
Equation number 3 : NaN
Equation number 4 : NaN
Equation number 5 : 0
Equation number 6 : 0
Equation number 7 : NaN
Equation number 8 : 0
Equation number 9 : NaN
Equation number 10 : NaN
Equation number 11 : NaN
Equation number 12 : NaN
Equation number 13 : NaN
Equation number 14 : 0
Equation number 15 : NaN
Equation number 16 : NaN
Equation number 17 : 0
Equation number 18 : 0
Equation number 19 : 0
Equation number 20 : 0
Equation number 21 : 0
Equation number 22 : NaN
Equation number 23 : NaN
Equation number 24 : NaN
Equation number 25 : NaN
Equation number 26 : 0
Equation number 27 : 0
Equation number 28 : 0
Equation number 29 : 0
Equation number 30 : 0
Equation number 31 : 0
Equation number 32 : NaN
Equation number 33 : NaN
Equation number 34 : NaN
Equation number 35 : 0
Equation number 36 : 0
Equation number 37 : 1
Equation number 38 : NaN
Equation number 39 : 0
Equation number 40 : 0
Equation number 41 : 0
Equation number 42 : 0
Equation number 43 : NaN
Equation number 44 : NaN
Equation number 45 : 0
Equation number 46 : NaN
Equation number 47 : NaN
Equation number 48 : 0
Equation number 49 : 0
Equation number 50 : 0
Equation number 51 : NaN
Equation number 52 : 0
Equation number 53 : 0
Equation number 54 : 0
Equation number 55 : 0
Equation number 56 : 0
Equation number 57 : 0
Equation number 58 : 0
Equation number 59 : 0
Equation number 60 : 0



STEADY:  The Jacobian contains Inf or NaN. The problem arises from: 

STEADY:  Derivative of Equation 1 with respect to Variable c  (initial value of c: 3.15605) 
STEADY:  Derivative of Equation 2 with respect to Variable lambda  (initial value of lambda: 0.204888) 
STEADY:  Derivative of Equation 4 with respect to Variable lambda  (initial value of lambda: 0.204888) 
STEADY:  Derivative of Equation 33 with respect to Variable lambda  (initial value of lambda: 0.204888) 
STEADY:  Derivative of Equation 34 with respect to Variable lambda  (initial value of lambda: 0.204888) 
STEADY:  Derivative of Equation 2 with respect to Variable R  (initial value of R: 1.00503) 
STEADY:  Derivative of Equation 4 with respect to Variable R  (initial value of R: 1.00503) 
STEADY:  Derivative of Equation 47 with respect to Variable R  (initial value of R: 1.00503) 
STEADY:  Derivative of Equation 2 with respect to Variable pi  (initial value of pi: 1) 
STEADY:  Derivative of Equation 3 with respect to Variable pi  (initial value of pi: 1) 
STEADY:  Derivative of Equation 4 with respect to Variable pi  (initial value of pi: 1) 
STEADY:  Derivative of Equation 22 with respect to Variable pi  (initial value of pi: 1) 
STEADY:  Derivative of Equation 23 with respect to Variable pi  (initial value of pi: 1) 
STEADY:  Derivative of Equation 47 with respect to Variable pi  (initial value of pi: 1) 
STEADY:  Derivative of Equation 2 with respect to Variable q  (initial value of q: 1) 
STEADY:  Derivative of Equation 10 with respect to Variable q  (initial value of q: 1) 
STEADY:  Derivative of Equation 10 with respect to Variable inv  (initial value of inv: 4.14831) 
STEADY:  Derivative of Equation 25 with respect to Variable delta_p  (initial value of delta_p: 1) 
STEADY:  Derivative of Equation 25 with respect to Variable Kp  (initial value of Kp: 4.54102) 
STEADY:  Derivative of Equation 16 with respect to Variable Fp  (initial value of Fp: 5.44922) 
STEADY:  Derivative of Equation 25 with respect to Variable Fp  (initial value of Fp: 5.44922) 
STEADY:  Derivative of Equation 2 with respect to Variable rk  (initial value of rk: 0.0550251) 
STEADY:  Derivative of Equation 16 with respect to Variable pistar  (initial value of pistar: 1) 
STEADY:  Derivative of Equation 22 with respect to Variable p_H  (initial value of p_H: 1) 
STEADY:  Derivative of Equation 23 with respect to Variable p_F  (initial value of p_F: 1) 
STEADY:  Derivative of Equation 24 with respect to Variable p_H_star  (initial value of p_H_star: 1) 
STEADY:  Derivative of Equation 11 with respect to Variable pi_H  (initial value of pi_H: 1) 
STEADY:  Derivative of Equation 12 with respect to Variable pi_H  (initial value of pi_H: 1) 
STEADY:  Derivative of Equation 13 with respect to Variable pi_H  (initial value of pi_H: 1) 
STEADY:  Derivative of Equation 16 with respect to Variable pi_H  (initial value of pi_H: 1) 
STEADY:  Derivative of Equation 25 with respect to Variable pi_H  (initial value of pi_H: 1) 
STEADY:  Derivative of Equation 2 with respect to Variable R_star  (initial value of R_star: 1.00503) 
STEADY:  Derivative of Equation 33 with respect to Variable R_star  (initial value of R_star: 1.00503) 
STEADY:  Derivative of Equation 34 with respect to Variable R_star  (initial value of R_star: 1.00503) 
STEADY:  Derivative of Equation 43 with respect to Variable R_star  (initial value of R_star: 1.00503) 
STEADY:  Derivative of Equation 44 with respect to Variable R_star  (initial value of R_star: 1.00503) 
STEADY:  Derivative of Equation 2 with respect to Variable pi_star  (initial value of pi_star: 1) 
STEADY:  Derivative of Equation 24 with respect to Variable pi_star  (initial value of pi_star: 1) 
STEADY:  Derivative of Equation 32 with respect to Variable pi_star  (initial value of pi_star: 1) 
STEADY:  Derivative of Equation 33 with respect to Variable pi_star  (initial value of pi_star: 1) 
STEADY:  Derivative of Equation 34 with respect to Variable pi_star  (initial value of pi_star: 1) 
STEADY:  Derivative of Equation 43 with respect to Variable pi_star  (initial value of pi_star: 1) 
STEADY:  Derivative of Equation 44 with respect to Variable pi_star  (initial value of pi_star: 1) 
STEADY:  Derivative of Equation 32 with respect to Variable e  (initial value of e: 1) 
STEADY:  Derivative of Equation 34 with respect to Variable e  (initial value of e: 1) 
STEADY:  Derivative of Equation 43 with respect to Variable e  (initial value of e: 1) 
STEADY:  Derivative of Equation 44 with respect to Variable e  (initial value of e: 1) 
STEADY:  Derivative of Equation 32 with respect to Variable b_f  (initial value of b_f: 7.30436) 
STEADY:  Derivative of Equation 32 with respect to Variable b_fr  (initial value of b_fr: 3.65218) 
STEADY:  Derivative of Equation 46 with respect to Variable tau  (initial value of tau: 1.83527) 
STEADY:  Derivative of Equation 47 with respect to Variable tau  (initial value of tau: 1.83527) 
STEADY:  Derivative of Equation 3 with respect to Variable b_g  (initial value of b_g: 5.47827) 
STEADY:  Derivative of Equation 46 with respect to Variable b_g  (initial value of b_g: 5.47827) 
STEADY:  Derivative of Equation 47 with respect to Variable b_g  (initial value of b_g: 5.47827) 
Reference to non-existent field 'orig_index'.
Error in dynare_solve (line 53)
                orig_var_index=M.aux_vars(1,infcol(ii)-M.orig_endo_nbr).orig_index;
Error in evaluate_steady_state (line 66)
            [ys,check] = dynare_solve([M.fname '_static'],...
Error in resol (line 104)
[dr.ys,M.params,info] = evaluate_steady_state(oo.steady_state,M,options,oo,0);
Error in check (line 73)
[dr,info,M,options,oo] = resol(1,M,options,oo);
Error in benchmark (line 1246)
oo_.dr.eigval = check(M_,options_,oo_);
Error in dynare (line 180)
evalin('base',fname) ; 

Not including resid(1) and steady did not fix this problem. My impression is that I need to provide steady state values of model variables (including Lagrangian multipliers) for the ramsey FOCs, which will be different compare to the model FOCs. Am I correct on this?

If I provide the ramsey FOCs in the first place and just solve the ramsey model to a second order, would that give me the optimal policy and welfare evaluation as ramsey_policy does?

Please comment on my post, thank you!

With stoch_simul you have as many equations as endogenous variables. Thus, computing steady states is possible.
With ramsey, there is one fewer equation, making it impossible to compute a steady state. However, when using the instruments option of the Ramsey command, Dynare will provide a value for the instrument (and thereby the value for the missing equation). Your job is then to provide a steady state conditional on the value for this instrument. As I don’t know your mod-file, it is hard to say what the problem is.

2 Likes

Thank you for the reply, jpfeifer! I tried to write a steady_state_model block that takes the value of the instruments but the following error occurs:

[code]Warning: Rank deficient, rank = 41, tol = 4.914420e-12.

In dyn_ramsey_static>dyn_ramsey_static_1 at 152
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) at 40
In csolve at 60
In dyn_ramsey_static at 55
In evaluate_steady_state at 55
In resol at 104
In stoch_simul at 88
In ramsey_policy at 25
In benchramsey at 950
In dynare at 180
Warning: Rank deficient, rank = 41, tol = 4.914420e-12.
In dyn_ramsey_static>dyn_ramsey_static_1 at 152
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) at 40
In csolve at 80
In dyn_ramsey_static at 55
In evaluate_steady_state at 55
In resol at 104
In stoch_simul at 88
In ramsey_policy at 25
In benchramsey at 950
In dynare at 180
Warning: Rank deficient, rank = 41, tol = 4.914420e-12.
In dyn_ramsey_static>dyn_ramsey_static_1 at 152
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) at 40
In csolve at 112
In dyn_ramsey_static at 55
In evaluate_steady_state at 55
In resol at 104
In stoch_simul at 88
In ramsey_policy at 25
In benchramsey at 950
In dynare at 180
Warning: Rank deficient, rank = 41, tol = 4.914420e-12.
In dyn_ramsey_static>dyn_ramsey_static_1 at 152
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) at 40
In dyn_ramsey_static at 62
In evaluate_steady_state at 55
In resol at 104
In stoch_simul at 88
In ramsey_policy at 25
In benchramsey at 950
In dynare at 180
Error using print_info (line 54)
One of the eigenvalues is close to 0/0 (the absolute value of numerator and
denominator is smaller than 1e-06!
If you believe that the model has a unique solution you can try to reduce the value
of qz_zero_threshold.

Error in stoch_simul (line 98)
print_info(info, options_.noprint, options_);

Error in ramsey_policy (line 25)
info = stoch_simul(var_list);

Error in benchramsey (line 950)
ramsey_policy(var_list_);

Error in dynare (line 180)
evalin(‘base’,fname) ;[/code]

Again, stoch_simul works fine. This problem only appears when I use ramsey_policy. I am attaching my .mod file. Any help would be appreciated!

Have you tried running model_diagnostics on your stoch_simul model? It seems there is a singularity.

I tried running model_diagnostics on my stoch_simul model and no error or warning messages appeared. The IRFs and theoretical moments look ok too.

This seems to be an economic issue. Upon computing the Ramsey policy, model_diagnostics returns a singularity problem. Could it be that you replaced a mechanism that make the model stationary (deviation from target level for debt) by something essentially unrestricted so that the Ramsey policy inherits the unit root property of the net asset position in linear models? In this case, I might be that the steady state for the Ramsey policy is not unique, because any debt level is feasible.

jpfeifer, I think you are right. Thank you for the help!