Page 2 of 2

Re: Ramsey Policy

PostPosted: Mon May 09, 2016 3:07 pm
by jd1090
When running the model with a simple Taylor rule, the real interest rate is equal to the nominal interest rate in the zero inflation steady state (see code attached), where the gross real interest rate is defined by the usual Fisher equation:

Code: Select all
RI=(exp(i))/PI_CPI;


And the resulting IRFs are smooth and well behaved.

Unless you were asking me if the model really works for anything other than the zero inflation steady state, to which the answer is probably - no, but I'm not quite sure how one should incorpotate that into the model and why that would be a sensible solution in this scenario. Is there a simple example available at hand?

Re: Ramsey Policy

PostPosted: Tue May 10, 2016 9:14 am
by jpfeifer
What I am saying: you use the nominal interest rate as your instrument. Optimal policy entails among other things selecting the steady state of the nominal interest rate. If this steady state is smaller or bigger than the real interest rate, this implies non-zero steady state inflation via the Fisher equation. If your model cannot handle this, you are in trouble.
Why this is sensible: when you look at simple classical monetary models with money in the utility function, the Friedman rule is optimal (0 nominal interest rate). As Schmitt-Grohe/Uribe have shown in a series of papers in the mid-2000s, in New Keynesian models with frictions, there are other mechanisms at work, but 0 inflation is typically not the efficient steady state. So you have to think about this possibility and potentially account for it in your model.

Re: Ramsey Policy

PostPosted: Fri Jul 15, 2016 9:37 am
by jd1090
Hello again,

After months of focusing on other projects, I've decided to give this problem another go. I managed to specify the steady state of the model conditional on any rate of inflation/deflation (it works with stoch simul), but now I receive an error related to the planner discount:

dynare gm_ramsey.mod

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Using 64-bit preprocessor
Starting Dynare (version 2016-04-24).
Starting preprocessing of the model file ...
WARNING: in the 'steady_state_model' block, variable 'PI' is not assigned a value
Ramsey Problem: added 34 Multipliers.
Substitution of endo leads >= 2: added 1 auxiliary variables and equations.
Substitution of endo lags >= 2: added 1 auxiliary variables and equations.
Found 34 equation(s).
Found 71 FOC equation(s) for Ramsey Problem.
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Computing static model derivatives:
- order 1
- order 2
- order 3
Processing outputs ...
done
Preprocessing completed.

Warning: Some of the parameters have no value (optimal_policy_discount_factor) when using model_diagnostics. If
these parameters are not initialized in a steadystate file or a steady_state_model-block, Dynare may not be able
to solve the model...
Warning: Either you have not correctly initialized planner_discount or you are calling a command like steady or
stoch_simul that is not allowed in the context of ramsey_policy
MODEL_DIAGNOSTICS: The steady state cannot be computed
Warning: Rank deficient, rank = 33, tol = 2.498569e-12.
> In dyn_ramsey_static_dyn_ramsey_static_1 (line 152)
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) (line 43)
In csolve (line 60)
In dyn_ramsey_static (line 58)
In evaluate_steady_state (line 120)
In resol (line 104)
In stoch_simul (line 83)
In ramsey_policy (line 25)
In gm_ramsey (line 582)
In dynare (line 223)
Warning: Rank deficient, rank = 33, tol = 2.498583e-12.
> In dyn_ramsey_static_dyn_ramsey_static_1 (line 152)
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) (line 43)
In csolve (line 80)
In dyn_ramsey_static (line 58)
In evaluate_steady_state (line 120)
In resol (line 104)
In stoch_simul (line 83)
In ramsey_policy (line 25)
In gm_ramsey (line 582)
In dynare (line 223)
Warning: Rank deficient, rank = 33, tol = 2.498605e-12.
> In dyn_ramsey_static_dyn_ramsey_static_1 (line 152)
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) (line 43)
In csolve (line 112)
In dyn_ramsey_static (line 58)
In evaluate_steady_state (line 120)
In resol (line 104)
In stoch_simul (line 83)
In ramsey_policy (line 25)
In gm_ramsey (line 582)
In dynare (line 223)
Warning: Rank deficient, rank = 33, tol = 2.498605e-12.
> In dyn_ramsey_static_dyn_ramsey_static_1 (line 152)
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) (line 43)
In dyn_ramsey_static (line 70)
In evaluate_steady_state (line 120)
In resol (line 104)
In stoch_simul (line 83)
In ramsey_policy (line 25)
In gm_ramsey (line 582)
In dynare (line 223)
Error using print_info (line 54)
One of the eigenvalues is close to 0/0 (the absolute value of numerator and denominator is smaller than 1e-06!
If you believe that the model has a unique solution you can try to reduce the value of qz_zero_threshold.

Error in stoch_simul (line 94)
print_info(info, options_.noprint, options_);

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

Error in gm_ramsey (line 582)
ramsey_policy(var_list_);

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


Note that I am not using neither steady nor stoch_simul anywhere in my .mod file. It also gives rise to eigenvalue problems (none of which are encountered in stoch_simul with any Taylor rule), so I'm hoping this is something trivial.

Thanks ever so much in advance (.mod file is attached as usual).

Re: Ramsey Policy

PostPosted: Fri Jul 15, 2016 5:25 pm
by jpfeifer
You cannot easily use the model_diagnostics-command (which calls steady) with Ramsey. That is where the message appears. Please focus on
WARNING: in the 'steady_state_model' block, variable 'PI' is not assigned a value

Maybe that is already the reason.

Re: Ramsey Policy

PostPosted: Fri Jul 15, 2016 6:15 pm
by jd1090
Yes I have tried running it without the model diagnostics, but it still gives rise to 0/0 eigenvalue problem (but only with Ramsey!). Let me try to explain my approach a little bit better. PI stands of inflation. Inflation is the chosen instrument (replacing the Taylor rule). The steady state is conditional on the value of the instrument (meaning, it will work for any value of PI). When running the Ramsey version of this model, the initial value for PI is set in the initval block (as instructed before) and it is free to move around as the Ramsey algorithm sees fit (with a Taylor rule, it is specified in the steady_state_model block). Any further comments would be much appreciated.

Re: Ramsey Policy

PostPosted: Fri Jul 22, 2016 8:54 am
by jd1090
I resolved the 0/0 eigenvalue problem, but Blanchard Kahn conditions fail to hold using the ramsey_policy function. I tried various timings of the variables, but nothing changes the outcome. If it is to do with the warning:

in the 'steady_state_model' block, variable 'PI' is not assigned a value


then how do I specify PI other than in the initval block? I also tried to initialise it in the steady_state_model block, but although the warning disappears, the BK conditions still don't hold (there is no stable equilibrium).

I doubt that this is an economic issue given that the file runs very smoothly with other MP rules (and as an example I included a simple Taylor rule in the .mod file below). The error also looks very similar to the ones observed in the 4.4.3 version of dynare even though I am using the unstable version:

Using 64-bit preprocessor
Starting Dynare (version 2016-04-24).
Starting preprocessing of the model file ...
Ramsey Problem: added 34 Multipliers.
Substitution of endo leads >= 2: added 1 auxiliary variables and equations.
Substitution of endo lags >= 2: added 1 auxiliary variables and equations.
Found 34 equation(s).
Found 71 FOC equation(s) for Ramsey Problem.
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Computing static model derivatives:
- order 1
- order 2
- order 3
Processing outputs ...
done
Preprocessing completed.

Warning: Rank deficient, rank = 33, tol = 2.256579e-10.
> In dyn_ramsey_static_dyn_ramsey_static_1 (line 152)
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) (line 43)
In csolve (line 60)
In dyn_ramsey_static (line 58)
In evaluate_steady_state (line 120)
In resol (line 104)
In stoch_simul (line 83)
In ramsey_policy (line 25)
In fm_ramsey (line 578)
In dynare (line 223)
Warning: Rank deficient, rank = 33, tol = 2.256579e-10.
> In dyn_ramsey_static_dyn_ramsey_static_1 (line 152)
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) (line 43)
In csolve (line 80)
In dyn_ramsey_static (line 58)
In evaluate_steady_state (line 120)
In resol (line 104)
In stoch_simul (line 83)
In ramsey_policy (line 25)
In fm_ramsey (line 578)
In dynare (line 223)
Warning: Rank deficient, rank = 33, tol = 2.256579e-10.
> In dyn_ramsey_static_dyn_ramsey_static_1 (line 152)
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) (line 43)
In csolve (line 112)
In dyn_ramsey_static (line 58)
In evaluate_steady_state (line 120)
In resol (line 104)
In stoch_simul (line 83)
In ramsey_policy (line 25)
In fm_ramsey (line 578)
In dynare (line 223)
Warning: Rank deficient, rank = 33, tol = 2.256579e-10.
> In dyn_ramsey_static_dyn_ramsey_static_1 (line 152)
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) (line 43)
In csolve (line 112)
In dyn_ramsey_static (line 58)
In evaluate_steady_state (line 120)
In resol (line 104)
In stoch_simul (line 83)
In ramsey_policy (line 25)
In fm_ramsey (line 578)
In dynare (line 223)
Warning: Rank deficient, rank = 33, tol = 2.256579e-10.
> In dyn_ramsey_static_dyn_ramsey_static_1 (line 152)
In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) (line 43)
In dyn_ramsey_static (line 70)
In evaluate_steady_state (line 120)
In resol (line 104)
In stoch_simul (line 83)
In ramsey_policy (line 25)
In fm_ramsey (line 578)
In dynare (line 223)
Error using print_info (line 42)
Blanchard Kahn conditions are not satisfied: no stable equilibrium
Error in stoch_simul (line 94)
print_info(info, options_.noprint, options_);
Error in ramsey_policy (line 25)
info = stoch_simul(var_list);
Error in fm_ramsey (line 578)
ramsey_policy(var_list_);
Error in dynare (line 223)
evalin('base',fname) ;


Is there anything that could possibly be wrong with my .mod file? Thanks

Re: Ramsey Policy

PostPosted: Tue Aug 02, 2016 9:39 am
by jpfeifer
Sorry for the late response. I had to check back with Michel Juillard.

1. You must not include the welfare definition in the model when using Ramsey as this will create a singularity. The reason is that the planner objective will use that equation as well.
2. It seems the "optimal value" for inflation is not feasible in your model. It seems to be 1.06, but already values for PI like 1.05 result in a complex steady state. This prevents Dynare from getting to a proper maximum. An additional complication is that the standard tolerance for solving the Ramsey problem of about 1e-6 is too coarse for your problem, implying that the solver does not move away from feasible starting values. When you try PI=0.8 in initval after getting rid of welfare in your model block, you will get a solution very close to 0.8.

Re: Ramsey Policy

PostPosted: Wed Aug 03, 2016 11:22 am
by jd1090
Thank you ever so much for your response.

I'll have another look into the derivations, maybe I can fiddle around with how the model is specified to come up with something more fruitful.

One more question though. If I find a specification of the model that works for PI>=1.06, how do I change the standard tolerance level? I assume that this is why the solution for the Ramsey steady state of PI corresponds almost perfectly to the initval?

Thanks again, this has been a really helpful discussion.

Re: Ramsey Policy

PostPosted: Wed Aug 03, 2016 11:44 am
by jpfeifer