# Initial Values in .mod File

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:

initval;
Output = log(2.259875601998544);
Consumption = log(1.889751205447075);
Investment = log(0.370124396553604);
Hours = log(0.834038273844502);
Capital = log(14.417630004535932);
Net_Worth = log(7.219838991921110);
re = log(1.029898129317636);
r = log(1/beta);
uc = log((1-beta*hab)/((1-hab)*Consumption));
Q = log(1);
zbar = -1.883167413363652;
dzbar = log(5.891086325695023);
fw = log(0.970161158163312);
gw = log(0.035278587963346);
wbar = log(0.492074808956435);
g = log(6.888687199256979e-004);
f = log(0.490327750880418);
a_t = log(1);
a_k = log(1);
eps_t = 0;
Leverage = log(2);
defaultt = log(3);
new_recovery_rate = log(0.5);
end;

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).

Hi VS19,

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.

Hi Camilo,

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.