Steady State File

There are several things wrong in your mod file:

  1. You declared way to many parameters, which you don’t even use in the model block. So get rid of them.
  2. If you need steady states as parameters, like Css which is consumption in steady state, you can simply replace Css in the model block by steady_state(c).
  3. You need to provide values for all parameters you declared and use in your steadystate file.
  4. Do not use global variables in your steadystate file if you are on Dynare 4.6. This is highly advised as previous people updated this global variable inside the steadystate file and messed up their estimation etc., so we changed the syntax here. You need to enter M_ and options_ as inputs to your steadystate file. Also you need to output params as well.

Anyways, in your case I would think that writing a steady_state_model block with a helper function or simply using initval is probably less error-prone for your model.

Have a look at a video I made about the four ways to compute the steady state: https://www.youtube.com/watch?v=Ei_z0HSfYNo
Or written down in this guide: https://mutschler.eu/dynare/computations/steadystate/

This might help you set up your model and steady state correctly.

1 Like

Thank you for clarifying and the videos, I just watched them . They are highly instructive and very easy to recommend to new users.

Thank you very much for your helpful comments. I tried to make all the changes you proposed but I end up having this error message:

"
dynare thesis.mod
Using 64-bit preprocessor
Starting Dynare (version 4.6.1).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
Found 21 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs …
done
Preprocessing completed.

Warning: Some of the parameters have no value (Css, Rkrss, Yss, Mss, Iss) when using steady. If these
parameters are not initialized in a steadystate file or a steady_state_model-block, Dynare may not be able to
solve the model…

Zero found in the interval [-3.37039, 3.87039]
Error using eval
Undefined function or variable ‘c’.

Error in thesis_steadystate (line 91)
eval([‘ys(’ int2str(ii) ') = ’ M_.endo_names{ii} ‘;’]);

Error in evaluate_steady_state_file (line 49)
[ys,params1,check] = h_steadystate(ys_init, exo_ss,M,options);

Error in evaluate_steady_state (line 210)
[ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, options,steadystate_check_flag);

Error in steady_ (line 55)
[steady_state,params,info] =
evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);

Error in steady (line 80)
[oo_.steady_state,M_.params,info] = steady_(M_,options_,oo_);

Error in thesis.driver (line 348)
steady;

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;
"

I am using a log linear model and was wondering whether I have to change something in the steady state file according to this (especially the last step) ? I tried some of the codes I read in this forum but I dont seem to find the problem.
Thank you for the video !! The different concepts are now clearer to me.
I was thinking that I could try the steadystate_helper function but I am not sure I understand everything… what exactly is L0 in your example ? And how do I know I have to set it to 1/3?
My new codes :
thesis_steadystate.m (3.9 KB) thesis.mod (5.0 KB)

The error message reflects that you did not set all variables in your steady state file. The complaint here is that you did not set c

Hi,
c is the consumption in the log linear model and I set it as a variable in my mod file. I dont use c in the steady state file (i only use the steady state consumption Css). Why should I set it in the steady state file ?

This warning gives you a hint: you use parameters in your steady state file that don’t have a value, so your file throws errors. Why are you using a steadystate file instead of a steady_state_model or even simpler a initval block?

L is the labor level in my example, but I cannot solve for it in closed-form. So I create the helper function which uses fsolve to find it numerically. L0 is the initial value for the solver, L0=8hours/24hours=1/3.

In the steady state file, you need to provide a steady state value for ALL variables.

I actually did that but there is an issue. My problem still comes from the steady state variables that come from the level model (Css, Iss, Mss, Yss and Rkrss). I am using a log linear model where equations contain steady state variables that come from the level model (21 equations that I had to solve for the steady state equations of Css, Iss, Mss, Yss and Rkrss, where Css, Mss, Yss and Rkrss are determined in terms of parameters and Iss is an equation that I cant solve analitically so I had to use a solver). I am a bit confused so I want to make clear what I have to do in the case I use a steady state file or in the one I use helper function:

  • if I use a steady state file, I have to declare the Css, Iss, Mss, Yss and Rkrss variables as parameters in the mod file and then include their equations in the steady state file along with the endogenous variables values in steady state (all = 0) ? Should I include a steady state block in the model file or just :
    var;
    varexo;
    parameters;
    //calibrated parameters values (I dont estimate any for now)
    model(linear);
    end;
    steady;
    check;
    shocks;
    end;
    stoch_simul;

  • If I use a helper function, I dont know exactly how Css, Iss, Mss, Yss and Rkrss are considered (variables or parameters?) in the log-lin case.
    var;
    varexo;
    parameters;
    model(linear);
    end;
    steady_state_model;
    end;
    steady;
    shocks;
    end;
    stoch_simul;
    It should look like that?
    Where exactly should I write the equations for Css, Yss,Rkrss, Mss and Iss (the one that calls the helper function to be solved) ?

I thank you very much for your help, really appreciate it !!

Regardless of which approach you use, anything that is time-invariant must be a parameter. You will need to use a steady_state_model-block or steady state file to

  1. set the steady state values for the variables like c. If the model is linearized, then everything has steady state 0
  2. update the parameters like Css. See https://github.com/JohannesPfeifer/DSGE_mod/blob/master/RBC_baseline/RBC_baseline.mod for an example.

Thank you very much for your help! I followed your advise but I keep having this message:

"There are 9 eigenvalue(s) larger than 1 in modulus
for 10 forward-looking variable(s)

The rank condition ISN’T verified!

Error using print_info (line 32)
Blanchard & Kahn conditions are not satisfied: indeterminacy.

Error in stoch_simul (line 103)
print_info(info, options_.noprint, options_);

Error in thesis.driver (line 359)
[info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list_);

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;"

What is weird is that by mistake I declared q (real exchange rate in the log model) as a predetermined variable and the steady state was computed, but it actually doesn’t make sense to do that. I also tried with r (real rental rent in log model) and again a steady state was computed. I dont really know what to do now. I checked many times if there was any mistake in the equations but that’s not the case.

thesis.mod (5.2 KB) thesis_steadystate.m (4.2 KB)

Your last exogenous process has the wrong timing. It must be

    cstar = rhoC*cstar(-1) + epsC; 
1 Like

Now it works and makes sense !! I thank you very much for your precious help!

Do your video and tutorial imply that all “_steadystate.m” files have to be rewritten? I can no longer run any of my mod files which worked perfectly in the previous version of dynare. For example, I could run the attached files in the previous version of dynare but get an error message after installing dynare 4.6.1. How would you modify the attached files to run on dynare 4.6.1? closed_economy.mod (12.6 KB) closed_economy_steadystate.m (2.9 KB) paramfile_closed_economy.m (662 Bytes)

Hi, yes, we changed several things in 4.6, so all own written _steadystate.m files need to be adapted. We are aware that this is inconvenient for some users, but we found that MANY steady state files made use of global variables in a way which actually lead to wrong estimated parameters and wrong results in general without the user noticing it. So we decided that M_ and options_ should be local variables in the steadystate file. So you will need to adapt your files, sorry about that. But it is very easy to do so, just add the global variables as inputs and outputs of your function. This is all described here:

Since there are a few backward-incompatible changes in this release, users may want to have a look at the upgrade guide to adapt their existing codes.

So in particular this section here: BreakingFeaturesIn4.6 · Wiki · Dynare / dynare · GitLab where it is shown how to change the steadystate file.

Hi Willi,

Thank you for the quick reply and the amazing work you did in the video. Unfortunately I am still struggling to incorporate step 4 together with my newly defined steady state variables (ending with SS). Could you kindly help me modify my file uploaded (named closed_economy_steadystate.m) as a guide for the rest of my work.

It should look something like this:
closed_economy_steadystate.m (2.5 KB)
But you need to set all variables in the file.

Thanks @jpfeifer.

I have been able to clear this hurdle. But it appears I will need further help to be able to run my codes in dynare 4.6.1.
My paper actually implements the Occasionally binding constraint of Luca and Iacoviello (2015). The codes are written by using global M_ oo_. I think if you can assist in modifying these two files from Luca and Iacoviello (2015), I will be able to work on the remaining files to get my codes running again. runsim_newkeynesian.m (1.8 KB) solve_one_constraint.m (7.6 KB)

So you are trying to bring the codes to Dynare 4.6.? The 4.5 version is at

Thank you very much. I’ll work with this.