Commit 248ad188 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Merge remote-tracking branch 'Dynare/master' into enterprise

Fixed conflicts in:

 - .gitlab-ci.yml
 - matlab/dynare_config.m
 - matlab/dynare_solve.m
 - matlab/initvalf.m
 - matlab/perfect-foresight-models/make_ex_.m
 - matlab/perfect-foresight-models/perfect_foresight_setup.m
 - mex/build/matlab/Makefile.am
 - mex/build/matlab/configure.ac
 - mex/build/octave/Makefile.am
 - mex/build/octave/configure.ac
 - mex/sources/Makefile.am
 - preprocessor
 - tests/Makefile.am
parents 367daa86 9a726e61
......@@ -2,7 +2,7 @@ variables:
GIT_SUBMODULE_STRATEGY: recursive
TERM: linux
MATLAB_VERSION: R2020a
OLD_MATLAB_VERSION: R2009b
OLD_MATLAB_VERSION: R2014a
# The next stanza creates the version number used for the source tarball and the
# binary packages. Here are the following possible cases:
......@@ -85,12 +85,10 @@ pkg_windows:
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- windows/deps/sources32/
- windows/deps/sources64/
- windows/deps/lib32/
- windows/deps/lib64/
# We do not cache lib{32,64}-msys2, mingw{32,64}, octave{32,64} and
# matlab{32,64}, because those are simply extracted from a tarball. It
# We do not cache lib64-msys2, mingw64, octave64 and
# matlab64, because those are simply extracted from a tarball. It
# would be a waste of space and of (re-compression) time.
artifacts:
paths:
......@@ -232,7 +230,7 @@ deploy_release_enterprise:
- pkg_windows
- pkg_macOS
script:
- f=(windows/exe/*) && osslsigncode sign -pkcs12 ~/dynare-object-signing.p12 -n Dynare -i https://www.dynare.org -t http://timestamp.digicert.com -in ${f[0]} -out ${f[0]}.signed && mv ${f[0]}.signed ${f[0]}
- f=(windows/exe/*) && osslsigncode sign -pkcs12 ~/cepremap-comodo-sectigo-code-signing.p12 -n Dynare -i https://www.dynare.org -t http://timestamp.comodoca.com -in ${f[0]} -out ${f[0]}.signed && mv ${f[0]}.signed ${f[0]}
- cp *.tar.xz /srv/www.dynare.org/release_ecb/source/
- cp windows/exe/* /srv/www.dynare.org/release_ecb/windows/
- cp windows/7z/* /srv/www.dynare.org/release_ecb/windows-7z/
......
Announcement for Dynare 4.6.2 (on 2020-09-07)
=============================================
We are pleased to announce the release of Dynare 4.6.2.
This maintenance release fixes various bugs.
The Windows, macOS and source packages are already available for download at
[the Dynare website](https://www.dynare.org/download/).
All users are strongly encouraged to upgrade.
This release is compatible with MATLAB versions ranging from 7.9 (R2009b) to
9.8 (R2020a), and with GNU Octave versions 5.2.0 (under Windows) and 4.4.1
(under macOS).
*Note for Windows users:* upon launching the Dynare installer, you may get a
warning emitted by Windows Defender SmartScreen, saying that this is an
unrecognized app and that it was prevented from starting. You can safely ignore
this warning, as long as you can verify on the next screen that CEPREMAP is the
editor of the software. This security warning is due to the fact that we had to
renew our code signing certificate (which had expired), and it takes some time
to rebuild our reputation as a software editor using the new certificate.
Here is a list of the problems identified in version 4.6.1 and that have been
fixed in version 4.6.2:
* Perfect foresight simulations of purely backward models could deliver an
incorrect result if some exogenous variable appeared with a lag of 2 or more
(and neither `block` nor `bytecode` option was used)
* Perfect foresight simulations of linear models could deliver an incorrect
result if the following four conditions were met:
+ the model was actually declared as linear through the `linear` option
+ there was an exogenous variable with a lead or a lag
+ `stack_solve_algo` was equal to 0 (the default) or 7
+ neither `block` nor `bytecode` option was used
* In stochastic simulations, for variables that actually do not leave the
steady state, reported simulated moments could be spurious (due to division
by zero)
* Displayed variance decompositions would only take into account measurement
errors if measurement errors were present for all observed variables
* The posterior variance decompositions with measurement errors computed with
`moments_varendo` were incorrect
* `moments_varendo` would not update `oo_.PosteriorTheoreticalMoments` if it
was already present, from *e.g.* an earlier run of `estimation`
* Identification would in some cases compute wrong Jacobian of moments
* Identification would display incorrect results if parameter dependence was
implemented via a steady state file
* `generate_trace_plots` would crash when measurement errors were present
* `estimation` would crash for correlated measurement errors
* Parallel execution/testing could crash instead of aborting with a proper
error message
* Under macOS, Dynare would incorrectly claim that it is compiled for Octave
5.2.0 (it is actually compiled for Octave 4.4.1)
* Using external functions in a model local variable would crash the
preprocessor
* Tolerance criteria for steady state computations were inconsistently set
* `stoch_simul` with its default `order=2` would crash with a message about
`hessian_eq_zero` not existing if an explicit `order=1` was present somewhere
else in the `.mod` file
* Model local variables were not written to the `modfile.json` JSON file
* Model local variables names would have two spurious underscores at their
point of definition in the `dynamic.json` and `static.json` files (but only
in the definition, not when they were used, which is inconsistent)
* The `solve_algo=9` option was not accessible. The `solve_algo=10` and
`solve_algo=11` options were not accessible with `block` (without `bytecode`)
* Under certain circumstances, `extended_path` would crash when used in
conjunction with the `block` option
* `extended_path` was not working with the `bytecode` option
* `shock_decomposition` was not accepting the options of `estimation` related
to smoothing
* `conditional_forecast` would display a warning even if the simulation was
successful
* The `prior_trunc` option of `identification` was not working
* The `rand_multivariate_student` value of the `proposal_distribution` option
was not working when used with the
`tailored_random_block_metropolis_hastings` posterior sampling method
* Perfect foresight simulations of backward models would crash if convergence
failed with complex-valued residuals
* The diffuse Kalman smoother would crash if `Finf` became singular
Announcement for Dynare 4.6.1 (on 2020-03-13)
=============================================
......
......@@ -26,7 +26,7 @@
}}
\author{S\'ebastien Villemot\thanks{Paris School of Economics and
CEPREMAP.} \and Johannes Pfeifer\thanks{University of Cologne. E-mail: \href{mailto:jpfeifer@uni-koeln.de}{\texttt{jpfeifer@uni-koeln.de}}.}}
CEPREMAP.} \and Johannes Pfeifer\thanks{Universität der Bundeswehr München. E-mail: \href{mailto:johannes.pfeifer@unibw.de}{\texttt{johannes.pfeifer@unibw.de}}.}}
\date{First version: September 2007 \hspace{1cm} This version: May 2017}
\maketitle
......
......@@ -4,7 +4,7 @@ The Dynare Reference Manual, version |version|
Currently the development team of Dynare is composed of:
* Stéphane Adjemian (Université du Maine, Gains)
* Houtan Bastani (CEPREMAP)
* Houtan Bastani
* Michel Juillard (Banque de France)
* Sumudu Kankanamge (Toulouse School of Economics)
* Frédéric Karamé (Université du Maine, Gains and CEPREMAP)
......@@ -12,7 +12,7 @@ Currently the development team of Dynare is composed of:
* Junior Maih (Norges Bank)
* Ferhat Mihoubi (Université Paris-Est Créteil, Érudite and CEPREMAP)
* Willi Mutschler (University of Münster)
* Johannes Pfeifer (University of Cologne)
* Johannes Pfeifer (Universität der Bundeswehr München)
* Marco Ratto (European Commission, Joint Research Centre - JRC)
* Sébastien Villemot (CEPREMAP)
......
......@@ -14,7 +14,7 @@ are necessary in that case.
In order to run Dynare, you need one of the following:
* MATLAB version 7.9 (R2009b) or above;
* MATLAB version 8.3 (R2014a) or above;
* GNU Octave version 4.4 or above, with the statistics package from
`Octave-Forge`_. Note however that the Dynare installers for Windows and
macOS require a more specific version of Octave, as indicated on the download
......
......@@ -229,7 +229,8 @@ by the ``dynare`` command.
.. option:: json = parse|check|transform|compute
Causes the preprocessor to output a version of the ``.mod`` file in
JSON format. When the JSON output is created depends on the value
JSON format to ``<<M_.dname>>/model/json/``.
When the JSON output is created depends on the value
passed. These values represent various steps of processing in the
preprocessor.
......@@ -257,7 +258,8 @@ by the ``dynare`` command.
.. option:: jsonstdout
Instead of writing output requested by ``json`` to files,
write to standard out.
write to standard out, i.e. to the MATLAB/Octave command window
(and the log-file).
.. option:: onlyjson
......
......@@ -740,7 +740,9 @@ required for external functions used in an EXPRESSION outside of a
provided as the only output of the M-/MEX file given as the
option argument. If NAME is not provided, this tells Dynare
that the M-/MEX file specified by the argument passed to NAME
returns the Jacobian as its second output argument.
returns the Jacobian as its second output argument. When this option is
not provided, Dynare will use finite difference approximations for
computing the derivatives of the function, whenever needed.
.. option:: second_deriv_provided [= NAME]
......@@ -750,7 +752,9 @@ required for external functions used in an EXPRESSION outside of a
that the M-/MEX file specified by the argument passed to NAME
returns the Hessian as its third output argument. NB: This
option can only be used if the ``first_deriv_provided`` option
is used in the same ``external_function`` command.
is used in the same ``external_function`` command. When this option is
not provided, Dynare will use finite difference approximations for
computing the Hessian derivatives of the function, whenever needed.
*Example*
......@@ -1502,7 +1506,7 @@ in this case ``initval`` is used to specify the terminal conditions.
perfect_foresight_setup(periods=200);
perfect_foresight_solver;
In this example, the problem is finding the optimal path for
consumption and capital for the periods :math:`t=1` to
......@@ -1769,7 +1773,7 @@ in this case ``initval`` is used to specify the terminal conditions.
in the last ``initval`` or ``endval`` block (or the steady state
file if you provided one, see :ref:`st-st`).
.. command:: initval_file (filename = FILENAME);
.. command:: initval_file (OPTIONS...);
|br| In a deterministic setup, this command is used to specify a
path for all endogenous and exogenous variables. The length of
......@@ -1786,33 +1790,534 @@ in this case ``initval`` is used to specify the terminal conditions.
by the path for endogenous variables for the simulation
periods (excluding initial and terminal conditions)
The command accepts three file formats:
In perfect foresight and stochastic contexts, ``steady`` uses the
first observation loaded by ``initval_file`` as guess value to
solve for the steady state of the model. This first observation is
determined by the ``first_obs`` option when it is used.
Dont mix ``initval_file`` with ``initval`` statements. However,
after ``initval_file``, you can modify the historical initial
values with ``histval`` or ``histval_file`` statement.
There can be several ``initval_file`` statements in a model
file. Each statement resets ``oo_.initval_series``.
*Options*
.. option:: datafile = FILENAME
filename = FILENAME (deprecated)
The name of the file containing the data. It must be included in quotes if the filename
contains a path or an extension. The command accepts the following file formats:
* M-file (extension ``.m``): for each endogenous and exogenous
variable, the file must contain a row or column vector of
the same name. Their length must be ``periods +
M_.maximum_lag + M_.maximum_lead``
the same name.
* MAT-file (extension ``.mat``): same as for M-files.
* Excel file (extension ``.xls`` or ``.xlsx``): for each
endogenous and exogenous, the file must contain a column of
the same name. NB: Octave only supports the ``.xlsx`` file
extension and must have the `io`_ package installed (easily
done via octave by typing ‘``pkg install -forge io``’).
endogenous and exogenous variable, the file must contain a
column of the same name. NB: Octave only supports the
``.xlsx`` file extension and must have the `io`_ package
installed (easily done via octave by typing ``pkg
install -forge io``). The first column may contain the date
of each observation.
* CSV files (extension ``.csv``): for each endogenous and
exogenous variable, the file must contain a column of the
same name. The first column may contain the date of each
observation.
.. option:: first_obs = {INTEGER | DATE}
The observation number or the date (see
:ref:`dates-members`) of the first observation to be used in the file
.. option:: first_simulation_period = {INTEGER | DATE}
The observation number in the file or the date (see
:ref:`dates <dates-members>`) at which the simulation (or the forecast) is
starting. This option avoids to have to compute the maximum
number of lags in the model. The observation corresponding to
the first period of simulation doesnt need to exist in the
file as the only dates necessary for initialization are before
that date.
.. option:: last_obs = {INTEGER | DATE}
The observaton number or the date (see
:ref:`dates-members`) of the last observation to be used in
the file.
.. option:: nobs = INTEGER
The number of observations to be used in the file (starting
with first of ``first_obs`` observation).
.. option:: series = DSERIES NAME
The name of a DSERIES containing the data (see :ref:`dseries-members`)
*Example 1*
::
var c x;
varexo e;
parameters a b c d;
a = 1.5;
b = -0,6;
c = 0.5;
d = 0.5;
model;
x = a*x(-1) + b*x(-2) + e;
log(c) = c*x + d*log(c(+1));
end;
initval_file(datafile=mydata.csv);
perfect_foresight_setup(periods=200);
perfect_foresight_solver;
The initial and terminal values are taken from file
``mydata.csv`` (nothing guarantees that these vales are the
steady state of the model). The guess value for the
trajectories are also taken from the file. The file must
contain at least 203 observations of variables ``c``, ``x``
and ``e``. If there are more than 203 observations available
in the file, the first 203 are used by
``perfect_foresight_setup(periods=200)``.
Note that the values for the auxiliary variable corresponding
to ``x(-2)`` are automatically computed by ``initval_file``.
*Example 2*
::
var c x;
varexo e;
parameters a b c d;
a = 1.5;
b = -0,6;
c = 0.5;
d = 0.5;
model;
x = a*x(-1) + b*x(-2) + e;
log(c) = c*x + d*log(c(+1));
end;
initval_file(datafile=mydata.csv,
first_obs=10);
perfect_foresight_setup(periods=200);
perfect_foresight_solver;
The initial and terminal values are taken from file
``mydata.csv`` starting with the 10th observation in the
file. There must be at least 212 observations in the file.
*Example 3*
::
var c x;
varexo e;
parameters a b c d;
a = 1.5;
b = -0,6;
c = 0.5;
d = 0.5;
model;
x = a*x(-1) + b*x(-2) + e;
log(c) = c*x + d*log(c(+1));
end;
ds = dseries(mydata.csv);
lds = log(ds);
initval_file(series=lds,
first_obs=2010Q1);
perfect_foresight_setup(periods=200);
perfect_foresight_solver;
The initial and terminal values are taken from dseries
``lds``. All observations are loaded starting with the 1st quarter of
2010 until the end of the file. There must be data available
at least until 2050Q3.
*Example 4*
::
.. warning:: The extension must be omitted in the command
argument. Dynare will automatically figure out the
extension and select the appropriate file type. If
there are several files with the same name but different
extensions, then the order of precedence is as follows:
first ``.m``, then ``.mat``, ``.xls`` and finally ``.xlsx``.
var c x;
varexo e;
parameters a b c d;
a = 1.5;
b = -0,6;
c = 0.5;
d = 0.5;
model;
x = a*x(-1) + b*x(-2) + e;
log(c) = c*x + d*log(c(+1));
end;
initval_file(datafile=mydata.csv,
first_simulation_period=2010Q1);
perfect_foresight_setup(periods=200);
perfect_foresight_solver;
The initial and terminal values are taken from file
``mydata.csv``. The observations in the file must have
dates. All observations are loaded from the 3rd quarter of
2009 until the end of the file. There must be data available
in the file at least until 2050Q1.
.. command:: histval_file (filename = FILENAME);
*Example 5*
::
var c x;
varexo e;
parameters a b c d;
a = 1.5;
b = -0,6;
c = 0.5;
d = 0.5;
model;
x = a*x(-1) + b*x(-2) + e;
log(c) = c*x + d*log(c(+1));
end;
initval_file(datafile=mydata.csv,
last_obs = 212);
perfect_foresight_setup(periods=200);
perfect_foresight_solver;
The initial and terminal values are taken from file
``mydata.csv``. The first 212 observations are loaded and the
first 203 observations will be used by
``perfect_foresight_setup(periods=200)``.
*Example 6*
::
var c x;
varexo e;
parameters a b c d;
a = 1.5;
b = -0,6;
c = 0.5;
d = 0.5;
model;
x = a*x(-1) + b*x(-2) + e;
log(c) = c*x + d*log(c(+1));
end;
initval_file(datafile=mydata.csv,
first_obs = 10,
nobs = 203);
perfect_foresight_setup(periods=200);
perfect_foresight_solver;
The initial and terminal values are taken from file
``mydata.csv``. Observations 10 to 212 are loaded.
*Example 7*
::
var c x;
varexo e;
parameters a b c d;
a = 1.5;
b = -0,6;
c = 0.5;
d = 0.5;
model;
x = a*x(-1) + b*x(-2) + e;
log(c) = c*x + d*log(c(+1));
end;
initval_file(datafile=mydata.csv,
first_obs = 10);
steady;
The values of the 10th observation of ``mydata.csv`` are used
as guess value to compute the steady state. The exogenous
variables are set to values found in the file or zero if these
variables aren't present.
.. command:: histval_file (OPTIONS...);
|br| This command is equivalent to ``histval``, except that it
reads its input from a file, and is typically used in conjunction
with ``smoother2histval``.
*Options*
.. option:: datafile = FILENAME
filename = FILENAME (deprecated)
The name of the file containing the data. The command accepts
the following file formats:
* M-file (extension ``.m``): for each endogenous and exogenous
variable, the file must contain a row or column vector of
the same name.
* MAT-file (extension ``.mat``): same as for M-files.
* Excel file (extension ``.xls`` or ``.xlsx``): for each
endogenous and exogenous variable, the file must contain a
column of the same name. NB: Octave only supports the
``.xlsx`` file extension and must have the `io`_ package
installed (easily done via octave by typing ‘``pkg
install -forge io``’). The first column may contain the
date of each observation.
* CSV files (extension ``.csv``): for each endogenous and
exogenous variable, the file must contain a column of the
same name. The first column may contain the date of each
observation.
.. option:: first_obs = {INTEGER | DATE}
The observation number or the date (see :ref:`dates-members`) of
the first observation to be used in the file
.. option:: first_simulation_period = {INTEGER | DATE}
The observation number in the file or the date (see
:ref:`dates-members`) at which the simulation (or the forecast) is
starting. This option avoids to have to compute the maximum
number of lags in the model. The observation corresponding to
the first period of simulation doesn’t need to exist in the
file as the only dates necessary for initialization are before
that date.
.. option:: last_obs = {INTEGER | DATE}
The observation number or the date (see :ref:`dates-members`) of the
last observation to be used in the file.
.. option:: nobs = INTEGER
The number of observations to be used in the file (starting
with first of ``first_obs`` observation).
.. option:: series = DSERIES NAME
The name of a DSERIES containing the data (see :ref:`dseries-members`)
*Example 1*
::
var c x;
varexo e;
parameters a b c d;
a = 1.5;
b = -0,6;
c = 0.5;
d = 0.5;
model;
x = a*x(-1) + b*x(-2) + e;
log(c) = c*x + d*log(c(+1));
end;
steady_state_model;
x = 0;
c = exp(c*x/(1 - d));
end;
histval_file(datafile=mydata.csv);
stoch_simul(order=1,periods=100);
The initial values for the stochastic simulation are taken
from the two first rows of file ``mydata.csv``.
*Example 2*
::
var c x;
varexo e;
parameters a b c d;
a = 1.5;