Hi Fernando and dynare community,

I have tried to debug my model by building it again. I have figure out the stage where the productivity shock `(eT)`

in the tradable sector reduces tradable sector output` (YT)`

instead of increasing it. Aggregate output `(Y)`

, however, increases though.

Productivity shock

`(eNT)`

in the non-tradable sector is ok as both non-tradable sector ouput

`(YNT)`

and aggregate output

`(Y)`

increases. IRFs seems to be the same though, as in the tradable sector.

Other results seem ok too. But I have realized that IRFs related to the tradable sector are the exact oposite of IRFs in the non-tradable sector. And this is perhaps causing tradable sector ouput

`(YT)`

to negatively respond to tradable sector productivity shock

`(eT)`

.

Unfortunately, I have not been able to see where the problem is coming from. Thus, which equation may be causing this. Maybe, you may have encountered such a problem before.

I have attached the baseline model with one production sector (baseline.mod (8.1 KB) ), and the extension (extension.mod (9.5 KB) ) with tradable and non-tradable sectors.

But lemme write them here for an easy check. So basically, I drop these equations from the baseline model:

```
//FIRMS//
//14-Production Function
Y = A + alpha1*(U+KP(-1)) + alpha2*L + alpha3*KG(-1);
//15- Problem of the firm trade-off (MRS=Relative price)
L - U - KP(-1) = R - W;
//16-Marginal Cost
CM = alpha2*W + alpha1*R - A - alpha3*KG(-1);
//17-Phillips Equation
PI = beta*PI(+1) + ((1-theta)*(1-beta*theta)/theta)*(CM-P);
//18-Gross Inflation Rate
PI(+1) = P(+1) - P;
And I replace them with the following equations in the extended model:
YNT = ANT + alpha1*(U + KNT) + alpha2*LNT + alpha3*KGNT;
//FOC of non-tradable firms - MRS
LNT - U - KNT = R - W;
// Marginal cost
MCNT = alpha2*W + alpha1*R - ANT - alpha3*KGNT;
//Phillips equation
PINT = beta*PINT(+1) + ((1-theta)*(1-beta*theta)/theta)*(MCNT-PNT);
//Non-tradable sector inflation
PINT(+1) = PNT(+1) - PNT;
//DEMAND FUNCTIONS IN THE NON-TRADABLE SECTOR
CNT = zeta1*(P-PNT) + C;
INTT = zeta1*(P-PNT) + IP;
IGNT = zeta1*(P-PNT) + IG;
GNT = zeta1*(P-PNT) + G;
//MARKET CLEARING IN NON-TRADABLE GOODS SECTOR
YNTss*YNT = CNTss*CNT + INTss*INTT + IGNTss*IGNT + GNTss*GNT;
// TRADABLE SECTOR
//Production function
YT = AT + alpha1*(U + KT) + alpha2*LT + alpha3*KGT;
//FOC of tradable firms - MRS
//Tradable firm's labor demand
LT = MCT + YT -W;
//TRadable firm's capital demand
KT = MCT + YT - R - U;
//Marginal cost
MCT = alpha2*W + alpha1*R - AT - alpha3*KGT;
//Phillips equation
PIT = beta*PIT(+1) + ((1-theta2)*(1-beta*theta2)/theta2)*(MCT-PT);
//Tradable sector inflation 15
PIT(+1) = PT(+1) - PT;
//MARKET CLEARING FOR PRIVATE CAPITAL
KP(-1) = KT + KNT;
//MARKET CLEARING FOR GOVERNMENT CAPITAL
KG(-1) = KGT + KGNT;
//MARKET CLEARING FOR LABOR
L = LT + LNT;
//GROSS INFLATION RATE
PI = omega1*PIT + (1-omega1)*PINT;
//AGGREGATE PRICE
P = omega1*PT + (1-omega1)*PNT;
//Aggregate supply
Yss*(Y) = (PNTss/Pss)*YNTss*(PNT + YNT - P) + YTss*(PTss/Pss)*(PT + YT - P);
```