[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 4.10 Steady state

There are two ways of computing the steady state (i.e. the static equilibrium) of a model. The first way is to let Dynare compute the steady state using a nonlinear Newton-type solver; this should work for most models, and is relatively simple to use. The second way is to give more guidance to Dynare, using your knowledge of the model, by providing it with a “steady state file”.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 4.10.1 Finding the steady state with Dynare nonlinear solver

Command: steady ;
Command: steady (OPTIONS…);

  Description

  This command computes the steady state of a model using a nonlinear Newton-type solver.

  More precisely, it computes the equilibrium value of the endogenous variables for the value of the exogenous variables specified in the previous `initval` or `endval` block.

  `steady` uses an iterative procedure and takes as initial guess the value of the endogenous variables set in the previous `initval` or `endval` block.

  For complicated models, finding good numerical initial values for the endogenous variables is the trickiest part of finding the equilibrium of that model. Often, it is better to start with a smaller model and add new variables one by one.

  Options

  `solve_algo = INTEGER`

    Determines the non-linear solver to use. Possible values for the option are:

    `0`

      Use `fsolve` (under MATLAB, only available if you have the Optimization Toolbox; always available under Octave)

    `1`

      Use Dynare’s own nonlinear equation solver

    `2`

      Splits the model into recursive blocks and solves each block in turn

    `3`

      Use Chris Sims’ solver

    `4`

      Similar to value `2`, except that it deals differently with nearly singular Jacobian

    `5`

      Newton algorithm with a sparse Gaussian elimination (SPE) (requires `bytecode` option, see section Model declaration)

    `6`

      Newton algorithm with a sparse LU solver at each iteration (requires `bytecode` and/or `block` option, see section Model declaration)

    `7`

      Newton algorithm with a Generalized Minimal Residual (GMRES) solver at each iteration (requires `bytecode` and/or `block` option, see section Model declaration; not available under Octave))

    `8`

      Newton algorithm with a Stabilized Bi-Conjugate Gradient (BICGSTAB) solver at each iteration (requires `bytecode` and/or `block` option, see section Model declaration)

    Default value is `2`.

  `homotopy_mode = INTEGER`

    Use a homotopy (or divide-and-conquer) technique to solve for the steady state. If you use this option, you must specify a `homotopy_setup` block. This option can take three possible values:

    `1`

      In this mode, all the parameters are changed simultaneously, and the distance between the boudaries for each parameter is divided in as many intervals as there are steps (as defined by `homotopy_steps` option); the problem is solves as many times as there are steps.

    `2`

      Same as mode `1`, except that only one parameter is changed at a time; the problem is solved as many times as steps times number of parameters.

    `3`

      Dynare tries first the most extreme values. If it fails to compute the steady state, the interval between initial and desired values is divided by two for all parameters. Every time that it is impossible to find a steady state, the previous interval is divided by two. When it succeeds to find a steady state, the previous interval is multiplied by two. In that last case `homotopy_steps` contains the maximum number of computations attempted before giving up.

  `homotopy_steps = INTEGER`

    Defines the number of steps when performing a homotopy. See `homotopy_mode` option for more details.

  Example

  See section Initial and terminal conditions.

After computation, the steady state is available in the following variable:

MATLAB/Octave variable: oo_.steady_state

  Contains the computed steady state.

  Endogenous variables are ordered in order of declaration used in `var` command (which is also the order used in `M_.endo_names`).

Block: homotopy_setup ;

  Description

  This block is used to declare initial and final values when using a homotopy method. It is used in conjunction with the option `homotopy_mode` of the `steady` command.

  The idea of homotopy (also called divide-and-conquer by some authors) is to subdivide the problem of finding the steady state into smaller problems. It assumes that you know how to compute the steady state for a given set of parameters, and it helps you finding the steady state for another set of parameters, by incrementally moving from one to another set of parameters.

  The purpose of the `homotopy_setup` block is to declare the final (and possibly also the initial) values for the parameters or exogenous that will be changed during the homotopy. It should contain lines of the form:

      VARIABLE_NAME, EXPRESSION, EXPRESSION;

  This syntax specifies the initial and final values of a given parameter/exogenous.

  There is an alternative syntax:

      VARIABLE_NAME, EXPRESSION;

  Here only the final value is specified for a given parameter/exogenous; the initial value is taken from the preceeding `initval` block.

  A necessary condition for a successful homotopy is that Dynare must be able to solve the steady state for the initial parameters/exogenous without additional help (using the guess values given in the `initval` block).

  If the homotopy fails, a possible solution is to increase the number of steps (given in `homotopy_steps` option of `steady`).

  Example

  In the following example, Dynare will first compute the steady state for the initial values (`gam=0.5` and `x=1`), and then subdivide the problem into 50 smaller problems to find the steady state for the final values (`gam=2` and `x=2`).

      var c k;
      varexo x;

      parameters alph gam delt bet aa;
      alph=0.5;
      delt=0.02;
      aa=0.5;
      bet=0.05;

      model;
      c + k - aa*x*k(-1)^alph - (1-delt)*k(-1);
      c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
      end;

      initval;
      x = 1;
      k = ((delt+bet)/(aa*x*alph))^(1/(alph-1));
      c = aa*x*k^alph-delt*k;
      end;

      homotopy_setup;
      gam, 0.5, 2;
      x, 2;
      end;

      steady(homotopy_mode = 1, homotopy_steps = 50);

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 4.10.2 Using a steady state file

If you know how to compute the steady state for your model, you can provide a MATLAB/Octave function doing the computation instead of using `steady`. If your MOD-file is called ‘`FILENAME.mod`’, the steady state file should be called ‘`FILENAME_steadystate.m`’.

Again, there are two options for creating this file:

- You can write this file by hand. See ‘`fs2000_steadystate.m`’ in the ‘`examples`’ directory for an example. This is the option which gives the most flexibility, at the expense of a heavier programming burden.
- You can use the `steady_state_model` block, for a more user-friendly interface.

Block: steady_state_model ;

  Description

  When the analytical solution of the model is known, this command can be used to help Dynare find the steady state in a more efficient and reliable way, especially during estimation where the steady state has to be recomputed for every point in the parameter space.

  Each line of this block consists of a variable (either an endogenous, a temporary variable or a parameter) which is assigned an expression (which can contain parameters, exogenous at the steady state, or any endogenous or temporary variable already declared above). Each line therefore looks like:

      VARIABLE_NAME = EXPRESSION;

  Note that it is also possible to assign several variables at the same time, if the main function in the right hand side is a MATLAB/Octave function returning several arguments:

      [ VARIABLE_NAME, VARIABLE_NAME… ] = EXPRESSION;

  Dynare will automatically generate a steady state file using the information provided in this block.

  Example

      var m P c e W R k d n l gy_obs gp_obs y dA;
      varexo e_a e_m;

      parameters alp bet gam mst rho psi del;

      …
      // parameter calibration, (dynamic) model declaration, shock calibration…
      …

      steady_state_model;
        dA = exp(gam);
        gst = 1/dA; // A temporary variable
        m = mst;

        // Three other temporary variables
        khst = ( (1-gst*bet*(1-del)) / (alp*gst^alp*bet) )^(1/(alp-1));
        xist = ( ((khst*gst)^alp - (1-gst*(1-del))*khst)/mst )^(-1);
        nust = psi*mst^2/( (1-alp)*(1-psi)*bet*gst^alp*khst^alp );

        n  = xist/(nust+xist);
        P  = xist + nust;
        k  = khst*n;

        l  = psi*mst*n/( (1-psi)*(1-n) );
        c  = mst/P;
        d  = l - mst + 1;
        y  = k^alp*n^(1-alp)*gst^alp;
        R  = mst/bet;

        // You can use MATLAB functions which return several arguments
        [W, e] = my_function(l, n);

        gp_obs = m/dA;
        gy_obs = dA;
      end;

      steady;

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ]

This document was generated by SÃ©bastien Villemot on May 24, 2011 using texi2html 1.82.