Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • giovanma/dynare
  • giorgiomas/dynare
  • Vermandel/dynare
  • Dynare/dynare
  • normann/dynare
  • MichelJuillard/dynare
  • wmutschl/dynare
  • FerhatMihoubi/dynare
  • sebastien/dynare
  • lnsongxf/dynare
  • rattoma/dynare
  • CIMERS/dynare
  • FredericKarame/dynare
  • SumuduK/dynare
  • MinjeJeon/dynare
  • camilomrch/dynare
  • DoraK/dynare
  • avtishin/dynare
  • selma/dynare
  • claudio_olguin/dynare
  • jeffjiang07/dynare
  • EthanSystem/dynare
  • stepan-a/dynare
  • wjgatt/dynare
  • JohannesPfeifer/dynare
  • gboehl/dynare
  • ebenetce/dynare
  • chskcau/dynare-doc-fixes
28 results
Select Git revision
Loading items
Show changes

Commits on Source 2

Showing
with 182 additions and 81 deletions
...@@ -357,6 +357,13 @@ by the ``dynare`` command. ...@@ -357,6 +357,13 @@ by the ``dynare`` command.
without executing the ``.mod`` file. See :ref:`conf-file`, for without executing the ``.mod`` file. See :ref:`conf-file`, for
more information about the configuration file. more information about the configuration file.
.. option:: parallel_use_psexec=true|false
For local execution under Windows operating system,
set ``parallel_use_psexec=false`` to use ``start``
instead of ``psexec``, to properly allocate affinity when there are
more than 32 cores in the local machine. [default=true]
.. option:: -DMACRO_VARIABLE=MACRO_EXPRESSION .. option:: -DMACRO_VARIABLE=MACRO_EXPRESSION
Defines a macro-variable from the command line (the same effect as Defines a macro-variable from the command line (the same effect as
......
...@@ -4416,10 +4416,15 @@ The coefficients of the decision rules are stored as follows: ...@@ -4416,10 +4416,15 @@ The coefficients of the decision rules are stored as follows:
to all endogenous in the declaration order. to all endogenous in the declaration order.
* :math:`A` is stored in ``oo_.dr.ghx``. The matrix rows correspond to * :math:`A` is stored in ``oo_.dr.ghx``. The matrix rows correspond to
all endogenous in DR-order. The matrix columns correspond to state all endogenous in DR-order. The matrix columns correspond to state
variables in DR-order. variables in DR-order, as given by ``oo_.dr.state_var``. (N.B.: if the
``block`` option to the ``model`` block has been specified, then rows
are in declaration order, and columns are ordered
according to ``oo_.dr.state_var`` which may differ from DR-order.)
* :math:`B` is stored ``oo_.dr.ghu``. The matrix rows correspond to * :math:`B` is stored ``oo_.dr.ghu``. The matrix rows correspond to
all endogenous in DR-order. The matrix columns correspond to all endogenous in DR-order. The matrix columns correspond to
exogenous variables in declaration order. exogenous variables in declaration order. (N.B.: if the
``block`` option to the ``model`` block has been specified, then rows
are in declaration order.)
Of course, the shown form of the approximation is only stylized, Of course, the shown form of the approximation is only stylized,
because it neglects the required different ordering in :math:`y^s` and because it neglects the required different ordering in :math:`y^s` and
...@@ -5111,6 +5116,16 @@ block decomposition of the model (see :opt:`block`). ...@@ -5111,6 +5116,16 @@ block decomposition of the model (see :opt:`block`).
See :opt:`graph_format <graph_format = ( FORMAT, FORMAT... )>`. See :opt:`graph_format <graph_format = ( FORMAT, FORMAT... )>`.
.. option:: no_init_estimation_check_first_obs
Do not check for stochastic singularity in first period. If used, `ESTIMATION CHECKS`
does not return an error if the check fails only in first observation.
This should only be used when observing stock variables (e.g. capital) in first period, on top of their associated flow (e.g. investment).
Using this option may lead to a crash or provide undesired/wrong results for badly specified problems
(e.g. the additional variable observed in first period is not predetermined).
For advanced use only.
.. option:: lik_init = INTEGER .. option:: lik_init = INTEGER
Type of initialization of Kalman filter: Type of initialization of Kalman filter:
...@@ -5542,6 +5557,48 @@ block decomposition of the model (see :opt:`block`). ...@@ -5542,6 +5557,48 @@ block decomposition of the model (see :opt:`block`).
density, and posterior statistics from an existing ``_results`` density, and posterior statistics from an existing ``_results``
file instead of recomputing them. file instead of recomputing them.
.. option:: mh_initialize_from_previous_mcmc
This option allows to pick initial values for new MCMC from a previous one,
where the model specification, the number of estimated parameters,
(some) prior might have changed (so a situation where ``load_mh_file`` would not work).
If an additional parameter is estimated, it is automatically initialized from prior_draw.
Note that, if this option is used to skip the optimization step, you should use a sampling method which does not require
a proposal density, like slice. Otherwise, optimization should always be done beforehand or a mode file with
an appropriate posterior covariance matrix should be used.
.. option:: mh_initialize_from_previous_mcmc_directory = FILENAME
If ``mh_initialize_from_previous_mcmc`` is set, users must provide here
the path to the standard FNAME folder from where to load prior definitions and
last MCMC values to be used to initialize the new MCMC.
Example: if previous project directory is ``/my_previous_dir`` and FNAME is ``mymodel``,
users should set the option as
``mh_initialize_from_previous_mcmc_directory = '/my_previous_dir/mymodel'``
Dynare will then look for the last record file into
``/my_previous_dir/mymodel/metropolis/mymodel_mh_history_<LAST>.mat``
and for the prior definition file into
``/my_previous_dir/mymodel/prior/definition.mat``
.. option:: mh_initialize_from_previous_mcmc_record = FILENAME
If ``mh_initialize_from_previous_mcmc`` is set, and whenever the standard file or directory tree
is not applicable to load initial values, users may directly provide here
the path to the record file from which to load
values to be used to initialize the new MCMC.
.. option:: mh_initialize_from_previous_mcmc_prior = FILENAME
If ``mh_initialize_from_previous_mcmc`` is set, and whenever the standard file or directory tree
is not applicable to load initial values, users may directly provide here
the path to the prior definition file, to get info in the priors used in previous MCMC.
.. option:: optim = (NAME, VALUE, ...) .. option:: optim = (NAME, VALUE, ...)
A list of NAME and VALUE pairs. Can be used to set options for A list of NAME and VALUE pairs. Can be used to set options for
...@@ -7821,11 +7878,11 @@ Shock Decomposition ...@@ -7821,11 +7878,11 @@ Shock Decomposition
decomposition. Default: ``0``. decomposition. Default: ``0``.
.. option:: fast_realtime = INTEGER .. option:: fast_realtime = INTEGER
fast_realtime = [INTEGER1:INTEGER2]
fast_realtime = [INTEGER1 INTEGER2 ...]
Runs the smoother only twice: once for the last in-sample and Runs the smoother only for the data vintages provided
once for the last out-of-sample data point, where the provided by the specified integer (vector).
integer defines the last observation (equivalent to
:opt:`nobs`). Default: not enabled.
.. option:: with_epilogue .. option:: with_epilogue
......
...@@ -246,6 +246,7 @@ License: GPL-3+ ...@@ -246,6 +246,7 @@ License: GPL-3+
Files: m4/ax_blas.m4 m4/ax_lapack.m4 Files: m4/ax_blas.m4 m4/ax_lapack.m4
Copyright: 2008-2009 Steven G. Johnson <stevenj@alum.mit.edu> Copyright: 2008-2009 Steven G. Johnson <stevenj@alum.mit.edu>
2019 Geoffrey M. Oxberry <goxberry@gmail.com>
License: GPL-3+ with Autoconf exception License: GPL-3+ with Autoconf exception
Files: m4/ax_compare_version.m4 Files: m4/ax_compare_version.m4
...@@ -262,6 +263,7 @@ Copyright: 2008 Benjamin Kosnik <bkoz@redhat.com> ...@@ -262,6 +263,7 @@ Copyright: 2008 Benjamin Kosnik <bkoz@redhat.com>
2015 Moritz Klammler <moritz@klammler.eu> 2015 Moritz Klammler <moritz@klammler.eu>
2016, 2018 Krzesimir Nowak <qdlacz@gmail.com> 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
2019 Enji Cooper <yaneurabeya@gmail.com> 2019 Enji Cooper <yaneurabeya@gmail.com>
2020 Jason Merrill <jason@redhat.com>
License: FSFAP License: FSFAP
Files: m4/ax_latex_class.m4 m4/ax_latex_test.m4 Files: m4/ax_latex_class.m4 m4/ax_latex_test.m4
...@@ -311,6 +313,7 @@ Copyright: 2008 Benjamin Kosnik <bkoz@redhat.com> ...@@ -311,6 +313,7 @@ Copyright: 2008 Benjamin Kosnik <bkoz@redhat.com>
2015 Moritz Klammler <moritz@klammler.eu> 2015 Moritz Klammler <moritz@klammler.eu>
2016, 2018 Krzesimir Nowak <qdlacz@gmail.com> 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
2019 Enji Cooper <yaneurabeya@gmail.com> 2019 Enji Cooper <yaneurabeya@gmail.com>
2020 Jason Merrill <jason@redhat.com>
License: FSFAP License: FSFAP
Files: preprocessor/m4/ax_latex_class.m4 Files: preprocessor/m4/ax_latex_class.m4
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
# LICENSE # LICENSE
# #
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2019 Geoffrey M. Oxberry <goxberry@gmail.com>
# #
# This program is free software: you can redistribute it and/or modify it # This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the # under the terms of the GNU General Public License as published by the
...@@ -63,11 +64,11 @@ ...@@ -63,11 +64,11 @@
# modified version of the Autoconf Macro, you may extend this special # modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well. # exception to the GPL to apply to your modified version as well.
#serial 15 #serial 17
AU_ALIAS([ACX_BLAS], [AX_BLAS]) AU_ALIAS([ACX_BLAS], [AX_BLAS])
AC_DEFUN([AX_BLAS], [ AC_DEFUN([AX_BLAS], [
AC_PREREQ(2.50) AC_PREREQ([2.55])
AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])
ax_blas_ok=no ax_blas_ok=no
...@@ -77,7 +78,9 @@ AC_ARG_WITH(blas, ...@@ -77,7 +78,9 @@ AC_ARG_WITH(blas,
case $with_blas in case $with_blas in
yes | "") ;; yes | "") ;;
no) ax_blas_ok=disable ;; no) ax_blas_ok=disable ;;
-* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;; -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o)
BLAS_LIBS="$with_blas"
;;
*) BLAS_LIBS="-l$with_blas" ;; *) BLAS_LIBS="-l$with_blas" ;;
esac esac
...@@ -93,7 +96,7 @@ if test $ax_blas_ok = no; then ...@@ -93,7 +96,7 @@ if test $ax_blas_ok = no; then
if test "x$BLAS_LIBS" != x; then if test "x$BLAS_LIBS" != x; then
save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS]) AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS])
AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes], [BLAS_LIBS=""]) AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes], [BLAS_LIBS=""])
AC_MSG_RESULT($ax_blas_ok) AC_MSG_RESULT($ax_blas_ok)
LIBS="$save_LIBS" LIBS="$save_LIBS"
fi fi
...@@ -103,7 +106,7 @@ fi ...@@ -103,7 +106,7 @@ fi
if test $ax_blas_ok = no; then if test $ax_blas_ok = no; then
save_LIBS="$LIBS"; LIBS="$LIBS" save_LIBS="$LIBS"; LIBS="$LIBS"
AC_MSG_CHECKING([if $sgemm is being linked in already]) AC_MSG_CHECKING([if $sgemm is being linked in already])
AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes]) AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes])
AC_MSG_RESULT($ax_blas_ok) AC_MSG_RESULT($ax_blas_ok)
LIBS="$save_LIBS" LIBS="$save_LIBS"
fi fi
...@@ -174,7 +177,7 @@ fi ...@@ -174,7 +177,7 @@ fi
if test $ax_blas_ok = no; then if test $ax_blas_ok = no; then
save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS" save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
AC_MSG_CHECKING([for $sgemm in -framework vecLib]) AC_MSG_CHECKING([for $sgemm in -framework vecLib])
AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"]) AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"])
AC_MSG_RESULT($ax_blas_ok) AC_MSG_RESULT($ax_blas_ok)
LIBS="$save_LIBS" LIBS="$save_LIBS"
fi fi
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# The second argument, if specified, indicates whether you insist on an # The second argument, if specified, indicates whether you insist on an
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
# -std=c++11). If neither is specified, you get whatever works, with # -std=c++11). If neither is specified, you get whatever works, with
# preference for an extended mode. # preference for no added switch, and then for an extended mode.
# #
# The third argument, if specified 'mandatory' or if left unspecified, # The third argument, if specified 'mandatory' or if left unspecified,
# indicates that baseline support for the specified C++ standard is # indicates that baseline support for the specified C++ standard is
...@@ -35,13 +35,14 @@ ...@@ -35,13 +35,14 @@
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu> # Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
# Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com> # Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
# Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com> # Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
# Copyright (c) 2020 Jason Merrill <jason@redhat.com>
# #
# Copying and distribution of this file, with or without modification, are # Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice # permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 11 #serial 12
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl (serial version number 13). dnl (serial version number 13).
...@@ -62,6 +63,16 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl ...@@ -62,6 +63,16 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
AC_LANG_PUSH([C++])dnl AC_LANG_PUSH([C++])dnl
ac_success=no ac_success=no
m4_if([$2], [], [dnl
AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
ax_cv_cxx_compile_cxx$1,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[ax_cv_cxx_compile_cxx$1=yes],
[ax_cv_cxx_compile_cxx$1=no])])
if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
ac_success=yes
fi])
m4_if([$2], [noext], [], [dnl m4_if([$2], [noext], [], [dnl
if test x$ac_success = xno; then if test x$ac_success = xno; then
for alternative in ${ax_cxx_compile_alternatives}; do for alternative in ${ax_cxx_compile_alternatives}; do
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
# LICENSE # LICENSE
# #
# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2019 Geoffrey M. Oxberry <goxberry@gmail.com>
# #
# This program is free software: you can redistribute it and/or modify it # This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the # under the terms of the GNU General Public License as published by the
...@@ -64,7 +65,7 @@ ...@@ -64,7 +65,7 @@
# modified version of the Autoconf Macro, you may extend this special # modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well. # exception to the GPL to apply to your modified version as well.
#serial 8 #serial 10
AU_ALIAS([ACX_LAPACK], [AX_LAPACK]) AU_ALIAS([ACX_LAPACK], [AX_LAPACK])
AC_DEFUN([AX_LAPACK], [ AC_DEFUN([AX_LAPACK], [
...@@ -76,7 +77,9 @@ AC_ARG_WITH(lapack, ...@@ -76,7 +77,9 @@ AC_ARG_WITH(lapack,
case $with_lapack in case $with_lapack in
yes | "") ;; yes | "") ;;
no) ax_lapack_ok=disable ;; no) ax_lapack_ok=disable ;;
-* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;; -* | */* | *.a | *.so | *.so.* | *.dylib | *.dylib.* | *.o)
LAPACK_LIBS="$with_lapack"
;;
*) LAPACK_LIBS="-l$with_lapack" ;; *) LAPACK_LIBS="-l$with_lapack" ;;
esac esac
...@@ -93,7 +96,7 @@ fi ...@@ -93,7 +96,7 @@ fi
if test "x$LAPACK_LIBS" != x; then if test "x$LAPACK_LIBS" != x; then
save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"
AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS]) AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS])
AC_TRY_LINK_FUNC($cheev, [ax_lapack_ok=yes], [LAPACK_LIBS=""]) AC_LINK_IFELSE([AC_LANG_CALL([], [$cheev])], [ax_lapack_ok=yes], [LAPACK_LIBS=""])
AC_MSG_RESULT($ax_lapack_ok) AC_MSG_RESULT($ax_lapack_ok)
LIBS="$save_LIBS" LIBS="$save_LIBS"
if test $ax_lapack_ok = no; then if test $ax_lapack_ok = no; then
......
...@@ -29,35 +29,27 @@ AC_MSG_CHECKING([for options to compile MEX for MATLAB]) ...@@ -29,35 +29,27 @@ AC_MSG_CHECKING([for options to compile MEX for MATLAB])
MATLAB_CPPFLAGS="-I$MATLAB/extern/include" MATLAB_CPPFLAGS="-I$MATLAB/extern/include"
case ${MATLAB_ARCH} in case ${MATLAB_ARCH} in
glnx86 | glnxa64) glnxa64)
MATLAB_DEFS="$MATLAB_DEFS -D_GNU_SOURCE -DNDEBUG" MATLAB_DEFS="-D_GNU_SOURCE -DNDEBUG"
MATLAB_CFLAGS="-fexceptions -fPIC -pthread -g -O2" MATLAB_CFLAGS="-fexceptions -fPIC -pthread"
MATLAB_CXXFLAGS="-fPIC -pthread -g -O2" MATLAB_CXXFLAGS="-fPIC -pthread"
MATLAB_FCFLAGS="-fPIC -g -O2 -fexceptions" MATLAB_FCFLAGS="-fPIC -fexceptions"
MATLAB_LDFLAGS_NOMAP="-shared -Wl,--no-undefined -Wl,-rpath-link,$MATLAB/bin/${MATLAB_ARCH} -L$MATLAB/bin/${MATLAB_ARCH}" MATLAB_LDFLAGS_NOMAP="-shared -Wl,--no-undefined -Wl,-rpath-link,$MATLAB/bin/glnxa64 -L$MATLAB/bin/glnxa64"
MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP -Wl,--version-script,$MATLAB/extern/lib/${MATLAB_ARCH}/mexFunction.map" MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP -Wl,--version-script,$MATLAB/extern/lib/glnxa64/mexFunction.map"
MATLAB_LIBS="-lmx -lmex -lmat -lm -lstdc++ -lmwlapack -lmwblas" MATLAB_LIBS="-lmx -lmex -lmat -lm -lmwlapack -lmwblas"
if test "${MATLAB_ARCH}" = "glnx86"; then
MATLAB_DEFS="$MATLAB_DEFS -D_FILE_OFFSET_BITS=64"
MATLAB_CFLAGS="$MATLAB_CFLAGS -m32"
MATLAB_CXXFLAGS="$MATLAB_CXXFLAGS -m32"
else # glnxa64
MATLAB_CFLAGS="$MATLAB_CFLAGS -fno-omit-frame-pointer"
MATLAB_CXXFLAGS="$MATLAB_CXXFLAGS -fno-omit-frame-pointer"
fi
ax_mexopts_ok="yes" ax_mexopts_ok="yes"
;; ;;
win32 | win64) win64)
MATLAB_CFLAGS="-fexceptions -g -O2" MATLAB_CFLAGS="-fexceptions"
MATLAB_CXXFLAGS="-g -O2" MATLAB_CXXFLAGS=""
MATLAB_FCFLAGS="-g -O2 -fexceptions -fno-underscoring" MATLAB_FCFLAGS="-fexceptions -fno-underscoring"
MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG" MATLAB_DEFS="-DNDEBUG"
# The hack for libquadmath is needed because -static-libgfortran # The hack for libquadmath is needed because -static-libgfortran
# unfortunately does not imply the static linking of the former. # unfortunately does not imply the static linking of the former.
# The last part about winpthread is a hack to avoid dynamically linking # The last part about winpthread is a hack to avoid dynamically linking
# against libwinpthread DLL (which is pulled in by libstdc++, even without # against libwinpthread DLL (which is pulled in by libstdc++, even without
# using threads, since we are using the POSIX threads version of MinGW) # using threads, since we are using the POSIX threads version of MinGW)
MATLAB_LDFLAGS_NOMAP="-static-libgcc -static-libstdc++ -static-libgfortran -Wl,-Bstatic,--whole-archive -lquadmath -Wl,-Bdynamic,--no-whole-archive -shared -L$MATLAB/bin/${MATLAB_ARCH} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,-Bdynamic,--no-whole-archive" MATLAB_LDFLAGS_NOMAP="-static-libgcc -static-libstdc++ -static-libgfortran -Wl,-Bstatic,--whole-archive -lquadmath -Wl,-Bdynamic,--no-whole-archive -shared -L$MATLAB/bin/win64 -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,-Bdynamic,--no-whole-archive"
MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP \$(abs_top_srcdir)/mex.def" MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP \$(abs_top_srcdir)/mex.def"
MATLAB_LIBS="-lmex -lmx -lmat -lmwlapack -lmwblas" MATLAB_LIBS="-lmex -lmx -lmat -lmwlapack -lmwblas"
# Hack for static linking of libgomp, needed for OpenMP # Hack for static linking of libgomp, needed for OpenMP
...@@ -65,10 +57,10 @@ case ${MATLAB_ARCH} in ...@@ -65,10 +57,10 @@ case ${MATLAB_ARCH} in
ax_mexopts_ok="yes" ax_mexopts_ok="yes"
;; ;;
maci64) maci64)
MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG" MATLAB_DEFS="-DNDEBUG"
MATLAB_CFLAGS="-fno-common -fexceptions" MATLAB_CFLAGS="-fno-common -fexceptions"
MATLAB_CXXFLAGS="$MATLAB_CFLAGS" MATLAB_CXXFLAGS="-fno-common -fexceptions"
MATLAB_FCFLAGS="-g -O2 -fexceptions -fbackslash" MATLAB_FCFLAGS="-fexceptions -fbackslash"
MATLAB_LDFLAGS_NOMAP="-Wl,-twolevel_namespace -undefined error -bundle" MATLAB_LDFLAGS_NOMAP="-Wl,-twolevel_namespace -undefined error -bundle"
MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP -Wl,-exported_symbols_list,\$(abs_top_srcdir)/mexFunction-MacOSX.map" MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP -Wl,-exported_symbols_list,\$(abs_top_srcdir)/mexFunction-MacOSX.map"
# This -L flag is put here, hence later on the linker command line, so as # This -L flag is put here, hence later on the linker command line, so as
......
...@@ -5,7 +5,7 @@ dnl ...@@ -5,7 +5,7 @@ dnl
dnl AX_SLICOT([matlab]) dnl AX_SLICOT([matlab])
dnl AX_SLICOT([octave]) dnl AX_SLICOT([octave])
dnl dnl
dnl Copyright © 2012-2019 Dynare Team dnl Copyright © 2012-2021 Dynare Team
dnl dnl
dnl This file is part of Dynare. dnl This file is part of Dynare.
dnl dnl
...@@ -37,28 +37,17 @@ AC_DEFUN([AX_SLICOT], ...@@ -37,28 +37,17 @@ AC_DEFUN([AX_SLICOT],
else else
LDFLAGS_SLICOT="" LDFLAGS_SLICOT=""
fi fi
ac_save_LDFLAGS="$LDFLAGS" ac_save_LDFLAGS=$LDFLAGS
LDFLAGS_SAVED="$LDFLAGS"
# At this point we should add MATLAB_FCFLAGS to FCFLAGS for Windows (which has -fno-underscoring),
# but that does not work. The actual underscore test seems to happen at the very beginning of the
# macro. Hence the modification of FCFLAGS was moved higher (in mex/build/matlab/configure.ac).
AC_FC_FUNC(sb02od) AC_FC_FUNC(sb02od)
if test "$1" = matlab; then if test "$1" = matlab; then
LDFLAGS="$LDFLAGS $MATLAB_LDFLAGS_NOMAP $LDFLAGS_SLICOT" LDFLAGS="$LDFLAGS $MATLAB_LDFLAGS_NOMAP $LDFLAGS_SLICOT"
case ${MATLAB_ARCH} in
glnxa64 | win64 | maci64)
AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.8], [use_64_bit_indexing=yes], [use_64_bit_indexing=no])
;;
*)
use_64_bit_indexing=no
;;
esac
if test "$use_64_bit_indexing" = yes; then
AC_CHECK_LIB([slicot64_pic], [$sb02od], [LIBADD_SLICOT="-lslicot64_pic"], [has_slicot=no], [$MATLAB_LIBS]) AC_CHECK_LIB([slicot64_pic], [$sb02od], [LIBADD_SLICOT="-lslicot64_pic"], [has_slicot=no], [$MATLAB_LIBS])
else
AC_CHECK_LIB([slicot_pic], [$sb02od], [LIBADD_SLICOT="-lslicot_pic"], [has_slicot=no], [$MATLAB_LIBS])
fi
else else
LDFLAGS="$LDFLAGS $($MKOCTFILE -p LFLAGS) $LDFLAGS_SLICOT" LDFLAGS="$LDFLAGS $($MKOCTFILE -p LFLAGS) $LDFLAGS_SLICOT"
# Fallback on libslicot_pic if dynamic libslicot not found # Fallback on libslicot_pic if dynamic libslicot not found
...@@ -69,7 +58,7 @@ AC_DEFUN([AX_SLICOT], ...@@ -69,7 +58,7 @@ AC_DEFUN([AX_SLICOT],
[$($MKOCTFILE -p BLAS_LIBS) $($MKOCTFILE -p LAPACK_LIBS)]) [$($MKOCTFILE -p BLAS_LIBS) $($MKOCTFILE -p LAPACK_LIBS)])
fi fi
LDFLAGS="$ac_save_LDFLAGS" LDFLAGS=$ac_save_LDFLAGS
AC_SUBST(LDFLAGS_SLICOT) AC_SUBST(LDFLAGS_SLICOT)
AC_SUBST(LIBADD_SLICOT) AC_SUBST(LIBADD_SLICOT)
]) ])
...@@ -11,7 +11,7 @@ function WriteShockDecomp2Excel(z,shock_names,endo_names,i_var,initial_date,Dyna ...@@ -11,7 +11,7 @@ function WriteShockDecomp2Excel(z,shock_names,endo_names,i_var,initial_date,Dyna
% DynareModel [structure] Dynare model structure % DynareModel [structure] Dynare model structure
% DynareOptions [structure] Dynare options structure % DynareOptions [structure] Dynare options structure
% Copyright (C) 2016-2018 Dynare Team % Copyright (C) 2016-2021 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -120,7 +120,7 @@ for j=1:nvar ...@@ -120,7 +120,7 @@ for j=1:nvar
fig_name1 = strrep(fig_name1,'.',''); fig_name1 = strrep(fig_name1,'.','');
if ~ismac if ~ismac
[STATUS,MESSAGE] = xlswrite([OutputDirectoryName,filesep,DynareModel.fname,'_shock_decomposition',fig_mode,fig_name1],d0,endo_names{i_var(j)}); STATUS = xlswrite([OutputDirectoryName,filesep,DynareModel.fname,'_shock_decomposition',fig_mode,fig_name1],d0,endo_names{i_var(j)});
else else
writetable(cell2table(d0), [OutputDirectoryName,filesep,DynareModel.fname,'_shock_decomposition',fig_mode,fig_name1 '.xls'], 'Sheet', endo_names{i_var(j)},'WriteVariableNames',false); writetable(cell2table(d0), [OutputDirectoryName,filesep,DynareModel.fname,'_shock_decomposition',fig_mode,fig_name1 '.xls'], 'Sheet', endo_names{i_var(j)},'WriteVariableNames',false);
end end
......
...@@ -346,6 +346,7 @@ options_.ramsey.maxit = 500; ...@@ -346,6 +346,7 @@ options_.ramsey.maxit = 500;
% estimation % estimation
options_.initial_period = NaN; %dates(1,1); options_.initial_period = NaN; %dates(1,1);
options_.no_init_estimation_check_first_obs=false;
options_.dataset.file = []; options_.dataset.file = [];
options_.dataset.series = []; options_.dataset.series = [];
options_.dataset.firstobs = dates(); options_.dataset.firstobs = dates();
...@@ -395,6 +396,10 @@ options_.mh_tune_jscale.c1 = .02; ...@@ -395,6 +396,10 @@ options_.mh_tune_jscale.c1 = .02;
options_.mh_tune_jscale.c2 = .05; options_.mh_tune_jscale.c2 = .05;
options_.mh_tune_jscale.c3 = 4; options_.mh_tune_jscale.c3 = 4;
options_.mh_init_scale = 2*options_.mh_jscale; options_.mh_init_scale = 2*options_.mh_jscale;
options_.mh_initialize_from_previous_mcmc.status = false;
options_.mh_initialize_from_previous_mcmc.directory = '';
options_.mh_initialize_from_previous_mcmc.record = '';
options_.mh_initialize_from_previous_mcmc.prior = '';
options_.mh_mode = 1; options_.mh_mode = 1;
options_.mh_nblck = 2; options_.mh_nblck = 2;
options_.mh_recover = false; options_.mh_recover = false;
...@@ -465,6 +470,7 @@ options_.parallel = 0; ...@@ -465,6 +470,7 @@ options_.parallel = 0;
options_.parallel_info.isHybridMatlabOctave = false; options_.parallel_info.isHybridMatlabOctave = false;
options_.parallel_info.leaveSlaveOpen = 0; options_.parallel_info.leaveSlaveOpen = 0;
options_.parallel_info.RemoteTmpFolder = ''; options_.parallel_info.RemoteTmpFolder = '';
options_.parallel_info.use_psexec = true;
options_.number_of_grid_points_for_kde = 2^9; options_.number_of_grid_points_for_kde = 2^9;
quarter = 1; quarter = 1;
years = [1 2 3 4 5 10 20 30 40 50]; years = [1 2 3 4 5 10 20 30 40 50];
......
function [dr,info,M_,options_,oo_] = dr_block(dr,task,M_,options_,oo_,varargin) function [dr,info,M_,options_,oo_] = dr_block(dr,task,M_,options_,oo_,varargin)
% function [dr,info,M_,options_,oo_] = dr_block(dr,task,M_,options_,oo_,varargin) % function [dr,info,M_,options_,oo_] = dr_block(dr,task,M_,options_,oo_,varargin)
% computes the reduced form solution of a rational expectations model % computes the reduced form solution of a rational expectations block-decomposed model
% (first order approximation of the stochastic model around the deterministic steady state). % (first order approximation of the stochastic model around the deterministic steady state).
% %
% NB: This code does not work with option mfs > 0. The preprocessor has a check to avoid this
% configuration. See also #1726.
%
% INPUTS % INPUTS
% dr [matlab structure] Decision rules for stochastic simulations. % dr [matlab structure] Decision rules for stochastic simulations.
% task [integer] if task = 0 then dr_block computes decision rules. % task [integer] if task = 0 then dr_block computes decision rules.
...@@ -34,7 +37,7 @@ function [dr,info,M_,options_,oo_] = dr_block(dr,task,M_,options_,oo_,varargin) ...@@ -34,7 +37,7 @@ function [dr,info,M_,options_,oo_] = dr_block(dr,task,M_,options_,oo_,varargin)
% none. % none.
% %
% Copyright (C) 2010-2020 Dynare Team % Copyright (C) 2010-2021 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -63,13 +66,12 @@ end ...@@ -63,13 +66,12 @@ end
z = repmat(dr.ys,1,M_.maximum_lead + M_.maximum_lag + 1); z = repmat(dr.ys,1,M_.maximum_lead + M_.maximum_lag + 1);
zx = repmat([oo_.exo_simul oo_.exo_det_simul],M_.maximum_lead + M_.maximum_lag + 1, 1); zx = repmat([oo_.exo_simul oo_.exo_det_simul],M_.maximum_lead + M_.maximum_lag + 1, 1);
if (isfield(M_,'block_structure'))
data = M_.block_structure.block; if ~isfield(M_,'block_structure')
Size = length(M_.block_structure.block); error('Option ''block'' has not been specified')
else
data = M_;
Size = 1;
end end
data = M_.block_structure.block;
if options_.bytecode if options_.bytecode
[~, data]= bytecode('dynamic','evaluate', z, zx, M_.params, dr.ys, 1, data); [~, data]= bytecode('dynamic','evaluate', z, zx, M_.params, dr.ys, 1, data);
else else
...@@ -93,7 +95,7 @@ n_sv = size(dr.state_var, 2); ...@@ -93,7 +95,7 @@ n_sv = size(dr.state_var, 2);
dr.ghx = zeros(M_.endo_nbr, length(dr.state_var)); dr.ghx = zeros(M_.endo_nbr, length(dr.state_var));
dr.exo_var = 1:M_.exo_nbr; dr.exo_var = 1:M_.exo_nbr;
dr.ghu = zeros(M_.endo_nbr, M_.exo_nbr); dr.ghu = zeros(M_.endo_nbr, M_.exo_nbr);
for i = 1:Size for i = 1:length(data)
ghx = []; ghx = [];
indexi_0 = 0; indexi_0 = 0;
if (verbose) if (verbose)
......
...@@ -142,7 +142,7 @@ for file = 1:NumberOfDrawsFiles ...@@ -142,7 +142,7 @@ for file = 1:NumberOfDrawsFiles
dr = temp.pdraws{linee,2}; dr = temp.pdraws{linee,2};
else else
M_=set_parameters_locally(M_,temp.pdraws{linee,1}); M_=set_parameters_locally(M_,temp.pdraws{linee,1});
[dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_); [dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_)
end end
if first_call if first_call
endo_nbr = M_.endo_nbr; endo_nbr = M_.endo_nbr;
......
...@@ -115,7 +115,7 @@ for file = 1:NumberOfDrawsFiles ...@@ -115,7 +115,7 @@ for file = 1:NumberOfDrawsFiles
dr = temp.pdraws{linee,2}; dr = temp.pdraws{linee,2};
else else
M_=set_parameters_locally(M_,temp.pdraws{linee,1}); M_=set_parameters_locally(M_,temp.pdraws{linee,1});
[dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_); [dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_);
end end
if ~options_.pruning if ~options_.pruning
tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition); tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition);
......
...@@ -113,7 +113,7 @@ for file = 1:NumberOfDrawsFiles ...@@ -113,7 +113,7 @@ for file = 1:NumberOfDrawsFiles
dr = temp.pdraws{linee,2}; dr = temp.pdraws{linee,2};
else else
M_=set_parameters_locally(M_,temp.pdraws{linee,1}); M_=set_parameters_locally(M_,temp.pdraws{linee,1});
[dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_); [dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_);
end end
if ~options_.pruning if ~options_.pruning
tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition); tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition);
......
...@@ -141,7 +141,7 @@ for file = 1:NumberOfDrawsFiles ...@@ -141,7 +141,7 @@ for file = 1:NumberOfDrawsFiles
dr = temp.pdraws{linee,2}; dr = temp.pdraws{linee,2};
else else
M_=set_parameters_locally(M_,temp.pdraws{linee,1}); M_=set_parameters_locally(M_,temp.pdraws{linee,1});
[dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_); [dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_);
end end
if file==1 && linee==1 if file==1 && linee==1
[tmp, stationary_vars] = th_autocovariances(dr,ivar,M_,options_,nodecomposition); [tmp, stationary_vars] = th_autocovariances(dr,ivar,M_,options_,nodecomposition);
......
...@@ -280,9 +280,14 @@ clear(['+' fname '/driver']) ...@@ -280,9 +280,14 @@ clear(['+' fname '/driver'])
try try
evalin('base',[fname '.driver']) ; evalin('base',[fname '.driver']) ;
catch ME catch ME
W = evalin('base','whos');
diary off diary off
if ismember(fname,{W(:).name})
error('Your base workspace already contains a variable with the same name as the mod-file. You need to delete it or rename the mod-file.')
else
rethrow(ME) rethrow(ME)
end end
end
diary off diary off
......
...@@ -85,7 +85,7 @@ for i = 1:horizon ...@@ -85,7 +85,7 @@ for i = 1:horizon
end end
if nargout==3 if nargout==3
var_yf_ME=var_yf; var_yf_ME=var_yf;
[loc_H, loc_varlist] = ismember(options_.varobs', options_.varlist); [loc_H, loc_varlist] = ismember(options_.varobs, var_list);
loc_varlist(loc_varlist==0) = []; loc_varlist(loc_varlist==0) = [];
if ~isempty(loc_varlist) if ~isempty(loc_varlist)
var_yf_ME(:,loc_varlist) = var_yf(:,loc_varlist)+repmat(diag(M_.H(loc_H,loc_H))', horizon, 1); var_yf_ME(:,loc_varlist) = var_yf(:,loc_varlist)+repmat(diag(M_.H(loc_H,loc_H))', horizon, 1);
......
...@@ -133,7 +133,7 @@ no_identification_minimal = options_ident.no_identification_minimal; ...@@ -133,7 +133,7 @@ no_identification_minimal = options_ident.no_identification_minimal;
no_identification_spectrum = options_ident.no_identification_spectrum; no_identification_spectrum = options_ident.no_identification_spectrum;
%Compute linear approximation and fill dr structure %Compute linear approximation and fill dr structure
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_); [oo_.dr,info,M_,options_,oo_] = compute_decision_rules(M_,options_,oo_);
if info(1) == 0 %no errors in solution if info(1) == 0 %no errors in solution
% Compute parameter Jacobians for identification analysis % Compute parameter Jacobians for identification analysis
......
...@@ -39,7 +39,8 @@ function DynareResults = initial_estimation_checks(objective_function,xparam1,Dy ...@@ -39,7 +39,8 @@ function DynareResults = initial_estimation_checks(objective_function,xparam1,Dy
%get maximum number of simultaneously observed variables for stochastic %get maximum number of simultaneously observed variables for stochastic
%singularity check %singularity check
maximum_number_non_missing_observations=max(sum(~isnan(DynareDataset.data),2)); maximum_number_non_missing_observations=max(sum(~isnan(DynareDataset.data(2:end,:)),2));
init_number_non_missing_observations=sum(~isnan(DynareDataset.data(1,:)),2);
if DynareOptions.order>1 if DynareOptions.order>1
if any(any(isnan(DynareDataset.data))) if any(any(isnan(DynareDataset.data)))
...@@ -82,13 +83,33 @@ end ...@@ -82,13 +83,33 @@ end
non_zero_ME=length(EstimatedParameters.H_entries_to_check_for_positive_definiteness); non_zero_ME=length(EstimatedParameters.H_entries_to_check_for_positive_definiteness);
print_init_check_warning=false;
if maximum_number_non_missing_observations>Model.exo_nbr+non_zero_ME if maximum_number_non_missing_observations>Model.exo_nbr+non_zero_ME
error(['initial_estimation_checks:: Estimation can''t take place because there are less declared shocks than observed variables!']) error(['initial_estimation_checks:: Estimation can''t take place because there are less declared shocks than observed variables!'])
end end
if init_number_non_missing_observations>Model.exo_nbr+non_zero_ME
if DynareOptions.no_init_estimation_check_first_obs
print_init_check_warning=true;
else
error(['initial_estimation_checks:: Estimation can''t take place because there are less declared shocks than observed variables in first period!'])
end
end
if maximum_number_non_missing_observations>length(find(diag(Model.Sigma_e)))+non_zero_ME if maximum_number_non_missing_observations>length(find(diag(Model.Sigma_e)))+non_zero_ME
error(['initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance!']) error(['initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance!'])
end end
if init_number_non_missing_observations>length(find(diag(Model.Sigma_e)))+non_zero_ME
if DynareOptions.no_init_estimation_check_first_obs
print_init_check_warning=true;
else
error(['initial_estimation_checks:: Estimation can''t take place because too many shocks have been calibrated with a zero variance in first period!'])
end
end
if print_init_check_warning
fprintf('ESTIMATION_CHECKS: You decided to ignore test of stochastic singularity in first_obs.\n');
fprintf('ESTIMATION_CHECKS: If this was not done on purpose (typically when observing a stock variable [capital] in first period, on top of its flow [investment]),\n');
fprintf('ESTIMATION_CHECKS: it may lead to a crash or provide undesired/wrong results later on!\n');
end
if (any(BayesInfo.pshape >0 ) && DynareOptions.mh_replic) && DynareOptions.mh_nblck<1 if (any(BayesInfo.pshape >0 ) && DynareOptions.mh_replic) && DynareOptions.mh_nblck<1
error(['initial_estimation_checks:: Bayesian estimation cannot be conducted with mh_nblocks=0.']) error(['initial_estimation_checks:: Bayesian estimation cannot be conducted with mh_nblocks=0.'])
......
...@@ -211,10 +211,12 @@ while notsteady && t<smpl ...@@ -211,10 +211,12 @@ while notsteady && t<smpl
P(:,:,t+1) = T*P(:,:,t)*L(:,:,t)' + QQ; P(:,:,t+1) = T*P(:,:,t)*L(:,:,t)' + QQ;
end end
a(:,t+1) = T*atilde(:,t); a(:,t+1) = T*atilde(:,t);
Pf = P(:,:,t); Pf = P(:,:,t+1);
aK(1,:,t+1) = a(:,t+1); aK(1,:,t+1) = a(:,t+1);
for jnk=1:nk for jnk=1:nk
if jnk>1
Pf = T*Pf*T' + QQ; Pf = T*Pf*T' + QQ;
end
PK(jnk,:,:,t+jnk) = Pf; PK(jnk,:,:,t+jnk) = Pf;
if jnk>1 if jnk>1
aK(jnk,:,t+jnk) = T*dynare_squeeze(aK(jnk-1,:,t+jnk-1)); aK(jnk,:,t+jnk) = T*dynare_squeeze(aK(jnk-1,:,t+jnk-1));
......