General "The steady state contains NaN or Inf"

I have starting learning to use Dynare. Implementing models from scratch, I have come across with the error “The steady state contains NaN or Inf”, and then a summary of the equations and which one of them contains the problem. I have looking for questions with the same problem, and found some solutions, even though as I haven’t completely understand why this error in general is caused for.

The concrete question is that, what in the mathematical implementation causes the preprocessor not to run properly in this cases. I have thought about initial conditions that contains illegal divisions or mathematical indeterminacies. I just want to make sure if the problem is with the stability of the system, or the initial guesses for variables (initval), or both.


There are two sources for this error message:

  1. You forgot to set a parameter and it is therefore initialized to `NaN.
  2. There is a division by 0. That can happen because of two things:
    1. Your model equations are correct and your initial value is infeasible. In this case the problem shows up when simply calling resid without steady.
  3. The initial values are fine, but there is an inconsistency in the model, driving a variable to a steady state of 0, although it must not be 0. That most often happens when having a mean 0 AR(1)-process for shocks like

but forgetting to exponentiate that process when it enters in the other equations like the production function


In this case, output and therefore consumption will be 0.

Perfect, thank you very much!