# Inflation response in a basic NK model

Hello Johannes and the others,

I’m trying to figure out why in this basic NK DSGE, inflation goes up after a techno shock while I expect it to fall. The model seems to work correctly, and I didn’t spot any mistake in the behavioral equations. Suggestions? Thank you! Code below.

``````var lambda mu c i PI PIstar R y I k kt Dt At a v n q g u mc w m theta;

parameters alpha beta gamma Delta nu zet tau rhotheta phi epsilon delta0 rhoa theta_ss rhog omega y_ss rhoi phipi phiy pi_ss pistar_ss i_ss;

varexo epsia epsii epsig epsitheta;

predetermined_variables k kt i;

%% Parameters setting (Quarterly calibration)
alpha = 0.33;
beta = 0.99;
delta0 = 0.025;
epsilon = 6;
phi = 0.8;
pi_ss = 0.005;
pistar_ss = (((1+pi_ss)^(1-epsilon)-phi)/(1-phi))^(1/(1-epsilon))-1;
gamma = 0.75;

omega = 0.2;
Delta = (1/beta-1)/delta0 + 1;
zet = 1;
tau = 0.5;
rhoa = 0.97;
rhotheta = 0.85;
rhog = 0.85;
rhoi = 0.85;
phipi = 1.5;
phiy = 0.5;
nu =1;

a_ss = 1;
q_ss = 1;

n_ss = 0.33;
u_ss = 1;
R_ss = Delta*delta0*u_ss^(Delta-1);
mc_ss = ((epsilon-1)/epsilon) *((((1+pi_ss)^(1-epsilon))-phi)/(1-phi))^(1/(1-epsilon))*(1/(1+pi_ss))*(1-phi*beta*(1+pi_ss)^(epsilon))/(1-phi*beta*(1+pi_ss)^(epsilon-1));
k_ss  = (((alpha*mc_ss)/R_ss)^(1/(1-alpha)))*n_ss;
kt_ss = k_ss;
I_ss = delta0*u_ss^Delta*k_ss;
w_ss = mc_ss*(1-alpha)*(k_ss/n_ss)^alpha;
v_ss = (1-phi)*(1+pi_ss)^epsilon*(1+pistar_ss)^-epsilon/(1-phi*(1+pi_ss)^epsilon);
c_ss =  (((1-omega)/v_ss)*((k_ss/n_ss)^alpha) - delta0*(k_ss/n_ss))*n_ss;

theta_ss = (1/(n_ss*(1-n_ss)^(-zet))) * (n_ss/c_ss) * ((1-beta*gamma)/(1-gamma)) * (mc_ss*(1-alpha)*((k_ss/n_ss)^alpha));
y_ss = (1/v_ss)*((k_ss/n_ss)^alpha)*n_ss;
g_ss = omega*y_ss;
i_ss = ((1/beta)*(1+pi_ss))-1;
lambda_ss  = (1/c_ss)*(1-beta*gamma)/(1-gamma);
m_ss = (lambda_ss*(1-beta/(1+pi_ss)))^(-1/nu);

mu_ss = lambda_ss;
At_ss = lambda_ss*y_ss*mc_ss/(1-phi*beta*(1+pi_ss)^epsilon);
Dt_ss = lambda_ss*y_ss/(1-phi*beta*(1+pi_ss)^(epsilon-1));

%%At_ss = lambda_ss*y_ss*mc_ss/(1-phi*beta*(1+pi_ss)^epsilon);
Dt_ss = lambda_ss*y_ss/(1-phi*beta*(1+pi_ss)^(epsilon-1));

model;
y = c + I + g;
y = a*kt^alpha*n^(1-alpha)/v;
kt = u*k;
PI = ((1-phi)*(PIstar^(1-epsilon)) + phi)^(1/(1-epsilon));
v = (1-phi)*(PIstar^(-epsilon))*(PI^epsilon) + phi*(PI^epsilon)*v(-1);
PIstar = PI*(epsilon/(epsilon-1))*At/Dt;
At = lambda*y*mc + phi*beta*(PI(+1)^epsilon)*At(+1);
Dt = lambda*y + phi*beta*(PI(+1)^(epsilon-1))*Dt(+1);
w = mc*(1-alpha)*(kt/n)^alpha;
R = mc*alpha*(kt/n)^(alpha-1);
lambda = (1/(c - gamma*c(-1))) - ((beta*gamma)/(c(+1) - gamma*c));
theta*((1-n)^(-zet)) = lambda*w;
lambda*R = mu*Delta*delta0*(u^(Delta-1));
lambda = beta*lambda(+1)*(1+i(+1))*(PI(+1)^(-1));

mu = beta*(lambda(+1)*R(+1)*u(+1) + mu(+1)*(1-delta0*u(+1)^Delta));
m^(-nu) = lambda - beta*lambda(+1)*(PI(+1)^(-1));
lambda = mu*(1-(tau/2)*(I/I(-1)-1)^2 - tau*(I/I(-1)-1)) + beta*mu(+1)*tau*(I(+1)/I-1)*(I(+1)/I)^2;
k(+1) = (1-((tau/2)*((I/I(-1))-1)^2))*I + (1-delta0*u^Delta)*k;
q = mu/lambda;
log(a) = rhoa*log(a(-1)) + epsia;
log(theta) = (1-rhotheta)*log(theta_ss) + rhotheta*log(theta(-1)) + epsitheta;
log(g) = (1-rhog)*(log(omega) + log(y_ss)) + rhog*log(g(-1)) + epsig;
i(+1) = i_ss*((i/i_ss)^rhoi*((PI/(1+pi_ss))^phipi*((y/y(-1)))^phiy)^(1-rhoi)*exp(epsii));

end;

initval;
lambda = lambda_ss;
mu =mu_ss;
c = c_ss;
i = i_ss;
PI = 1+pi_ss;
PIstar = 1+pistar_ss;
R = R_ss;
y=y_ss;
I=I_ss;
k=k_ss;
kt=kt_ss;
Dt=Dt_ss;
At=At_ss;
a=1;
v=v_ss;
n=n_ss;
q =1;
g=g_ss;
u=u_ss;
mc=mc_ss;
w=w_ss;
m=m_ss;
theta=theta_ss;

end;

resid;
check;

shocks;

var epsia; stderr 0.01;
%var epsii; stderr 0.01;
% var uk; stderr 0.01;

end;

stoch_simul(order=1,nocorr,noprint) a y c I n q w PI i;
``````

Your file looks wrong. Only physical capital `k` is predetermined. Capital services are not predetermined as utilization can be chosen at time t.
Check the timing of all your equations. If you plug in for `lambda(+1)` in your Euler equations, you suddenly have `c(+2)` in there, which looks wrong.