Error using TWO instruments in the Ramsey policy


I am using the Ramsey policy solver in DYNARE 4.4.3.

Also note that I am using an external steady state file in which the steady-state values of all endogenous variables are saved in a vector named ys.

It works fine if I only use one instrument.

However I get an error message if I use two. My two instruments are G and TAU. In order compute the optimal policy I commented out the two rules for G and TAU and wrote:

planner_objective U;
ramsey_policy(planner_discount=bbeta, irf=0, instruments=(G TAU) );

where U is the per-period utility.

I get the following error messages:

Undefined function or variable "ys".

Error in dyn_ramsey_static (line 57)
        [inst_val,info1] = dynare_solve(nl_func,ys(k_inst),0);

Error in evaluate_steady_state (line 55)
        [ys,params] = dyn_ramsey_static(ys_init,M,options,oo);

Error in resol (line 104)
[dr.ys,M.params,info] = evaluate_steady_state(oo.steady_state,M,options,oo,0);

Error in stoch_simul (line 88)
    [oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);

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

Error in optinv_sec_ord (line 677)

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

I noticed that in dyn_ramsey_static.m there is an IF statement for the case in which there is only one instrument and for the case in which there are more.

if inst_nbr == 1
        inst_val = csolve(nl_func,oo.steady_state(k_inst),'',options_.solve_tolf,100);
        [inst_val,info1] = dynare_solve(nl_func,ys(k_inst),0);

Can the problem be here? Any idea on how to circumvent it?

Many thanks!

Could you please try the attached file. Alternatively, this bug should not be present in the unstable version. Note also bug #696 Essentially, Dynare won’t warn you if your steady state file is incorrect.
dyn_ramsey_static.m (5.74 KB)

Many thanks for your reply. However, I substituted the m file with the one you kindly attached and I get exactly the same error messages as earlier on. Would you advise using the unstable version? Thanks again!

Sorry I had not properly pasted the new file. It seems to be working now. I’ll let you know how it goes. Many thanks for your help!

Wednesday’s unstable version should have both issues fixed.