# New Keynesian Model from Gali

I have set up this New Keynesian Model of two countries in a Currency Union. It is correspondent to the model from the book of Jordi Galí. Unfortunately the Blanchard-Kahn-Conditions of this model are not met. I do not understand what the problem is. There are 2 New Keynesian Philips Curves, 2 Dynamic IS curves and 1 Taylor rule. The NKPC and the DIS depend on foreign and domestic shocks and output gaps.
Parameter calibrations don’t change the problem.

H means Home country, F foreign country.

var y_H, y_F, y, pi_H, pi_F, pi, g_H, g_F, a, v, i;

Could you help me out? thanks.

//y Output, pi Inflation, g goverment shocks, a technology shocks, v interest rate shocks, i interest rate.

varexo epsilon_a epsilon_g_H epsilon_g_F epsilon_v;

parameters sigma, rho, phi, alpha, beta, theta, epsilon, phi_pi, phi_y, rho_a, rho_v, rho_g_H, rho_g_F, omega, lambda, sigma_alpha, kappa_y_H, kappa_y_F, kappa_g_H, kappa_g_F, mu, zeta;

alpha = 0.5;
beta = 0.99;
theta = 2/3;
epsilon = 6;
sigma = 1;
phi = 1;

rho_v = 0.5;
rho_a = 0.9;
rho_g_H = 0.9;
rho_g_F = 0.9;

phi_y = 0.5/4;
phi_pi = 1.5;

rho = -1log(beta);
lambda = (1-theta)
(1-betatheta)/theta;
omega = sigma + (sigma-1)
(1-2alpha);
sigma_alpha = (1-2
alpha+2alphaomega)/sigma;
kappa_y_H = lambda*(sigma_alpha*(1-alpha+alphaomega/sigma) + phi);
kappa_y_F = lambda
(sigma - sigma_alpha*(1-alpha+alphaomega/sigma));
kappa_g_H = -1
lambda*(sigma_alpha*(1-alpha+alphaomega/sigma));
kappa_g_F = -1
kappa_y_F;
mu = (omega - 1);
zeta = mualphasigma_alpha/(sigma-mualphasigma_alpha);

model (linear);

y_H = y_H(+1) - 1/(sigma-mualphasigma_alpha)(i - rho - pi_H(+1)) - rho_g_Hg_H + zeta*(y_F(+1)-y_F) + (1-rho_g_F)zetag_F;
y_F = y_F(+1) - 1/(sigma-mualphasigma_alpha)(i - rho - pi_F(+1)) - rho_g_Fg_F + zeta*(y_H(+1)-y_H) + (1-rho_g_H)zetag_H;
pi_H = betapi_H(+1) + kappa_y_Hy_H + kappa_y_Fy_F + kappa_g_Hg_H + kappa_g_Fg_F - (1+phi)a;
pi_F = beta
pi_F(+1) + kappa_y_H
y_F + kappa_y_Fy_H + kappa_g_Hg_F + kappa_g_Fg_H - (1+phi)a;
y = (y_H + y_F)/2;
pi = (pi_H + pi_F)/2;
i = phi_y
y + phi_pi
pi + v;
a = rho_aa(-1) + epsilon_a;
g_H = rho_g_H
g_H(-1) + epsilon_g_H;
g_F = rho_g_Fg_F(-1) + epsilon_g_F;
v = rho_v
v(-1) + epsilon_v;

end;

initval;

y_H = 0;
y_F = 0;
y = 0;
pi_H = 0;
pi_F = 0;
pi = 0;
i = 0;
g_H = 0;
g_F = 0;
a = 0;
v = 0;

end;

check;

shocks;

var epsilon_g_H = 0.75^2;
var epsilon_g_F = 0.75^2;
var epsilon_a = 1^2;
var epsilon_v = 0.25^2;

end;

stoch_simul(irf=12);

I forgot to attach the mod file.
I would be happy if you could help me out!
thanks!
NKM_second_version_21_11_2012.mod (2 KB)