# Help with steady state with NaN and positive residuals

Hi ,

I have a problem with my code - The steadystate file did not compute the steady state. The residuals of two equations are nonzero : one is NaN and the other is positive.

This seems strange to me because the program did calculate the steady state from the analytical expressions provided ( I can see them when I open the M_,params)

This is a very simple model, and I attached the code. I appreciate any comments

mymodel.mod (1.3 KB)

Carlos

Your model is supposed to be

``````
var c n mc R pi y g;
varexo eps_g;

parameters gamma beta psi theta phi_pi phi_y gshare rho_g sigma_g;

gamma = 0.29;
beta = 0.99;
psi = 69; //equal to calvo when prob of not change price is 0.75
theta = 7 ;   // from christiano
phi_pi = 1.5;
phi_y = 0.25; // vilaverde 2012
gshare = 0.2;  // vilaverde 2012
rho_g = 0.8;
sigma_g = 0.0025; // vilaverde 2012

model;
#tau = 1/theta;

//euler equation

1/R  = beta*(c/c(+1))*(1/pi(+1)) ;

// real marginal cost
mc = ((1-gamma)/gamma)*(c/(1-n)) *(1-tau);

//optimal pricing

1 - psi*(pi-1)*pi + psi*beta*(c/c(+1))*(pi(+1)-1)*pi(+1)*(y(+1)/y) = theta*(1-mc);

//taylor rule

// Resource Constraint

y = (1/(1-g-psi/2*(pi-1)^2))*c;

// Aggregate supply

y = n;

g = (1-rho_g)*gshare + rho_g*g(-1)+ eps_g;

end;

shocks;
var eps_g = 0.0025^2;
end;

n = gamma/(1-gshare*(1-gamma));
y = gamma/(1-gshare*(1-gamma));
c = (1-gshare)*(gamma/(1-gshare*(1-gamma)));
mc = (theta-1)/theta;
R = (1/beta);
G = gshare * gamma/(1-gshare*(1-gamma));
pi = 1;
g = gshare;
end;