Ramsey Policy

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).

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.