//Model gali & gertler (1999)

var x, pi;
varexo i;
parameters lambda, gamma_s, gamma_b, sigma, omega, cbeta, k, thetha, phi;

thetha = 0.81;                                          //degree price stickiness
omega = 0.26;                                           //degree backwards price setting
cbeta = 0.885;                                          //discount factor
gamma_s= 0.68;                                          //parameter
gamma_b= 0.25;                                          //parameter
phi = thetha + omega*(1-thetha*(1-cbeta));
lamba = (1-omega)*(1-thetha)*(1-cbeta*thetha)*phi^-1;
k=1;

model;
x = x(+1) - (sigma)*(i-(pi(+1)));
pi = ((1-omega)*(1-thetha)*(1-cbeta*thetha)*phi^-1)*(k*x) + gamma_s*pi(+1) + gamma_b*pi(-1);
end; 

initval;
i=0;
end;

endval;
i = 1;
end;
steady;

check;


simul(periods=50);
rplot x;
rplot pi;