Problem with Steady state


I have written a NK model with 2 countries, fiscal authority, and ricardian and non-ricardian households. I’ve typed up the model in Dynare and am getting the steady state error (there are infinite amount or there aren’t any etc). But I have already calculate the steady state myself by solving the stationary version of the model using fsolve in matlab, and it’s robust to initial guess (within reason, if I give an initial guess of 100 it gives me complex values, but if I iterate it doesn’t fluctuate around previous SS valuees). So steady state clearly exists. And this SS value is what I give dynare as initial value, so the initial values can’t be “too far”. I have alo tried changing the parameter values, but the same equations give me the same non-zero residuals (NaN or -inf).

I am now checking the equations for mistakes/typos. But since there are 74 equations, that will take a while. So meanwhile I wanted to ask whether there are any other reasons for this problem? And is it possible to just give dynare the steady state values so it doesn’t have to calculate them? (in case I can’t find the problem)

The code is attached in case anyone wants to have a look, although it’s quite long. I have already made all the stock variables lag, so that K(-1) is the working capital and K is the stocking up, and similarly b(-1) is the bond that pays interest this period.

I think that the problem might be due to the prices. There are 2 different price levels in each country, the production price index and the CPI. I have normalised all prices by production price index of country 1.

Anyway, any suggestions will be very much appreciated. If you are looking at the code, the equations with %>>>PROBLEM!!! in front of them are the ones with non-zero residuals.

v2.mod (12.8 KB)

Ok, I have figured out that it’s setting all the price levels and inflations equal to zero. I tried to take out all the relevant equations to the price levels and inflations and replace them with equations of that price/inflation equal to 1. The residual on those equations is now -1, which means it’s setting evry price/inflation to 0. And every equation that has a problem basically has a division by one of these prices/inflations. But I can’t figure out why it’s doing it.

Same with q (tobin’s q). So effectively anything that’s supposed to be equal to 1 in SS it’s setting to 0, and then of course any equation that is divided by that can’t be solved. Can anyone figure out why? is it working in logs for some reason?

There are ways to provide analytical steady states, either using steady state files or the steady_state_model block. But they still require your entered model equations to be consistent with the values you provide. This currently seems to not be the case. Hence, check your model or your computations.

Are you sure your model features a unique steady state? In those types of models often only the relative prices are determined, but not the individual prices levels. Setting them to 1 is an arbitrary normalization that does not follow endogenously. It might be necessary to stationarize your model by expressing everything in relative prices.

All nominal values are normalised by the production price index of country 1. So when I say price is 1 I meant the relative price is 1.

But indeed, I’m quite sure there is a problem with the dynamic version of the model I enter in dynare. As I said for the stationary one I can find a steady state that is robust to iteration. I have decided to build the model from ground up step by step in dynare now to see where the problem is.