Page 1 of 1

Error using TWO instruments in the Ramsey policy

PostPosted: Wed Sep 03, 2014 4:45 pm
by gio
Hi,

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:

Code: Select all
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:

Code: Select all
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)
ramsey_policy(var_list_);

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.

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


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

Many thanks!

Re: Error using TWO instruments in the Ramsey policy

PostPosted: Wed Sep 03, 2014 4:59 pm
by jpfeifer
Could you please try the attached file. Alternatively, this bug should not be present in the unstable version. Note also bug #696 https://github.com/DynareTeam/dynare/pull/696. Essentially, Dynare won't warn you if your steady state file is incorrect.

Re: Error using TWO instruments in the Ramsey policy

PostPosted: Wed Sep 03, 2014 6:36 pm
by gio
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!

Re: Error using TWO instruments in the Ramsey policy

PostPosted: Wed Sep 03, 2014 6:49 pm
by gio
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!

Re: Error using TWO instruments in the Ramsey policy

PostPosted: Mon Sep 08, 2014 8:10 pm
by jpfeifer
Wednesday's unstable version should have both issues fixed.