external steady-state.m file doesn't work for optimal 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.

external steady-state.m file doesn't work for optimal policy

Postby nk178 » Fri Jul 31, 2015 12:16 pm

Dear all,

I use an external .m file (and the fsolve) to calculate the parameter values for a log-linearised by hand model. While the external file works properly when I solve for the ifrs of the model, it does not work when I try to solve for the optimal (Ramsey) policy.

The message error is the following

Improper assignment with rectangular empty matrix.
Error in csolve (line 80)
grad(:,i) = (feval(FUN,x+tvec(:,i),varargin{:})-f0)/delta;
Error in dyn_ramsey_static (line 55)
inst_val = csolve(nl_func,oo.steady_state(k_inst),'',options_.solve_tolf,100);
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 NK_ff_optimal (line 737)
ramsey_policy(var_list_);
Error in dynare (line 180)
evalin('base',fname) ;

while before I get a warning that my parameters have no value. I guess that means that the .mod file does not take the parameter values from the .m file ( I have done everything correctly like setting the same on each file with the extension steadystate for the .m file etc)

Thank you very much in advance
nk178
 
Posts: 32
Joined: Sat May 24, 2014 1:05 pm

Re: external steady-state.m file doesn't work for optimal po

Postby jpfeifer » Fri Jul 31, 2015 2:06 pm

That's because your steady state for Ramsey needs to be written conditional on the value for the instrument. For every value of the instrument given by Dynare, you need to provide the corresponding steady state values. Steady state files for the regular model in contrast compute the steady state for the instrument endogenously. For example, if the nominal interest rate is your instrument, in Ramsey you need to provide the corresponding steady state for inflation. In the regular model, you would have a parameter for steady state inflation that determined both the interest rate and steady state inflation.
An example is here: https://github.com/DynareTeam/dynare/blob/master/tests/optimal_policy/Ramsey/ramsey_ex.mod
------------
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: external steady-state.m file doesn't work for optimal po

Postby nk178 » Fri Jul 31, 2015 3:10 pm

That is brilliant. Thank you once again Johannes.

Best,
nk178
 
Posts: 32
Joined: Sat May 24, 2014 1:05 pm


Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 5 guests