2018-10-25 16:31:53 +02:00
|
|
|
|
.. default-domain:: dynare
|
|
|
|
|
|
|
|
|
|
##############
|
|
|
|
|
Running Dynare
|
|
|
|
|
##############
|
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
In order to give instructions to Dynare, the user has to write a
|
|
|
|
|
*model file* whose filename extension must be ``.mod`` or
|
|
|
|
|
``.dyn``. This file contains the description of the model and the
|
|
|
|
|
computing tasks required by the user. Its contents are described in
|
|
|
|
|
:ref:`model-file`.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
|
|
|
|
.. _dyn-invoc:
|
|
|
|
|
|
|
|
|
|
Dynare invocation
|
|
|
|
|
=================
|
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
Once the model file is written, Dynare is invoked using the ``dynare``
|
|
|
|
|
command at the MATLAB or Octave prompt (with the filename of the
|
|
|
|
|
``.mod`` given as argument).
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
In practice, the handling of the model file is done in two steps: in
|
|
|
|
|
the first one, the model and the processing instructions written by
|
|
|
|
|
the user in a *model file* are interpreted and the proper MATLAB or
|
2019-11-14 16:57:33 +01:00
|
|
|
|
Octave instructions are generated; in the second step, the program
|
2018-10-29 10:24:59 +01:00
|
|
|
|
actually runs the computations. Both steps are triggered automatically
|
|
|
|
|
by the ``dynare`` command.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. matcomm:: dynare FILENAME[.mod] [OPTIONS…]
|
|
|
|
|
|
|
|
|
|
This command launches Dynare and executes the instructions
|
|
|
|
|
included in ``FILENAME.mod``. This user-supplied file contains the
|
|
|
|
|
model and the processing instructions, as described in
|
|
|
|
|
:ref:`model-file`. The options, listed below, can be passed on the
|
|
|
|
|
command line, following the name of the ``.mod`` file or in the
|
|
|
|
|
first line of the ``.mod`` file itself (see below).
|
|
|
|
|
|
|
|
|
|
dynare begins by launching the preprocessor on the ``.mod
|
2019-12-04 14:46:44 +01:00
|
|
|
|
file``. By default (unless the :opt:`use_dll` option has been given to
|
2018-12-01 22:56:11 +01:00
|
|
|
|
``model``), the preprocessor creates three intermediary files:
|
|
|
|
|
|
2019-02-18 14:55:38 +01:00
|
|
|
|
- ``+FILENAME/driver.m``
|
2018-12-01 22:56:11 +01:00
|
|
|
|
|
|
|
|
|
Contains variable declarations, and computing tasks.
|
|
|
|
|
|
2019-02-18 14:55:38 +01:00
|
|
|
|
- ``+FILENAME/dynamic.m``
|
2018-12-01 22:56:11 +01:00
|
|
|
|
|
|
|
|
|
Contains the dynamic model equations. Note that Dynare might
|
|
|
|
|
introduce auxiliary equations and variables (see
|
|
|
|
|
:ref:`aux-variables`). Outputs are the residuals of the
|
|
|
|
|
dynamic model equations in the order the equations were
|
|
|
|
|
declared and the Jacobian of the dynamic model equations. For
|
|
|
|
|
higher order approximations also the Hessian and the
|
|
|
|
|
third-order derivatives are provided. When computing the
|
|
|
|
|
Jacobian of the dynamic model, the order of the endogenous
|
|
|
|
|
variables in the columns is stored in
|
|
|
|
|
``M_.lead_lag_incidence``. The rows of this matrix represent
|
|
|
|
|
time periods: the first row denotes a lagged (time t-1)
|
|
|
|
|
variable, the second row a contemporaneous (time t) variable,
|
|
|
|
|
and the third row a leaded (time t+1) variable. The columns of
|
|
|
|
|
the matrix represent the endogenous variables in their order
|
|
|
|
|
of declaration. A zero in the matrix means that this
|
|
|
|
|
endogenous does not appear in the model in this time
|
|
|
|
|
period. The value in the ``M_.lead_lag_incidence`` matrix
|
|
|
|
|
corresponds to the column of that variable in the Jacobian of
|
|
|
|
|
the dynamic model. Example: Let the second declared variable
|
|
|
|
|
be ``c`` and the ``(3,2)`` entry of ``M_.lead_lag_incidence``
|
|
|
|
|
be 15. Then the 15th column of the Jacobian is the derivative
|
|
|
|
|
with respect to ``c(+1)``.
|
|
|
|
|
|
2019-02-18 14:55:38 +01:00
|
|
|
|
- ``+FILENAME/static.m``
|
2018-12-01 22:56:11 +01:00
|
|
|
|
|
|
|
|
|
Contains the long run static model equations. Note that Dynare
|
|
|
|
|
might introduce auxiliary equations and variables (see
|
|
|
|
|
:ref:`aux-variables`). Outputs are the residuals of the static
|
|
|
|
|
model equations in the order the equations were declared and
|
|
|
|
|
the Jacobian of the static equations. Entry ``(i,j)`` of the
|
|
|
|
|
Jacobian represents the derivative of the ith static model
|
|
|
|
|
equation with respect to the jth model variable in declaration
|
|
|
|
|
order.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These files may be looked at to understand errors reported at the
|
|
|
|
|
simulation stage.
|
|
|
|
|
|
2019-02-18 14:55:38 +01:00
|
|
|
|
``dynare`` will then run the computing tasks by executing
|
|
|
|
|
``+FILENAME/driver.m``. If a user needs to rerun the computing
|
|
|
|
|
tasks without calling the preprocessor (or without calling the
|
|
|
|
|
:mcomm:`dynare` command), for
|
|
|
|
|
instance because he has modified the script, he just have to type
|
|
|
|
|
the following on the command line:
|
|
|
|
|
|
|
|
|
|
.. code-block:: matlab
|
|
|
|
|
|
|
|
|
|
>> FILENAME.driver
|
|
|
|
|
|
|
|
|
|
A few words of warning are warranted here: under Octave the
|
|
|
|
|
filename of the ``.mod`` file should be chosen in such a way that
|
|
|
|
|
the generated ``.m`` files described above do not conflict with
|
|
|
|
|
``.m`` files provided by Octave or by Dynare. Not
|
|
|
|
|
respecting this rule could cause crashes or unexpected
|
|
|
|
|
behaviour. In particular, it means that the ``.mod`` file cannot
|
|
|
|
|
be given the name of an Octave or Dynare command. For instance, under
|
|
|
|
|
Octave, it also means that the ``.mod`` file cannot be named
|
|
|
|
|
``test.mod`` or ``example.mod``.
|
2018-12-01 22:56:11 +01:00
|
|
|
|
|
|
|
|
|
*Options*
|
|
|
|
|
|
|
|
|
|
.. option:: noclearall
|
|
|
|
|
|
|
|
|
|
By default, ``dynare`` will issue a ``clear all`` command to
|
|
|
|
|
MATLAB (<R2015b) or Octave, thereby deleting all workspace
|
|
|
|
|
variables and functions; this option instructs ``dynare`` not
|
2019-10-02 11:36:05 +02:00
|
|
|
|
to clear the workspace. Note that starting with MATLAB 2015b
|
2018-12-01 22:56:11 +01:00
|
|
|
|
``dynare`` only deletes the global variables and the functions
|
|
|
|
|
using persistent variables, in order to benefit from the JIT
|
|
|
|
|
(Just In Time) compilation. In this case the option instructs
|
|
|
|
|
``dynare`` not to clear the globals and functions.
|
2018-10-29 10:24:59 +01:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: onlyclearglobals
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
By default, ``dynare`` will issue a ``clear all`` command to
|
|
|
|
|
MATLAB versions before 2015b and to Octave, thereby deleting
|
|
|
|
|
all workspace variables; this option instructs ``dynare`` to
|
|
|
|
|
clear only the global variables (i.e. ``M_, options_, oo_,
|
|
|
|
|
estim_params_, bayestopt_``, and ``dataset_``), leaving the
|
|
|
|
|
other variables in the workspace.
|
|
|
|
|
|
|
|
|
|
.. option:: debug
|
|
|
|
|
|
|
|
|
|
Instructs the preprocessor to write some debugging information
|
|
|
|
|
about the scanning and parsing of the ``.mod`` file.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: notmpterms
|
|
|
|
|
|
|
|
|
|
Instructs the preprocessor to omit temporary terms in the
|
|
|
|
|
static and dynamic files; this generally decreases
|
|
|
|
|
performance, but is used for debugging purposes since it makes
|
|
|
|
|
the static and dynamic files more readable.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: savemacro[=FILENAME]
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Instructs ``dynare`` to save the intermediary file which is
|
2019-06-25 08:58:44 +02:00
|
|
|
|
obtained after macro processing (see :ref:`macro-proc-lang`);
|
2018-12-01 22:56:11 +01:00
|
|
|
|
the saved output will go in the file specified, or if no file
|
|
|
|
|
is specified in ``FILENAME-macroexp.mod``
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: onlymacro
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Instructs the preprocessor to only perform the
|
2019-06-25 08:58:44 +02:00
|
|
|
|
macro processing step, and stop just after. Useful for
|
|
|
|
|
debugging purposes or for using the macro processor
|
2018-12-01 22:56:11 +01:00
|
|
|
|
independently of the rest of Dynare toolbox.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: nolinemacro
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2019-06-25 08:58:44 +02:00
|
|
|
|
Instructs the macro preprocessor to omit line numbering
|
2018-12-01 22:56:11 +01:00
|
|
|
|
information in the intermediary ``.mod`` file created after
|
2019-06-25 08:58:44 +02:00
|
|
|
|
the macro processing step. Useful in conjunction with
|
2019-02-18 10:38:26 +01:00
|
|
|
|
:opt:`savemacro <savemacro[=FILENAME]>` when one wants that to reuse the intermediary
|
2018-12-01 22:56:11 +01:00
|
|
|
|
``.mod`` file, without having it cluttered by line numbering
|
|
|
|
|
directives.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2019-02-18 10:38:26 +01:00
|
|
|
|
.. option:: noemptylinemacro
|
|
|
|
|
|
|
|
|
|
Passing this option removes all empty from the macro expanded
|
|
|
|
|
mod file created when the :opt:`savemacro <savemacro[=FILENAME]>` option is used.
|
|
|
|
|
|
2019-02-18 16:59:55 +01:00
|
|
|
|
.. option:: onlymodel
|
|
|
|
|
|
|
|
|
|
Instructs the preprocessor to print only information about the
|
|
|
|
|
model in the driver file; no Dynare commands (other than the
|
|
|
|
|
shocks statement and parameter initializations) are printed
|
|
|
|
|
and hence no computational tasks performed. The same
|
|
|
|
|
ancillary files are created as would otherwise be created
|
|
|
|
|
(dynamic, static files, etc.).
|
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: nolog
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Instructs Dynare to no create a logfile of this run in
|
|
|
|
|
``FILENAME.log.`` The default is to create the logfile.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2019-10-08 12:29:04 +02:00
|
|
|
|
.. option:: output=dynamic|first|second|third
|
|
|
|
|
|
2019-10-08 12:35:53 +02:00
|
|
|
|
Instructs the preprocessor to output derivatives at the given
|
2019-10-08 12:29:04 +02:00
|
|
|
|
order. Only works when ``language=julia`` has been passed.
|
|
|
|
|
|
|
|
|
|
.. option:: language=matlab|julia
|
|
|
|
|
|
2019-10-08 12:35:53 +02:00
|
|
|
|
Instructs the preprocessor to write output for MATLAB or Julia. Default:
|
|
|
|
|
MATLAB
|
2019-10-08 12:29:04 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: params_derivs_order=0|1|2
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
When :comm:`identification`, :comm:`dynare_sensitivity` (with
|
|
|
|
|
identification), or :ref:`estimation_cmd <estim-comm>` are
|
|
|
|
|
present, this option is used to limit the order of the
|
|
|
|
|
derivatives with respect to the parameters that are calculated
|
|
|
|
|
by the preprocessor. 0 means no derivatives, 1 means first
|
|
|
|
|
derivatives, and 2 means second derivatives. Default: 2
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: nowarn
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Suppresses all warnings.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2019-10-08 12:29:04 +02:00
|
|
|
|
.. option:: transform_unary_ops
|
|
|
|
|
|
|
|
|
|
Transform the following operators in the model block into auxiliary
|
|
|
|
|
variables: ``exp``, ``log``, ``log10``, ``cos``, ``sin``, ``tan``,
|
|
|
|
|
``acos``, ``asin``, ``atan``, ``cosh``, ``sinh``, ``tanh``, ``acosh``,
|
|
|
|
|
``asinh``, ``atanh``, ``sqrt``, ``cbrt``, ``abs``, ``sign``,
|
2019-10-08 12:45:59 +02:00
|
|
|
|
``erf``. Default: no obligatory transformation
|
2019-10-08 12:29:04 +02:00
|
|
|
|
|
2019-08-28 10:34:01 +02:00
|
|
|
|
.. option:: json = parse|check|transform|compute
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2019-08-28 10:34:01 +02:00
|
|
|
|
Causes the preprocessor to output a version of the ``.mod`` file in
|
|
|
|
|
JSON format. When the JSON output is created depends on the value
|
|
|
|
|
passed. These values represent various steps of processing in the
|
|
|
|
|
preprocessor.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2019-08-28 10:34:01 +02:00
|
|
|
|
If ``parse`` is passed, the output will be written after the parsing of
|
|
|
|
|
the ``.mod`` file to a file called ``FILENAME.json`` but before file
|
|
|
|
|
has been checked (e.g. if there are unused exogenous in the model
|
|
|
|
|
block, the JSON output will be created before the preprocessor exits).
|
|
|
|
|
|
|
|
|
|
If ``check`` is passed, the output will be written to a file called
|
|
|
|
|
``FILENAME.json`` after the model has been checked.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
If ``transform`` is passed, the JSON output of the transformed
|
|
|
|
|
model (maximum lead of 1, minimum lag of -1, expectation
|
|
|
|
|
operators substituted, etc.) will be written to a file called
|
|
|
|
|
``FILENAME.json`` and the original, untransformed model will
|
|
|
|
|
be written in ``FILENAME_original.json``.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
And if ``compute`` is passed, the output is written after the
|
|
|
|
|
computing pass. In this case, the transformed model is written
|
|
|
|
|
to ``FILENAME.json``, the original model is written to
|
|
|
|
|
``FILENAME_original.json``, and the dynamic and static files
|
|
|
|
|
are written to ``FILENAME_dynamic.json`` and
|
|
|
|
|
``FILENAME_static.json``.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: jsonstdout
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Instead of writing output requested by ``json`` to files,
|
|
|
|
|
write to standard out.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: onlyjson
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Quit processing once the output requested by ``json`` has been
|
|
|
|
|
written.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: jsonderivsimple
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Print a simplified version (excluding variable name(s) and lag
|
|
|
|
|
information) of the static and dynamic files in
|
|
|
|
|
``FILENAME_static.json`` and ``FILENAME_dynamic.``.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: warn_uninit
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Display a warning for each variable or parameter which is not
|
|
|
|
|
initialized. See :ref:`param-init`, or
|
|
|
|
|
:comm:`load_params_and_steady_state
|
|
|
|
|
<load_params_and_steady_state>` for initialization of
|
|
|
|
|
parameters. See :ref:`init-term-cond`, or
|
|
|
|
|
:comm:`load_params_and_steady_state
|
|
|
|
|
<load_params_and_steady_state>` for initialization of
|
|
|
|
|
endogenous and exogenous variables.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: console
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Activate console mode. In addition to the behavior of
|
|
|
|
|
``nodisplay``, Dynare will not use graphical waitbars for long
|
|
|
|
|
computations.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: nograph
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Activate the ``nograph`` option (see :opt:`nograph`), so that
|
|
|
|
|
Dynare will not produce any graph.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: nointeractive
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Instructs Dynare to not request user input.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: nopathchange
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2019-10-02 11:36:05 +02:00
|
|
|
|
By default Dynare will change MATLAB/Octave’s path if
|
2018-12-01 22:56:11 +01:00
|
|
|
|
``dynare/matlab`` directory is not on top and if Dynare’s
|
|
|
|
|
routines are overriden by routines provided in other
|
|
|
|
|
toolboxes. If one wishes to override Dynare’s routines, the
|
|
|
|
|
``nopathchange`` options can be used. Alternatively, the path
|
|
|
|
|
can be temporarly modified by the user at the top of the
|
2019-10-02 11:36:05 +02:00
|
|
|
|
``.mod`` file (using MATLAB/Octave’s ``addpath`` command).
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2019-02-05 13:19:07 +01:00
|
|
|
|
.. option:: nopreprocessoroutput
|
|
|
|
|
|
|
|
|
|
Prevent Dynare from printing the output of the steps leading up to the
|
|
|
|
|
preprocessor as well as the preprocessor output itself.
|
|
|
|
|
|
2019-02-18 16:56:40 +01:00
|
|
|
|
.. option:: mexext=mex|mexw32|mexw64|mexmaci64|mexa64
|
|
|
|
|
|
|
|
|
|
The mex extension associated with your platform to be used
|
|
|
|
|
when compiling output associated with :opt:`use_dll`.
|
|
|
|
|
Dynare is able to set this automatically, so you should not
|
|
|
|
|
need to set it yourself.
|
|
|
|
|
|
|
|
|
|
.. option:: matlabroot=<<path>>
|
|
|
|
|
|
2019-10-02 11:36:05 +02:00
|
|
|
|
The path to the MATLAB installation for use with
|
2019-02-18 16:56:40 +01:00
|
|
|
|
:opt:`use_dll`. Dynare is able to set this automatically,
|
|
|
|
|
so you should not need to set it yourself.
|
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: parallel[=CLUSTER_NAME]
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Tells Dynare to perform computations in parallel. If
|
|
|
|
|
CLUSTER_NAME is passed, Dynare will use the specified cluster
|
|
|
|
|
to perform parallel computations. Otherwise, Dynare will use
|
|
|
|
|
the first cluster specified in the configuration file. See
|
|
|
|
|
:ref:`conf-file`, for more information about the configuration
|
|
|
|
|
file.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: conffile=FILENAME
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Specifies the location of the configuration file if it differs
|
|
|
|
|
from the default. See :ref:`conf-file`, for more information
|
|
|
|
|
about the configuration file and its default location.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: parallel_slave_open_mode
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Instructs Dynare to leave the connection to the slave node
|
|
|
|
|
open after computation is complete, closing this connection
|
|
|
|
|
only when Dynare finishes processing.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: parallel_test
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Tests the parallel setup specified in the configuration file
|
|
|
|
|
without executing the ``.mod`` file. See :ref:`conf-file`, for
|
|
|
|
|
more information about the configuration file.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: -DMACRO_VARIABLE=MACRO_EXPRESSION
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Defines a macro-variable from the command line (the same
|
|
|
|
|
effect as using the Macro directive ``@#define`` in a model
|
|
|
|
|
file, see :ref:`macro-proc-lang`).
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: -I<<path>>
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Defines a path to search for files to be included by the
|
2019-06-25 08:58:44 +02:00
|
|
|
|
macro processor (using the ``@#include`` command). Multiple
|
2018-12-01 22:56:11 +01:00
|
|
|
|
``-I`` flags can be passed on the command line. The paths will
|
|
|
|
|
be searched in the order that the ``-I`` flags are passed and
|
|
|
|
|
the first matching file will be used. The flags passed here
|
|
|
|
|
take priority over those passed to ``@#includepath``.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: nostrict
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Allows Dynare to issue a warning and continue processing when
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
1. there are more endogenous variables than equations.
|
|
|
|
|
2. an undeclared symbol is assigned in ``initval`` or ``endval``.
|
2019-02-18 12:19:14 +01:00
|
|
|
|
3. an undeclared symbol is found in the ``model`` block in
|
|
|
|
|
this case, it is automatically declared exogenous.
|
|
|
|
|
4. exogenous variables were declared but not used in the
|
2018-12-01 22:56:11 +01:00
|
|
|
|
``model`` block.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: fast
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2019-12-04 14:46:44 +01:00
|
|
|
|
Only useful with model option :opt:`use_dll`. Don’t recompile the
|
2018-12-01 22:56:11 +01:00
|
|
|
|
MEX files when running again the same model file and the lists
|
|
|
|
|
of variables and the equations haven’t changed. We use a 32
|
|
|
|
|
bit checksum, stored in ``<model filename>/checksum``. There
|
|
|
|
|
is a very small probability that the preprocessor misses a
|
|
|
|
|
change in the model. In case of doubt, re-run without the fast
|
|
|
|
|
option.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: minimal_workspace
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Instructs Dynare not to write parameter assignments to
|
|
|
|
|
parameter names in the .m file produced by the
|
|
|
|
|
preprocessor. This is potentially useful when running
|
|
|
|
|
``dynare`` on a large ``.mod`` file that runs into workspace
|
|
|
|
|
size limitations imposed by MATLAB.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. option:: compute_xrefs
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Tells Dynare to compute the equation cross references, writing
|
|
|
|
|
them to the output ``.m`` file.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2019-02-06 22:48:05 +01:00
|
|
|
|
.. option:: stochastic
|
|
|
|
|
|
|
|
|
|
Tells Dynare that the model to be solved is stochastic. If no
|
|
|
|
|
Dynare commands related to stochastic models (``stoch_simul``,
|
|
|
|
|
``estimation``, ...) are present in the ``.mod`` file, Dynare
|
|
|
|
|
understands by default that the model to be solved is
|
|
|
|
|
deterministic.
|
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
These options can be passed to the preprocessor by listing them
|
|
|
|
|
after the name of the ``.mod`` file. They can alternatively be
|
|
|
|
|
defined in the first line of the ``.mod`` file, this avoids typing
|
|
|
|
|
them on the command line each time a ``.mod`` file is to be
|
|
|
|
|
run. This line must be a Dynare comment (ie must begin with //)
|
|
|
|
|
and the options must be comma separated between ``--+`` options:
|
2019-02-17 23:32:09 +01:00
|
|
|
|
and ``+--``. Note that any text after the ``+--`` will be
|
|
|
|
|
discarded. As in the command line, if an option admits a value the
|
|
|
|
|
equal symbol must not be surrounded by spaces. For instance ``json
|
|
|
|
|
= compute`` is not correct, and should be written
|
2018-12-01 22:56:11 +01:00
|
|
|
|
``json=compute``.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
*Output*
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Depending on the computing tasks requested in the ``.mod`` file,
|
|
|
|
|
executing the ``dynare`` command will leave variables containing
|
|
|
|
|
results in the workspace available for further processing. More
|
|
|
|
|
details are given under the relevant computing tasks. The
|
|
|
|
|
``M_``,``oo_``, and ``options_`` structures are saved in a file
|
|
|
|
|
called ``FILENAME_results.mat``. If they exist, ``estim_params_``,
|
|
|
|
|
``bayestopt_``, ``dataset_``, ``oo_recursive_`` and
|
|
|
|
|
``estimation_info`` are saved in the same file.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. matvar:: M_
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Structure containing various information about the model.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. matvar:: options_
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Structure contains the values of the various options used by
|
|
|
|
|
Dynare during the computation.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. matvar:: oo_
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Structure containing the various results of the computations.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. matvar:: dataset_
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
A ``dseries`` object containing the data used for estimation.
|
2018-10-29 10:24:59 +01:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
.. matvar:: oo_recursive_
|
2018-10-29 10:24:59 +01:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Cell array containing the ``oo_`` structures obtained when
|
|
|
|
|
estimating the model for the different samples when performing
|
|
|
|
|
recursive estimation and forecasting. The ``oo_`` structure
|
|
|
|
|
obtained for the sample ranging to the `i` -th observation is
|
|
|
|
|
saved in the `i` -th field. The fields for non-estimated
|
|
|
|
|
endpoints are empty.
|
2018-10-29 10:24:59 +01:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
*Example*
|
2018-10-29 10:24:59 +01:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Call dynare from the MATLAB or Octave prompt, without or with options:
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
.. code-block:: matlab
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
>> dynare ramst
|
|
|
|
|
>> dynare ramst.mod savemacro
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
Alternatively the options can be passed in the first line of
|
|
|
|
|
``ramst.mod``:
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
.. code-block:: dynare
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
// --+ options: savemacro, json=compute +--
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
and then dynare called without passing options on the command line:
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
.. code-block:: matlab
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
>> dynare ramst
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dynare hooks
|
|
|
|
|
============
|
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
It is possible to call pre and post Dynare preprocessor hooks written
|
|
|
|
|
as MATLAB scripts. The script ``MODFILENAME/hooks/priorprocessing.m``
|
|
|
|
|
is executed before the call to Dynare’s preprocessor, and can be used
|
|
|
|
|
to programmatically transform the mod file that will be read by the
|
|
|
|
|
preprocessor. The script ``MODFILENAME/hooks/postprocessing.m`` is
|
|
|
|
|
gexecuted just after the call to Dynare’s preprocessor, and can be used
|
|
|
|
|
to programmatically transform the files generated by Dynare’s
|
|
|
|
|
preprocessor before actual computations start. The pre and/or post
|
|
|
|
|
dynare preprocessor hooks are executed if and only if the
|
|
|
|
|
aforementioned scripts are detected in the same folder as the the
|
|
|
|
|
model file, ``FILENAME.mod``.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Understanding Preprocessor Error Messages
|
|
|
|
|
=========================================
|
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
If the preprocessor runs into an error while processing your ``.mod``
|
|
|
|
|
file, it will issue an error. Due to the way that a parser works,
|
|
|
|
|
sometimes these errors can be misleading. Here, we aim to demystify
|
|
|
|
|
these error messages.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
|
|
|
|
The preprocessor issues error messages of the form:
|
|
|
|
|
|
|
|
|
|
#. ``ERROR: <<file.mod>>: line A, col B: <<error message>>``
|
|
|
|
|
#. ``ERROR: <<file.mod>>: line A, cols B-C: <<error message>>``
|
|
|
|
|
#. ``ERROR: <<file.mod>>: line A, col B - line C, col D: <<error message>>``
|
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
The first two errors occur on a single line, with error two spanning
|
|
|
|
|
multiple columns. Error three spans multiple rows.
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
Often, the line and column numbers are precise, leading you directly
|
|
|
|
|
to the offending syntax. Infrequently however, because of the way the
|
|
|
|
|
parser works, this is not the case. The most common example of
|
|
|
|
|
misleading line and column numbers (and error message for that matter)
|
|
|
|
|
is the case of a missing semicolon, as seen in the following example::
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-12-01 22:56:11 +01:00
|
|
|
|
varexo a, b
|
|
|
|
|
parameters c, ...;
|
2018-10-25 16:31:53 +02:00
|
|
|
|
|
2018-10-29 10:24:59 +01:00
|
|
|
|
In this case, the parser doesn’t know a semicolon is missing at the
|
|
|
|
|
end of the ``varexo`` command until it begins parsing the second line
|
|
|
|
|
and bumps into the ``parameters`` command. This is because we allow
|
|
|
|
|
commands to span multiple lines and, hence, the parser cannot know
|
|
|
|
|
that the second line will not have a semicolon on it until it gets
|
|
|
|
|
there. Once the parser begins parsing the second line, it realizes
|
|
|
|
|
that it has encountered a keyword, ``parameters``, which it did not
|
|
|
|
|
expect. Hence, it throws an error of the form: ``ERROR: <<file.mod>>:
|
|
|
|
|
line 2, cols 0-9: syntax error, unexpected PARAMETERS``. In this case,
|
|
|
|
|
you would simply place a semicolon at the end of line one and the
|
|
|
|
|
parser would continue processing.
|
2019-02-18 17:56:37 +01:00
|
|
|
|
|
|
|
|
|
It is also helpful to keep in mind that any piece of code that does not violate
|
|
|
|
|
Dynare syntax, but at the same time is not recognized by the parser, is interpreted
|
2019-10-02 11:36:05 +02:00
|
|
|
|
as native MATLAB code. This code will be directly passed to the ``driver`` script.
|
2019-02-18 17:56:37 +01:00
|
|
|
|
Investigating ``driver.m`` file then helps with debugging. Such problems most often
|
|
|
|
|
occur when defined variable or parameter names have been misspelled so that Dynare's
|
|
|
|
|
parser is unable to recognize them.
|