Hi guys，

I have gone through the messy algebra and expressed everything as a function of N in the following auxiliary Matlab function nk_commitment_ss.m:

``````function N = nk_commitment_ss(N0,A,v,w,omegga,siggma,xi,etta,tau_n,tau_c)
N = csolve(@nk_commitment,N0,[],1e-8,100,A,v,w,omegga,siggma,xi,etta,tau_n,tau_c);
end

function F = nk_commitment(N,A,v,w,omegga,siggma,xi,etta,tau_n,tau_c)

F=xi*N^etta*v^(-siggma)-(1-tau_n)/(1+tau_c)*((1-omegga)*A*N)^(-siggma)*w;

end
``````

My .mod file is

``````var C r pi N w mc A Y v pi_star x1 x2 G;

varexo e_a e_r;

parameters omegga betta phhi siggma etta xi epsion thetta rho_a rho_r fi_pi fi_y tau_n tau_c;

omegga=0.2;
betta=0.99;
phhi=0.25;
siggma=1;
etta=1;
xi=1;
epsion=3;
thetta=1;
rho_a=0.95;
rho_r=0.9;
fi_pi=1.5;
fi_y=0.7;
tau_n=0.05;
tau_c=0.15;

model;
C^(-siggma)=betta*C(+1)^(-siggma)*(1+r)*(1+pi(1))^(-1);
xi*N^etta=(1-tau_n)/(1+tau_c)*C^(-siggma)*w;
mc=w/A;
C+G=Y;
G=omegga*Y;
Y=A*N/v;
v=(1-phhi)*(1+pi_star)^(-epsion)*(1+pi)^epsion+(1+pi)^epsion*phhi*v(-1);
(1+pi)^(1-epsion)=(1-phhi)*(1+pi_star)^(1-epsion)+phhi;
1+pi_star=epsion/(epsion-1)*(1+pi)*x1/x2;
x1=C^(-siggma)*mc*Y+phhi*betta*(1+pi(1))^epsion*x1(1);
x2=C^(-siggma)*Y+phhi*betta*(1+pi(1))^(epsion-1)*x2(1);
A=A(-1)^rho_a*exp(e_a);
end;

initval;
r=0.1111;
pi=betta*(1+r)-1;
A=1;
pi_star=(((1+pi)^(1-epsion)-phhi)/(1-phhi))^(1/(1-epsion))-1;
mc=(epsion-1)/epsion*(1+pi_star)/(1+pi)*(1-betta*phhi*(1+pi)^epsion)/(1-betta*phhi*(1+pi)^(epsion-1));
v=(1-phhi)*(1+pi_star)^(-epsion)*(1+pi)^(epsion)/(1-phhi*(1+pi)^(epsion));
w=mc;
N=nk_commitment_ss(1,A,v,w,omegga,siggma,xi,etta,tau_n,tau_c);
Y=A*N/v;
G=omegga*Y;
C=Y-G;
x1=C^(-siggma)*mc*Y/(1-phhi*betta*(1+pi)^epsion);
x2=C^(-siggma)*Y/(1-phhi*betta*(1+pi)^(epsion-1));
end;

/*
pi=betta*(1+r)-1;
A=1;
pi_star=(((1+pi)^(1-epsion)-phhi)/(1-phhi))^(1/(1-epsion))-1;
mc=(epsion-1)/epsion*(1+pi_star)/(1+pi)*(1-betta*phhi*(1+pi)^epsion)/(1-betta*phhi*(1+pi)^(epsion-1));
v=(1-phhi)*(1+pi_star)^(-epsion)*(1+pi)^(epsion)/(1-phhi*(1+pi)^(epsion));
w=mc;
N=nk_commitment_ss(1,A,v,w,omegga,siggma,xi,etta,tau_n,tau_c);
Y=A*N/v;
G=omegga*Y;
C=Y-G;
x1=C^(-siggma)*mc*Y/(1-phhi*betta*(1+pi)^epsion);
x2=C^(-siggma)*Y/(1-phhi*betta*(1+pi)^(epsion-1));
end;
*/
resid;
check;

shocks;
var e_a;
stderr 0.01;
end;

stoch_simul(nograph);

%planner_objective C^(1-siggma)/(1-siggma)-xi*N^(1+etta)/(1+etta);

%ramsey_policy(planner_discount=0.99,order=1,instruments=(r));
``````

When I run the code in stoch_simul(), it works well.

But commented out the monetary policy , monetary shock, steady; and stoch_simul; , I run ramsey_policy, the error:

``````Residuals of the static equations:

Equation number 1 : NaN
Equation number 2 : 0
Equation number 3 : NaN
Equation number 4 : -0.82997
Equation number 5 : 0
Equation number 6 : 0
Equation number 7 : NaN
Equation number 8 : 0
Equation number 9 : NaN
Equation number 10 : 0
Equation number 11 : NaN
Equation number 12 : NaN
Equation number 13 : 0

Error using print_info (line 76)
Error in check (line 76)
print_info(info, 0, options);
Error in nk_commitment (line 299)
oo_.dr.eigval = check(M_,options_,oo_);
Error in dynare (line 235)
evalin('base',fname) ;
``````

Many thanks,

I have to look more deeply into this, but resid, check, and steady are not built to work with Ramsey. When taking out these commands, there is no complaint about a problem with the steady state file, but Dynare still cannot find the steady state of the Ramsey problem.

1 Like

Why? Do you know the causes of the result?

No, I don’t know yet.

Hi @jpfeifer,
I’m facing the same issue.
Dynare cannot find the steady state of the Ramsey problem when I’m implementing ramsey_policy.
Is the issue fixed now ?
Many thanks.

There was no problem on the Dynare side. Please provide your mod-file.