Problems in finding the steady state

Hi all,

I am trying to compute the “paper and pencil” steady state of my model. I’m having some troubles with that.
I have been told that I should try to back out the value of each endogenous variable in a recursive way
otherwise I might have problems when I run the model on dynare. While that’s easy for some variables I found it
pretty complicated if I want to find all the variables.

Would it be ok to just write down the equations in matlab and use the fsolve or it is true that this might create problems?
Are there any “smarter” ways to do it?

Furhtermore, should I also use all the first order conditions and all the budget constraints in my model when I write the dynare code
or something can be left out?

Thanks in advance for your help.


Take a look at the NK_baseline.mod (or example3.mod) in the Dynare examples folder. It does exactly what you describe. Use fsolve to solve a nonlinear equation for labor and then back out all other variables analytically from this labor value.

Thank you sir,

I think I am a bit confused on how to find a steady state properly, but I’m gradually getting there.

Would you be so kind and confirm me that when I write the dynare code I also need to write all
the budget constraints and therefore the budget constraints also have to be consistent with the steady state values that I found?

Thank you again.


I don’t understand your question. You need as many independent equations as variables. Due to Walras Law, one equation is typically redundant as it is implied by the other equations. Thus, usually one equation drops, if this is what you are asking.

John b: textbooks make finding the steady state sound easy, but it can actually be very challenging depending on the complexity of the model you write down and quality of the solver you use.

I am attaching a subset of one of my working papers – it’s relevant to your question because the equations are highly nonlinear and there’s no closed form solutions. What I did, however, is write each of the steady state equations and use fsolve.

Two caveats:

  • for a very nonlinear problem, you really need to give the solver information about the jacobian. If you use mathematica, or decide to buy a license, you can easily compute jacobians and hessians there - send a pm if you decide to do this and are not sure where to start.
  • using knitro through ampl programming language ( is an exceptional solver – I always use it to get the steady state, and then use its solution as starting values in matlab. their algorithms are unprecedented compared to matlab’s.

The typical advice of substituting variables for another to reduce the number of equations is actually not helpful. What matters is the condition number of the jacobian. If you substitute everything and get three extremely nonlinear equations, it’s still very tough to solve. (As a common sense check, remember that linear programs can incorporate hundreds of constraints - they rarely have condition problems.)
Forum example.pdf (287 KB)

Thank you for your reply. I think I will need try the solver that you suggested me.

My further question was related to which equations you are allowed to use to find your steady state values. I am sorry if I’m a bit naive but this is my first time in finding a steady state and I’m pretty new to dynare also.
This is why I asked if I am allowed to use the budget constraints and not only the market clearing or the optimality conditions to back out the steady state values.
In the model I’m trying to solve I have borrowers and savers and housing and consumption
if I do not consider the budget constraints I do not have enough equations to find all the endogenous.
Is it sensible to use them?

In the case it is, should I also include them in the dynare code?

Thank you again for your time.

As always, you need as many equations as unknowns. Otherwise your model is underdetermined. To compute the steady state, use exactly the equations entered in the model block. As I said, due to Walras Law there typically will be one market clearing condition you can drop, because if N-1 markets clear, the last one automatically clears. You will leave out this one equation in your model block. This gives you as many equations as unknowns and this is exactly what you need to compute the steady state values of the variables.

Dr Pfeifer,
Sorry if that question was asked before. How do you get the function for h you use for fsolver in the example3_steady_state_helper ?


By plugging FOCs into the labor FOC until one obtains an equation with the only unknown being labor.