Two sector dsge

I have developed a simple two sector dsge model, with sectoral output and inflation determined in two sectors and aggregated at the country level. There are two sectoral shocks for each sector and two aggregate output and inflation shocks.
However, I get the following error message:

There are 3 eigenvalue(s) larger than 1 in modulus
for 4 forward-looking variable(s)
The rank condition ISN’T verified!
error: Blanchard Kahn conditions are not satisfied: indeterminacy

twosector.mod (1.1 KB)

Why does your aggregation feature predetermined variables in



This was just a test, it also does not work without this predetermined aggregation.

As mentioned in Small open economy in a currency union, you cannot simply fudge around with the timing. There is one and one correct timing structure.

Now I have solved the problem for the simple model, but I want a two sector dsge for a more complex model. The timing is 100% correct, but I think the links between the two sectors and the foreign economy are insufficiently specified. That is why I get a message that the BK conditions are not satisfied: (There are 16 eigenvalue(s) larger than 1 in modulus
for 16 forward-looking variable(s) The rank condition ISN’T verified!)

How can I close this model appropriately? Here are the model equations:


sector 1


//Final goods sector

//foreign economy


Please provide the full file

Here is the full file:
twosector.mod (3.7 KB)

That is very hard to debug. Please start from the working simple version and then add the features back. That is the only way to see where things go wrong.

The closed economy version works fine, this is the most simple version that works. In the model above the domestic output is simply the weighted sum of the sectoral output, but when I also add the imports as demand component, I get a slightly different error message:

Blanchard Kahn conditions are not satisfied: indeterminacy due to rank failure

So you have a two-sector closed economy version that works, but the open economy two-sector version does not work?

Yes, that’s right. It might have sth to do with the aggregate goods market equilibrium condition for the (domestic) two sector economy.

In principle, when I have indeterminacy due to rank failure, this means that there are eigenvalues that are zero and that the matrix does not have full rank, right? What does that mean in practical terms? Does it mean that an additional variable that is introduced must also influence those variables, where I have eigenvalues of zero?

Usually it means that one variable in your model cannot be determined, because in the linearized system, the matrix relating contemporaneous variables is not of full rank. This often happens because of Walras’s Law as one market clearing condition is redundant. If n-1 markets clear, the last one also clears. This in turn implies that a different equation is missing that would pin the one undetermined variable down. This is extremely hard to debug without knowing the model in detail. That’s why I told you to start with a working version and go from there. That limits the size of the code where the problem could have been introduced.

I have now found a solution for this. The redundant equation was a second Euler equation and the missing equation was the labor market clearing condition.
However, I get oscillatory irfs and the shock decomposition depends entirely on initial values. Do you know how to fix this?

Do you have a unit root in your model and is it desired? The IRFs seem not come back to the steady state. And what is the variable you are displaying? The scaling look huge.

The unit root is desired. I think it comes from the definition of the real exchange rate qq-qq(-1)=pif-pi+eqq-eqq(-1); However, in the one sector model this does not lead to such oscillatory irfs as in the two sector model.
The variable that was displayed is total outptut y, i.e. the sum of the sectoral outputs.

The nominal variables have a unit root. That is normal, but it seems output in your model has one as well, which is not normal. What happens if you set irf=1000? Does the IRF return?

If I set irf=1000, some variables return, but others never return:

Then there must be a mistake in your model. Your real variables should almost surely not feature a unit root.

So, could it be a timing mistake?