I downloaded this Dynare code from Oliver De Groot’s site quite a while ago. It solves a version of Financial Accelerator (FA) model of Bernanke, Gertler and Gilchrist (1999). When you go to the section where he initializes the variables, you see this:

I think he solves for the steady state numerically, though when I downloaded this no steady state file came with it. This code runs as a stand-alone piece. My question is, when you solve for the steady state in a separate MATLAB file, how do these initial values enter the .mod file? I mean, does one have to solve it in MATLAB and then then copy paste these numbers in .mod file as initial values? I ask this because I am trying to solve a model with FA block but I am clueless how to provide initial values for the variables which enter the model from FA block such as the functions F and G and there derivatives. Here’s the original .mod file bgg_1.mod (6.3 KB).

You do not need to copy-paste values. Code your yourmodel.mod file and write the steady-state equations in the yourmodel_steadystate.m file. If (some of) these equations are difficult to solve, you could help yourself with tools such as fsolve from MATLAB, to mention one, and use them inside the _steadystate file. The initial values found in the _steadystate file will be fed automatically inside the ys vector to initialize your steady state. Dynare looks for yourmodel_steadystate.m provided you place it in the same folder as yourmodel.mod. For an illustrative example, see the NK_baseline.mod and NK_baseline_steadystate.m files in the examples folder in your Dynare distribution folder.

This having been said, having only a .mod file with the analytical solution for all steady state levels of the variables in it speeds computation up somewhat, but I suggest it is fair to say that this turns out to be a noteworthy improvement most likely only if your are going to estimate the model.

Thanks for answering. I was aware of Dynare looking for a steady state file in the same folder if it doesn’t find the steady state block in the .mod file. What I was curious about was how those initial values ended up in the .mod file itself. Is my understanding correct that in the case like the file I attached with original question, the code writer first solves for the steady state separately by supplying a MATLAB file and then copies those values back in .mod file, presumably for speed gains? Probably that’s how those numbers with ended up there?

Only the authors could tell you how they arrived at those values. My guess is that they solved for the steady state outside of Dynare, most probably in Matlab and were not aware of better functionality. There are a lot of mod-files out there doing this, but it is very bad practice.