Error using TWO instruments in the Ramsey policy

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Error using TWO instruments in the Ramsey policy

Postby gio » Wed Sep 03, 2014 4:45 pm

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!
gio
 
Posts: 4
Joined: Wed Sep 03, 2014 4:14 pm

Re: Error using TWO instruments in the Ramsey policy

Postby jpfeifer » Wed Sep 03, 2014 4:59 pm

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.
Attachments
dyn_ramsey_static.m
(5.74 KiB) Downloaded 183 times
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Error using TWO instruments in the Ramsey policy

Postby gio » Wed Sep 03, 2014 6:36 pm

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!
gio
 
Posts: 4
Joined: Wed Sep 03, 2014 4:14 pm

Re: Error using TWO instruments in the Ramsey policy

Postby gio » Wed Sep 03, 2014 6:49 pm

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!
gio
 
Posts: 4
Joined: Wed Sep 03, 2014 4:14 pm

Re: Error using TWO instruments in the Ramsey policy

Postby jpfeifer » Mon Sep 08, 2014 8:10 pm

Wednesday's unstable version should have both issues fixed.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 4 guests

cron