[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For most simulation exercises, it is necessary to provide initial (and possibly terminal) conditions. It is also necessary to provide initial guess values for non-linear solvers. This section describes the statements used for those purposes.
In many contexts (determistic or stochastic), it is necessary to
compute the steady state of a non-linear model: initval
then
specifies numerical initial values for the non-linear solver. The
command resid
can be used to compute the equation residuals for
the given initial values.
Used in perfect foresight mode, the types of forward-loking models for which Dynare was designed require both initial and terminal conditions. Most often these initial and terminal conditions are static equilibria, but not necessarily.
One typical application is to consider an economy at the equilibrium,
trigger a shock in first period, and study the trajectory of return at
the initial equilbrium. To do that, one needs initval
and
shocks
(see section Shocks on exogenous variables.
Another one is to study, how an economy, starting from arbitrary
initial conditions converges toward equilibrium. To do that, one needs
initval
and endval
.
For models with lags on more than one period, the command
histval
permits to specify different historical initial values
for periods before the beginning of the simulation.
Description
The initval
block serves two purposes: declaring the initial
(and possibly terminal) conditions in a simulation exercise, and
providing guess values for non-linear solvers.
This block is terminated by end;
, and contains lines of the
form:
VARIABLE_NAME = EXPRESSION; |
In a deterministic (i.e. perfect foresight) model
First, it provides the initial conditions for all the endogenous and
exogenous variables at all the periods preceeding the first simulation
period (unless some of these initial values are modified by
histval
).
Second, in the absence of an endval
block, it sets the terminal
conditions for all the periods succeeding the last simulation period.
Third, in the absence of an endval
block, it provides initial
guess values at all simulation dates for the non-linear solver
implemented in simul
.
For this last reason, it necessary to provide values for all the
endogenous variables in an initval
block (even though,
theoretically, initial conditions are only necessary for lagged
variables). If some variables, endogenous or exogenous, are not mentionned in the
initval
block, a zero value is assumed.
Note that if the initval
block is immediately followed by a
steady
command, its semantics is changed. The steady
command will compute the steady state of the model for all the
endogenous variables, assuming that exogenous variables are kept
constant to the value declared in the initval
block, and using
the values declared for the endogenous as initial guess values for the
non-linear solver. An initval
block followed by steady
is formally equivalent to an initval
block with the same values
for the exogenous, and with the associated steady state values for the
endogenous.
In a stochastic model
The main purpose of initval
is to provide initial guess values
for the non-linear solver in the steady state computation. Note that
if the initval
block is not followed by steady
, the
steady state computation will still be triggered by subsequent
commands (stoch_simul
, estimation
…).
It is not necessary to declare 0
as initial value for exogenous
stochastic variables, since it is the only possible value.
This steady state will be used as the initial condition at all the periods preceeding the first simulation period for the two possible types of simulations in stochastic mode:
stoch_simul
, if the periods
options is specified
forecast
(in this case, note that it is still possible to
modify some of these initial values with histval
)
Example
initval; c = 1.2; k = 12; x = 1; end; steady; |
Description
This block is terminated by end;
, and contains lines of the
form:
VARIABLE_NAME = EXPRESSION; |
The endval
block makes only sense in a determistic model, and
serves two purposes.
First, it sets the terminal conditions for all the periods succeeding the last simulation period.
Second, it provides initial guess values at all the simulation dates
for the non-linear solver implemented in simul
.
For this last reason, it necessary to provide values for all the
endogenous variables in an endval
block (even though,
theoretically, initial conditions are only necessary for forward
variables). If some variables, endogenous or exogenous, are not mentionned in the
endval
block, a zero value is assumed.
Note that if the endval
block is immediately followed by a
steady
command, its semantics is changed. The steady
command will compute the steady state of the model for all the
endogenous variables, assuming that exogenous variables are kept
constant to the value declared in the endval
block, and using
the values declared for the endogenous as initial guess values for the
non-linear solver. An endval
block followed by steady
is
formally equivalent to an endval
block with the same values for
the exogenous, and with the associated steady state values for the
endogenous.
Example
var c k; varexo x; … initval; c = 1.2; k = 12; x = 1; end; steady; endval; c = 2; k = 20; x = 2; end; steady; |
The initial equilibrium is computed by steady
for x=1
,
and the terminal one, for x=2
.
Description
In models with lags on more than one period, the histval
block
permits to specify different historical initial values for different
periods.
This block is terminated by end;
, and contains lines of the
form:
VARIABLE_NAME(INTEGER) = EXPRESSION; |
EXPRESSION is any valid expression returning a numerical value and can contain already initialized variable names.
By convention in Dynare, period 1 is the first period of the
simulation. Going backward in time, the first period before the start
of the simulation is period 0
, then period -1
, and so on.
If your lagged variables are linked by identities, be careful to satisfy these identities when you set historical initial values.
Variables not initialized in the histval
block are assumed to
have a value of zero at period 0 and before. Note that this behavior
differs from the case where there is no histval
block, where all
variables are initialized at their steady state value at period 0 and
before (except when a steady
command doesn’t follow an
initval
block).
Example
var x y; varexo e; model; x = y(-1)^alpha*y(-2)^(1-alpha)+e; … end; initval; x = 1; y = 1; e = 0.5; end; steady; histval; y(0) = 1.1; y(-1) = 0.9; end; |
This command will display the residuals of the static equations of the
model, using the values given for the endogenous in the last
initval
or endval
block (or the steady state file if you
provided one, see section Steady state).
Description
In a deterministic setup, this command is used to specify a path for all endogenous and exogenous variables. The length of these paths must be equal to the number of simulation periods, plus the number of leads and the number of lags of the model (for example, with 50 simulation periods, in a model with 2 lags and 1 lead, the paths must have a length of 53). Note that these paths cover two different things:
The command accepts three file formats:
Warning
The extension must be omitted in the command argument. Dynare will automatically figure out the extension and select the appropriate file type.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Build Daemon user on May 30, 2013 using texi2html 1.82.