More on computing steady states

Hi all,

I asked a similar question about three weeks ago, but I haven’t fully resolved the issue after considerable amounts of additional hours spent, namely over computing the steady state to a relatively nonlinear dynamic GE model. I attached a pdf of the competitive equilibrium model; I was able to get the social planner’s problem to work, fortunately.

Last time I asked, you had mentioned checking the NKE baseline example. I did, but it’s hard to see what the author of that file is doing. I spent many hours reading online strategies; one seems to be linearizing around the steady state. As you will see on the pdf, that’s what I started doing, but it’s a very lengthy endeavor given my problem so I wanted to see what you think the value is, especially since many dynare models I have seen just write in the FOCs and leave it at that.

Thank you again for your help!
benchmark.mod (2.13 KB)
Dynare forum question.pdf (155 KB)

Linearizing does not help you as you need to know the steady state values around which you are approximating. If you found the NK_baseline too complicated, take a look at the example3.mod at github.com/DynareTeam/dynare/tree/master/examples. It uses a very basic RBC model, plugs the FOCs in steady state into each other until a non-linear equation in labor is found and then calls a solver for that equation.

Thank you – this should be very helpful. To follow up, I have been looking at it to gain intuition; to do so, I was trying to run this code in dynare to see their result and to get the equation latexed – the code didn’t seem to work. This was the error:
Undefined function or method
’example3_steady_state_helper’ for input arguments of type
’double’.

Thank you again for being so prompt to reply. The challenge in learning from this example is less to do with the technical matters per se – I just don’t see how they jump to this nonlinear function of h in the steady state, which is why I was trying to run the code myself. (I was looking at the “guide” file by Collard, but they don’t incorporate this nonlinear expression and how they got to it in that file.)

EDIT: I thought of just renaming the file example3_steadystate.m instead of what the file had been initially called, example3_steady_state_helper.mod. That did the trick – nonetheless, is there any documentation of how the nonlinear equation in h was solved? As you may have seen on my attached pdf, both preferences and production are CES, making it impossible to get any closed form solutions – from what it looks like, the author of that code solves for the equilibrium return on capital and plugged it into the Euler, then possibly plugged that into the aggregate resource constraint using the intratemporal Euler.

First, the example3_steady_state_helper file was also downloadable at the link.

Second, what was done was dividing the resource constraint by capital, substituting for consumption from the Euler equation, and then using the equilibrium return on capital to express capital as a function of labor.
Even with CES-functions, something similar is usually possible, as even CES-functions preserve constant returns to scale.

Right – I had looked at the h=f(theta,h) function on the helper file – the issue was that I just wasn’t able to derive the same expression when I was trying to solve the example problem. However, I am assuming that I simplified it differently since I re-did the problem at least 5 times.

The reason why CES makes it challenging, if not impossible, is because then I cannot get the equilibrium rental rate in terms of parameters – it will be a function of energy (E) and labor (H) in my model; together with nonseparability in preferences, I don’t know how to make that example applicable. What I did, therefore, is make production cobb douglas between capital and labor – removed energy. My hope is that the steady state values I get are good starting points for my full model without the cobb douglas simplified production. I attached a pdf and the equations I type in for the helper are at the bottom of it. However, I am getting the following error:

??? Undefined function or method ‘benchmarkcb_steadystate’
for input arguments of type ‘double’.

I made everything identical to the example – even removing the commands where I ask to report the residuals and check for blanchard kahn conditions at the bottom, as well as doing the IRF.

I know it must be very time intensive for you to look at all of these questions, so if there is a walk through somewhere – although I spent at least two hours searching – let me know and I’d be happy to look there too. Thank you for all your help!
benchmarkcb.mod (1.9 KB)
benchmarkcb_steady_state_helper.m (477 Bytes)
Dynare forum question.pdf (161 KB)

Several things:

  1. You are using a steady_state_model-block instead of initval although you are just providing starting values from the Cobb-Douglas case. You must use initval in this case
  2. You are calling a function benchmarkcb_steadystate in this block, although you named your function benchmarkcb_steady_state_helper. No wonder Dynare cannot find it.
  3. You are violating the syntax of fsolve. fsolve needs a starting values.

I attached corrected files. It still has the same problems as before. You should now check whether your steady state solves when you set the parameters to the special Cobb-Douglas case. If not, there either is a mistake in the analytical computation of the steady state values or your equations are wrong.

Given that your function for the Cobb-Douglas case seems to have a minimum of H =-321.4625, I doubt that everything is correct.
benchmarkcb_steady_state_helper.m (481 Bytes)
benchmarkcb.mod (1.9 KB)

This is great – will look over all of this and re-work the algebra since the value came out incorrect. As for the steady state file helper, the Dynare documentation says to name it “[original file name]_steadystate.m”; further, when I had run the example3, that’s how I got it to run – by writing “example3_steadystate.m”. Nonetheless, I am very appreciative you took the time and effort to write it properly; I just wanted to note why I had it the way that it was.

You are confusing something. You can i) either use an explicit external steady state file that needs to be named “[original file name]_steadystate.m” or ii) you can use the steady_state_model block as I did. However, in this latter case you need the helper function to call an external solver. Essentially, Dynare will use the steady_state_model-block to create a steady state file for you containing the required code (something you did by hand now).

I understand the distinction now – thank you for explaining it. I got the model to successfully run with reasonable results; I made the simplification that preferences are nonseparable between leisure and environmental quality, but additively separable between that composite and consumption. Will continue refining these ideas – thank you (again) for your time!