# Model of Gali and Monacelli need help

Good evening here is the code of Gali et monacelli 2005 , I added the equation 6,7,8
/6 the domestic inflation based taylor rule
//7 The CPI inﬂation-based Taylor rule (CITR, for short)
//8 the exchange rate peg (PEG, for short)

I obtain this message
Starting Dynare (version 4.3.2).
Starting preprocessing of the model file …
Substitution of endo leads >= 2: added 6 auxiliary variables and equations.
Substitution of endo lags >= 2: added 11 auxiliary variables and equations.
ERROR: There are 39 equations but 36 endogenous variables!

??? Error using ==> dynare at 114
DYNARE: preprocessing failed

NK_GM052.mod (9.06 KB)

You need to get rid of the duplicate equations for “r” (ie, one of 6 or 7) and “x” (ie, one of 1 or 5). If you do so, the model runs.
Regards
Donihue

I see from another message that you still have problems with this model.

If you write it as below, for example as the PEG version, it works:

x = x(+1) - sigma^(-1)( r - pih(+1) - rnat) ; //1 New IS Curve of SOE, equ. (37) in the paper
rnat = -sigma
tau*(1-rhoa)a + alphasigma*(theta+xi)(rhoy-1)ystar; //2 def. of nature rate of interest rate of SOE,
pih = beta * pih(+1)+ kappa
x; //3 Philips Curve of the SOE, equ. (36) in the paper
ynat = tau
a + alphaxiystar; //4 def. of nature level of output of SOE, equ. (35) in the paper
x = y - ynat; //5 def. of outout gap of SOE
//r = rho + phipipih; //6 the domestic inflation based taylor rule
//r = rho + phipi
pi; //7 The CPI inflation-based Taylor rule (CITR, for short)
e = 0; //8 the exchange rate peg (PEG, for short)
y = ystar + sigma^(-1)s; //9 wedge between domestic and world output, equ (29)
pi = pih + alpha
(s-s(-1)); //10 wedge (gap) between domestic and CPI inflation, equ (14)
pi = p - p(-1); //11 def. of CPI inflation
pih = ph - ph(-1); //12 def. of domestic inflation (PPI)
s = s(-1) + e - e(-1) + pistar - pih; //13 from def. of TOT, first difference of equ (15), pi_star=0
//r = e(+1) - e; //14 not include here, Uncovered Interest rate Parity, set world interest rate to zero(see p724), equ (19)
pistar = 0; //15 foreign inflation is set to be zero
a = rhoaa(-1) + a_; //17 exogenous process of productivity in SOE,
ystar= rhoy
ystar(-1) + ystar_; //18 exogenous process of world output,

Regards
Donihue

thank you very much it works