Hi all,

I have three equations in my model that are collinear. But the error does not show up when one sector (with 6 equations) is removed, while still keeping the three collinear equations in the model.

```
//Collinear equations
lambdar - rb = lambdar(+1);
lambdar + S - rf = S(+1) + lambdar(+1);
S(+1) - S = rb-rf;
```

If I removed all equations associated with the export sector, the model runs with no errors although the three collinear equations are still in there. This is somehow strange to me. Maybe someone has experienced such a problem before. Any response is appreciated. Thanks!

```
//Export sector
ydtss* ydt = ydss*yd - yxtss*yxt;
yxt = zetax*(pstar-pxt) + cstar;
mcxt = pd - S - pxt;
pixt = beta*pixt(+1) + ((1-kappax)*(1-beta*kappax)/kappax)*(mcxt - pxt);
pixt(+1) = pxt(+1) - pxt;
cstar = rhocstar*cstar(-1) + ecstar;
```

Collinearity also arises if there is a unit root in your model. That is per se not a problem and the model can still run.

My guess would be that

```
pixt(+1) = pxt(+1) - pxt;
```

is the problem. It says that

E_t(\pi^{xt}_{t+1})=E_t(\Delta p^{xt}_{t+1})

Instead of defining an actual value, it says that only expectations need to be equal.

Hi Prof. Jpfeifer,

I have fixed my problem by replacing `mcxt = pd - S - pxt`

with `mcxt = pd - S`

, and the model runs with no errors. I realized I do not need price of export (`pxt`

) in the marginal cost equation for the export sector.

Nevertheless, as you pointed out, `model_diagnostics(M_,options_,oo_)`

reveals that there is collinearity in the model after it successfully runs. Indeed I have 4 price level equations in my model for 4 different sectors, so unit root is surely in there.

You mentioned in this post that one way to deal with unit roots is to express the whole model in terms of inflation rate. I guess this gets rid of all price level equations, right? I am thinking it is always then better to write the model this way to avoid unit root problems.

Many NK DSGE papers (at least the ones I have read) have a lot of unit root equations, especially for the price level. So I guess a model with unit roots is fine if it runs successfully.

I am building a baseline model for my studies which will start in September, so looking forward to contribute to this forum. Many thanks for all the help you provide, really great!!!

Yes, unit roots are typically not a problem for simulated models, particularly if itâ€™s just about the price levels.