# Ramsey Policy

**URL:** <https://forum.dynare.org/t/ramsey-policy/5447>\
**Category:** Optimal Policy\
**Created:** [16 April 2016 13:59 UTC](https://forum.dynare.org/t/ramsey-policy/5447 "2016-04-16T13:59:42Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jd1090](https://forum.dynare.org/user_avatar/forum.dynare.org/jd1090/32/5086_2.png) [@jd1090](https://forum.dynare.org/u/jd1090)\
**Post date:** [24 April 2016 12:38 UTC](https://forum.dynare.org/t/ramsey-policy/5447/5 "2016-04-24T12:38:25Z")

</div>

I think I understand the find\_ and nk\_ss commands better now. I applied similar logic to my model, but I think I ran into a similar problem as in this topic: [[Problems with Ramsey policy](http://forum.dynare.org/t/problems-with-ramsey-policy/4003/1)).

Please see the code attached to this message. I specify the nominal interest rate (r) as an instrument, which appears in the stochastic discount factor (LAMBDA). The CPI inflation (PI\_CPI) is thus a function of LAMBDA and beta (the time invariant discount factor), which must be obtained using find\_ command:

`function PI_CPI = find_PI_CPI(PI_CPI0, LAMBDA, beta)
PI_CPI = csolve(@nk_ss,PI_CPI0,],1e-8,100, LAMBDA, beta);
end`

Then I specify the function for the residuals of the instrument (i.e. the Euler equation):

`function r = nk_ss(PI_CPI, LAMBDA, beta)
r = (PI_CPI*LAMBDA)/beta;
end`

The steady\_state\_model block is solved recursively and it is conditional on the instrument value. However, when I run the code I obtain quite a number of rank deficiency warnings such as:

[code]Warning: Rank deficient, rank = 0, tol = NaN.

> In dyn\_ramsey\_static\_dyn\_ramsey\_static\_1 (line 152)  
> In dyn\_ramsey\_static\>@(x)dyn\_ramsey\_static\_1(x,M,options\_,oo) (line 40)  
> In csolve (line 112)  
> In dyn\_ramsey\_static (line 55)  
> In evaluate\_steady\_state (line 55)  
> In resol (line 104)  
> In stoch\_simul (line 88)  
> In ramsey\_policy (line 25)  
> In FINOP\_RAMSEY (line 650)  
> In dynare (line 180) [/code]

Until Matlab stops and gives another error at the end:

`Attempted to access ys_(50); index out of bounds because numel(ys_)=40.
Error in FINOP_RAMSEY_steadystate2 (line 44)
ys_(80)=ys_(50)*(-(ys_(18)*1/(ys_(26)*ys_(15))));
Error in evaluate_steady_state_file (line 54)
        [ys,params1,check] = h_steadystate(ys_init, exo_ss, params);
Error in dyn_ramsey_static (line 61)
    [xx,params,check] = evaluate_steady_state_file(ys,exo_ss,M,options_);
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 FINOP_RAMSEY (line 650)
ramsey_policy(var_list_);
Error in dynare (line 180)
evalin('base',fname) `

Hence, there are only 40 equation in the model, so ys(50) and ys(80) are auxiliary equations (as the steady state file suggests). There should not be any division by zero. I can run the model smoothly using different versions of Taylor rules with various parameter specifications. Is there still something wrong with the way I specify the steady state?

Thank you.

---

_[View the full topic](https://forum.dynare.org/t/ramsey-policy/5447)._
