# The IRF is odd in time 1

I build a NK model, but the IRF is odd in time 1, it’s not smooth.
I can’t find why it happened.

``````%
% NK Model (Log-Linear)
% MATLAB R2020a + Dynare 4.6.2
%

var
Y C I A K N rk w
mc pi R;

predetermined_variables
K;

varexo
e_a;

parameters
alpha beta delta chi theta
epsilon zeta_p
psi_pi psi_Y
rho_a sigma_a rho_R;

alpha = 0.5;
beta = 0.99;
delta = 0.025;
chi = 1;
theta = 7;

epsilon = 6;
zeta_p = 0.75;

psi_pi = 2;
psi_Y = 0.2;

rho_a = 0.9;
sigma_a = 1;
rho_R = 0.9;

model;

# rk_ss = 1/beta - (1-delta);
# K_N = ((epsilon-1)/epsilon * alpha/rk_ss)^(1/(1-alpha));
# I_Y = delta * K_N^(1-alpha);
# C_Y = 1 - I_Y;

K(+1) = delta*I + (1-delta)*K;
chi * N = -C + w;
-C = -C(+1) + rk_ss/(rk_ss+(1-delta)) * rk(+1);
-C = -C(+1) + R - pi(+1);
rk = mc + A + (alpha-1) * K + (1-alpha) * N;
w = mc + A + alpha * K -alpha * N;
Y = A + alpha * K + (1-alpha) * N;
pi = (1-zeta_p)*(1-zeta_p*beta)/zeta_p * mc + beta * pi(+1);
Y = C_Y*C + I_Y*I;
A = rho_a*A(-1) + e_a;
R = rho_R*R(-1) + (1-rho_R)* (psi_pi*pi + psi_Y*Y);

end;

shocks;
var e_a; stderr sigma_a;
end;

check;
model_diagnostics;

stoch_simul(order=1,irf=20)
Y C I K N rk w pi A;
``````

NK.mod (1.1 KB)

1 Like

@jpfeifer

1 Like

I would check all equations and linearizations.

If I change the production function from Y = A * K^alpha * N^(1-alpha) to Y = A * N, the IRF is OK.

``````%
% NK Model (Log-Linear)
% MATLAB R2020a + Dynare 4.6.2
%

var
Y C A N w mc pi R;

varexo
e_a;

parameters
alpha beta chi
epsilon zeta_p
psi_pi psi_Y
rho_a sigma_a rho_R;

alpha = 0.5;
beta = 0.99;
chi = 1;

epsilon = 6;
zeta_p = 0.75;

psi_pi = 2;
psi_Y = 0.2;

rho_a = 0.9;
sigma_a = 1;
rho_R = 0.9;

model;

chi * N = -C + w;
-C = -C(+1) + R - pi(+1);
w = mc + A;
Y = A + N;
pi = (1-zeta_p)*(1-zeta_p*beta)/zeta_p * mc + beta * pi(+1);
Y = C;
A = rho_a*A(-1) + e_a;
R = rho_R*R(-1) + (1-rho_R)* (psi_pi*pi + psi_Y*Y);

end;

shocks;
var e_a; stderr sigma_a;
end;