I want to characterize equilibrium dynamics under Ramsey optimal monetary policy (in a 2-sector model). The model seems to work fine when I use stoch_simul, but the ramsey_policy routine crashes.

First it throws out warnings like this:

Warning: Rank deficient, rank = 1, tol = 2.379566e-15.
> In dyn_ramsey_static>dyn_ramsey_static_1 at 148
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) at 39
In csolve at 60
In dyn_ramsey_static at 51
In evaluate_steady_state at 55
In resol at 108
In stoch_simul at 76
In ramsey_policy at 25
In oilpol at 654
In dynare at 120

Then I get the following error:

Error using print_info (line 63)
The steady state contains NaN or Inf
Error in stoch_simul (line 81)
print_info(info, options_.noprint);
Error in ramsey_policy (line 25)
info = stoch_simul(var_list);
Error in oilpol (line 654)
ramsey_policy(var_list_);
Error in dynare (line 120)
evalin('base',fname) ;

Can someone please tell me what the problem is? mod- and steady state files are attached (note that one has to select either standard simulation or ramsey at the top of the mod-file). oilpol.mod (8.92 KB) oilpol_steadystate.m (6.78 KB)

Your steady state file is not built for Ramsey with instruments. As the manual says, the steady state file must be conditional on the instruments. If rF is the instrument, the steady state file must take this value as given and provide the steady state for all other variables given the parameters and the value for rF. What your file does is overwrite and thus ignore the value for the instrument rF because you set it in steady state as a function of the deep parameters.

First of all, thank you for the invaluable effort you put down to help all of us here on the forum.

Regarding the instrument and steady state: Since the steady state nominal interest rate is given by RF = inflation/betta, I changed the instrument to gross inflation (PIcF) for convenience. Now, as I understand your comment, I have to take a candidate PIcF as input in the steady state file (it should be part of the input vector ys), and then solve for the rest of the (private economy) variables given that candidate. A colleague helped me to set that up (see line 32-38 in the new steady state file below).

However, I’m still not able to run the Ramsey command. I still get the warnings about rank deficiency followed by the error. I’m sure there is a simple solution to my problem (sorry for my blindness …), and would really appreciate any help.

Sorry for the long silence, but the issue turned out to be rather involved. I think I have fixed it now. Could you please replace the dynare\matlab files with the attached ones and try it once more. I hope Dynare 4.4.3 will contain a fix. dyn_ramsey_static.m (5.73 KB) evaluate_steady_state.m (12.6 KB) print_info.m (7.51 KB)