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

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
  • chskcau/dynare-doc-fixes
27 results
Select Git revision
Show changes
Commits on Source (1555)
Showing
with 1185 additions and 247 deletions
# NB: whenever the present file is modified, the same modification should be
# applied to the copy in preprocessor.git
# For general information about our coding style, and the specific version
# of clang-format used, see:
# https://git.dynare.org/Dynare/dynare/-/wikis/CodingGuidelines#c-code
# For the list of options of clang-format, see:
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# Effective configuration can be obtained with:
# clang-format --dump-config
# The RemoveParentheses and RemoveSemicolon option are not permanently set,
# because the clang-format manual (as of version 19) states that these
# options can lead to incorrect formatting and thus their result should be
# carefully reviewed.
Language: Cpp
Standard: c++20
ColumnLimit: 100
BasedOnStyle: GNU
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: Yes
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
Cpp11BracedListStyle: true
DeriveLineEnding: false
IndentPPDirectives: AfterHash
InsertNewlineAtEOF: true
PackConstructorInitializers: NextLine
PPIndentWidth: 1
PointerAlignment: Left
# RemoveParentheses: ReturnStatement
# RemoveSemicolon: true
SpaceAfterTemplateKeyword: false
SpaceBeforeParens: ControlStatements
SpaceBeforeCpp11BracedList: true
# NB: to use clang-tidy on the MEX source code, make sure that you have
# libomp-dev installed (the LLVM implementation of OpenMP)
# TODO: add the following check families:
# - bugprone-*
# - cppcoreguidelines-
Checks: 'performance-*,modernize-*,-modernize-use-trailing-return-type,-clang-diagnostic-unqualified-std-cast-call'
((c-mode . ((indent-tabs-mode . nil) ((c-mode . ((indent-tabs-mode . nil)
(fill-column . 100)
(c-file-style . "gnu"))) (c-file-style . "gnu")))
(c++-mode . ((indent-tabs-mode . nil) (c++-mode . ((indent-tabs-mode . nil)
(fill-column . 100)
(c-file-style . "gnu"))) (c-file-style . "gnu")))
(makefile-mode . ((indent-tabs-mode . t))) (makefile-mode . ((indent-tabs-mode . t)))
(octave-mode . ((indent-tabs-mode . nil) (octave-mode . ((indent-tabs-mode . nil)
......
...@@ -23,10 +23,13 @@ ...@@ -23,10 +23,13 @@
/matlab/supported_octave_version.m /matlab/supported_octave_version.m
# Created by the macOS package build script # Created by the macOS package build script
/macOS/deps/sources64/ /macOS/deps/arm64/sources64/
/macOS/deps/x86_64/sources64/
/macOS/deps/tarballs/ /macOS/deps/tarballs/
/macOS/deps/lib64/ /macOS/deps/arm64/lib64/
/macOS/deps/x86_64/lib64/
build-doc
# Emacs stuff # Emacs stuff
TAGS
scripts/dynare.elc scripts/dynare.elc
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
TERM: linux TERM: linux
MATLAB_VERSION: R2023b MATLAB_VERSION: R2024b
OLD_MATLAB_VERSION: R2014a OLD_MATLAB_VERSION: R2018b
# To ensure that "false && true" fails, see https://gitlab.com/gitlab-org/gitlab-runner/-/issues/25394#note_412609647
FF_ENABLE_BASH_EXIT_CODE_CHECK: 'true'
# The next stanza creates the version number used for the source tarball and the # The next stanza creates the version number used for the source tarball and the
# binary packages. Here are the following possible cases: # binary packages. Here are the following possible cases:
# - if VERSION was already set (when manually running a pipeline), use it # - if VERSION was already set (when manually running a pipeline), use it
# - if we are in the official Dynare repository: # - if we are in the official Dynare repository:
# + if on a tag: use the tag # + if on a tag: use the tag
# + if on master: use 6-unstable-$TIMESTAMP-$COMMIT # + if on master: use 7-unstable-$TIMESTAMP-$COMMIT
# + on another branch: use $BRANCH-$TIMESTAMP-$COMMIT # + on another branch: use $BRANCH-$TIMESTAMP-$COMMIT
# - if in a personal repository: use $USER-$TIMESTAMP-$COMMIT # - if in a personal repository: use $USER-$TIMESTAMP-$COMMIT
before_script: before_script:
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ -n $CI_COMMIT_TAG ]] && export VERSION=$CI_COMMIT_TAG' - 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ -n $CI_COMMIT_TAG ]]; then export VERSION=$CI_COMMIT_TAG; fi'
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ $CI_COMMIT_REF_NAME == master ]] && export VERSION=6-unstable-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA' - 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ $CI_COMMIT_REF_NAME == master ]]; then export VERSION=7-unstable-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && export VERSION=$CI_COMMIT_REF_NAME-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA' - 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]]; then export VERSION=$CI_COMMIT_REF_NAME-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
- '[[ -z $VERSION ]] && export VERSION=$CI_PROJECT_NAMESPACE-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA' - 'if [[ -z $VERSION ]]; then export VERSION=$CI_PROJECT_NAMESPACE-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
stages: stages:
- build - build
...@@ -49,8 +51,12 @@ build_doc: ...@@ -49,8 +51,12 @@ build_doc:
stage: build stage: build
script: script:
- meson rewrite kwargs set project / version "$VERSION" - meson rewrite kwargs set project / version "$VERSION"
- meson setup -Dbuild_for=octave build-doc # Use a local copy of MathJax to avoid using CDN (which are a privacy issue)
# NB: Debian 12 “Bookworm” has MathJax 2. The following needs to be updated
# when Debian moves to MathJax 3.
- meson setup -Dbuild_for=octave -Dmathjax_path=mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML build-doc
- meson compile -v -C build-doc doc - meson compile -v -C build-doc doc
- cp -dR /usr/share/javascript/mathjax build-doc/dynare-manual.html/_static/
artifacts: artifacts:
paths: paths:
- build-doc/ - build-doc/
...@@ -60,7 +66,6 @@ pkg_source: ...@@ -60,7 +66,6 @@ pkg_source:
stage: pkg stage: pkg
script: script:
- meson rewrite kwargs set project / version "$VERSION" - meson rewrite kwargs set project / version "$VERSION"
- rm doc/manual/source/_static/mathjax && sed -i "/^mathjax_path *=/d" doc/manual/source/conf.py
- git commit -a -m "Source for $VERSION" - git commit -a -m "Source for $VERSION"
- meson setup -Dbuild_for=octave build-src - meson setup -Dbuild_for=octave build-src
- meson dist -C build-src --no-tests - meson dist -C build-src --no-tests
...@@ -97,17 +102,38 @@ pkg_windows: ...@@ -97,17 +102,38 @@ pkg_windows:
expire_in: 3 days expire_in: 3 days
needs: [ "build_doc" ] needs: [ "build_doc" ]
pkg_macOS: pkg_macOS_x86_64:
stage: pkg stage: pkg
script: script:
- meson rewrite kwargs set project / version "$VERSION" # Enforce the arm64 meson for rewrite, as a workaround to https://github.com/mesonbuild/meson/issues/12282
- env PATH="/opt/homebrew/bin:$PATH" meson rewrite kwargs set project / version "$VERSION"
- ln -s ~/tarballs macOS/deps/
- make -C macOS build-x86_64
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- macOS/deps/x86_64/sources64/
- macOS/deps/x86_64/lib64/
tags:
- macOS
artifacts:
paths:
- macOS/pkg/*
expire_in: 3 days
needs: [ "build_doc" ]
pkg_macOS_arm64:
stage: pkg
script:
# Enforce the arm64 meson for rewrite, as a workaround to https://github.com/mesonbuild/meson/issues/12282
- env PATH="/opt/homebrew/bin:$PATH" meson rewrite kwargs set project / version "$VERSION"
- ln -s ~/tarballs macOS/deps/ - ln -s ~/tarballs macOS/deps/
- arch -x86_64 make -C macOS - make -C macOS build-arm64
cache: cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths: paths:
- macOS/deps/sources64/ - macOS/deps/arm64/sources64/
- macOS/deps/lib64/ - macOS/deps/arm64/lib64/
tags: tags:
- macOS - macOS
artifacts: artifacts:
...@@ -116,6 +142,20 @@ pkg_macOS: ...@@ -116,6 +142,20 @@ pkg_macOS:
expire_in: 3 days expire_in: 3 days
needs: [ "build_doc" ] needs: [ "build_doc" ]
pkg_matlab_online:
stage: pkg
script:
- meson rewrite kwargs set project / version "$VERSION"
- cd scripts/matlab-online && ./packageDynare.sh
tags:
- matlab-online
artifacts:
paths:
- scripts/matlab-online/*.mltbx
expire_in: 3 days
needs: []
when: manual
test_matlab: test_matlab:
stage: test stage: test
script: script:
...@@ -136,6 +176,7 @@ test_old_matlab: ...@@ -136,6 +176,7 @@ test_old_matlab:
paths: paths:
- build-old-matlab/meson-logs/testlog.txt - build-old-matlab/meson-logs/testlog.txt
when: always when: always
needs: []
when: manual when: manual
test_octave: test_octave:
...@@ -151,6 +192,24 @@ test_octave: ...@@ -151,6 +192,24 @@ test_octave:
needs: [ "build_octave" ] needs: [ "build_octave" ]
when: manual when: manual
test_clang_format:
stage: test
script:
- meson setup -Dbuild_for=octave build-clang-format
- ninja -C build-clang-format clang-format-check
needs: []
test_clang_tidy:
stage: test
script:
# Hack needed for meson < 1.6.0 which only looks for unversioned clang-tidy
- mkdir -p ~/.local/bin && ln -s /usr/bin/clang-tidy-19 ~/.local/bin/clang-tidy
- export PATH="$HOME/.local/bin:$PATH"
- meson setup -Dbuild_for=octave build-clang-tidy
- ninja -C build-clang-tidy clang-tidy
needs: []
when: manual
# For the sign and deploy jobs, we don’t use the “needs” keyword, since we # For the sign and deploy jobs, we don’t use the “needs” keyword, since we
# don’t want those jobs to start before the “test” and “pkg” stages have # don’t want those jobs to start before the “test” and “pkg” stages have
# succeeded. Hence we stick to the “dependencies” keyword. # succeeded. Hence we stick to the “dependencies” keyword.
...@@ -183,8 +242,6 @@ deploy_manual_unstable: ...@@ -183,8 +242,6 @@ deploy_manual_unstable:
dependencies: dependencies:
- build_doc - build_doc
script: script:
- rm -rf build-doc/dynare-manual.html/_static/mathjax
- ln -s /usr/share/javascript/mathjax build-doc/dynare-manual.html/_static/mathjax
- rsync --recursive --links --delete build-doc/dynare-manual.html/ /srv/www.dynare.org/manual-unstable/ - rsync --recursive --links --delete build-doc/dynare-manual.html/ /srv/www.dynare.org/manual-unstable/
deploy_snapshot_unstable: deploy_snapshot_unstable:
...@@ -199,12 +256,14 @@ deploy_snapshot_unstable: ...@@ -199,12 +256,14 @@ deploy_snapshot_unstable:
- pkg_source - pkg_source
- pkg_windows - pkg_windows
- sign_windows - sign_windows
- pkg_macOS - pkg_macOS_arm64
- pkg_macOS_x86_64
script: script:
- cp build-src/meson-dist/*.tar.xz /srv/www.dynare.org/snapshot/source/ && ln -sf *.tar.xz /srv/www.dynare.org/snapshot/source/dynare-latest-src.tar.xz - cp build-src/meson-dist/*.tar.xz /srv/www.dynare.org/snapshot/source/ && ln -sf *.tar.xz /srv/www.dynare.org/snapshot/source/dynare-latest-src.tar.xz
- f=(windows/exe-signed/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows/dynare-latest-win.exe - f=(windows/exe-signed/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows/dynare-latest-win.exe
- f=(windows/7z/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows-7z/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows-7z/dynare-latest-win.7z - f=(windows/7z/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows-7z/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows-7z/dynare-latest-win.7z
- f=(windows/zip/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows-zip/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows-zip/dynare-latest-win.zip - f=(windows/zip/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows-zip/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows-zip/dynare-latest-win.zip
- f=(macOS/pkg/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/macos/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/macos/dynare-latest-macos.pkg - f=(macOS/pkg/*-arm64.pkg) && cp ${f[0]} /srv/www.dynare.org/snapshot/macos-arm64/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/macos-arm64/dynare-latest-macos-arm64.pkg
- f=(macOS/pkg/*-x86_64.pkg) && cp ${f[0]} /srv/www.dynare.org/snapshot/macos-x86_64/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/macos-x86_64/dynare-latest-macos-x86_64.pkg
- ~/update-snapshot-list.sh - ~/update-snapshot-list.sh
- curl -X POST -F token="$WEBSITE_PIPELINE_TRIGGER_TOKEN" -F ref=master https://git.dynare.org/api/v4/projects/40/trigger/pipeline - curl -X POST -F token="$WEBSITE_PIPELINE_TRIGGER_TOKEN" -F ref=master https://git.dynare.org/api/v4/projects/40/trigger/pipeline
...@@ -10,16 +10,10 @@ ...@@ -10,16 +10,10 @@
[submodule "matlab/utilities/tests"] [submodule "matlab/utilities/tests"]
path = matlab/utilities/tests path = matlab/utilities/tests
url = ../../Dynare/m-unit-tests.git url = ../../Dynare/m-unit-tests.git
[submodule "matlab/modules/dseries"] [submodule "matlab/dseries"]
path = matlab/modules/dseries path = matlab/dseries
url = ../../Dynare/dseries.git url = ../../Dynare/dseries.git
branch = master branch = master
[submodule "matlab/modules/reporting"]
path = matlab/modules/reporting
url = ../../Dynare/reporting.git
[submodule "contrib/jsonlab"]
path = contrib/jsonlab
url = https://github.com/fangq/jsonlab.git
[submodule "preprocessor"] [submodule "preprocessor"]
path = preprocessor path = preprocessor
url = ../../Dynare/preprocessor.git url = ../../Dynare/preprocessor.git
This diff is collapsed.
...@@ -54,6 +54,7 @@ a 32-bit Octave. ...@@ -54,6 +54,7 @@ a 32-bit Octave.
1. [**General Instructions**](#general-instructions) 1. [**General Instructions**](#general-instructions)
1. [**Debian or Ubuntu**](#debian-or-ubuntu) 1. [**Debian or Ubuntu**](#debian-or-ubuntu)
1. [**Fedora, CentOS or RHEL**](#fedora-centos-or-rhel) 1. [**Fedora, CentOS or RHEL**](#fedora-centos-or-rhel)
1. [**Arch Linux**](#arch-linux)
1. [**Windows**](#windows) 1. [**Windows**](#windows)
1. [**macOS**](#macos) 1. [**macOS**](#macos)
1. [**Docker**](#docker) 1. [**Docker**](#docker)
...@@ -70,7 +71,7 @@ A number of tools and libraries are needed in order to recompile everything. You ...@@ -70,7 +71,7 @@ A number of tools and libraries are needed in order to recompile everything. You
- [GNU Octave](https://www.octave.org) with - [GNU Octave](https://www.octave.org) with
- the development headers (if you want to compile the MEX for Octave) - the development headers (if you want to compile the MEX for Octave)
- the development libraries corresponding to the [UMFPACK](https://people.engr.tamu.edu/davis/suitesparse.html) packaged with Octave (if you want to compile the MEX for Octave) - the development libraries corresponding to the [UMFPACK](https://people.engr.tamu.edu/davis/suitesparse.html) packaged with Octave (if you want to compile the MEX for Octave)
- Optionally, the [Control](https://octave.sourceforge.io/control/), [IO](https://octave.sourceforge.io/io/), [Optimization](https://octave.sourceforge.io/optim/) and [Statistics](https://octave.sourceforge.io/statistics/) package either installed via your package manager or through [Octave Forge](https://octave.sourceforge.io/). - the [statistics](https://octave.sourceforge.io/statistics/) package and, optionally, the [control](https://octave.sourceforge.io/control/), [io](https://octave.sourceforge.io/io/) and [optimization](https://octave.sourceforge.io/optim/) packages, either installed via your package manager or through [Octave Forge](https://octave.sourceforge.io/)
- [Meson](https://mesonbuild.com), version 0.64.0 or later - [Meson](https://mesonbuild.com), version 0.64.0 or later
- [Pkgconf](http://pkgconf.org/), or another pkg-config implementation - [Pkgconf](http://pkgconf.org/), or another pkg-config implementation
- [Bash](https://www.gnu.org/software/bash/) - [Bash](https://www.gnu.org/software/bash/)
...@@ -103,13 +104,13 @@ If you want a certain version (e.g. 5.x) , then add `--single-branch --branch 5. ...@@ -103,13 +104,13 @@ If you want a certain version (e.g. 5.x) , then add `--single-branch --branch 5.
If you want to compile for MATLAB, please run the following (after adapting the path to MATLAB): If you want to compile for MATLAB, please run the following (after adapting the path to MATLAB):
```sh ```sh
meson setup -Dmatlab_path=/usr/local/MATLAB/R2023a -Dbuildtype=debugoptimized build-matlab meson setup -Dmatlab_path=/usr/local/MATLAB/R2023b --buildtype=debugoptimized build-matlab
``` ```
The build directory will thus be `build-matlab`. The build directory will thus be `build-matlab`.
Or for Octave: Or for Octave:
```sh ```sh
meson setup -Dbuild_for=octave -Dbuildtype=debugoptimized build-octave meson setup -Dbuild_for=octave --buildtype=debugoptimized build-octave
``` ```
The build directory will thus be `build-octave`. The build directory will thus be `build-octave`.
...@@ -149,9 +150,10 @@ Note that running the testsuite with Octave requires the additional packages `ps ...@@ -149,9 +150,10 @@ Note that running the testsuite with Octave requires the additional packages `ps
Often, it does not make sense to run the complete testsuite. For instance, if you modify codes only related to the perfect foresight model solver, you can decide to run only a subset of the integration tests, with: Often, it does not make sense to run the complete testsuite. For instance, if you modify codes only related to the perfect foresight model solver, you can decide to run only a subset of the integration tests, with:
```sh ```sh
meson test -C <builddir> deterministic_simulations meson test -C <builddir> --suite deterministic_simulations
``` ```
This will run all the integration tests in `tests/deterministic_simulations`. This will run all the integration tests in `tests/deterministic_simulations`.
This syntax also works with a nested directory (e.g. `--suite deterministic_simulations/purely_forward`).
Finally if you want to run a single integration test, e.g. `deterministic_simulations/lbj/rbc.mod`: Finally if you want to run a single integration test, e.g. `deterministic_simulations/lbj/rbc.mod`:
```sh ```sh
...@@ -182,6 +184,7 @@ All the prerequisites are packaged: ...@@ -182,6 +184,7 @@ All the prerequisites are packaged:
- `texlive-fonts-extra` (for ccicons) - `texlive-fonts-extra` (for ccicons)
- `texlive-science` (for amstex) - `texlive-science` (for amstex)
- `lmodern` (for macroprocessor PDF) - `lmodern` (for macroprocessor PDF)
- `cm-super` (for BVAR à la Sims and GSA PDFs)
- `python3-sphinx` - `python3-sphinx`
- `tex-gyre` - `tex-gyre`
- `latexmk` - `latexmk`
...@@ -190,7 +193,7 @@ All the prerequisites are packaged: ...@@ -190,7 +193,7 @@ All the prerequisites are packaged:
You can install them all at once with: You can install them all at once with:
```sh ```sh
apt install gcc g++ gfortran octave-dev libboost-graph-dev libgsl-dev libmatio-dev libslicot-dev libslicot-pic libsuitesparse-dev flex libfl-dev bison meson pkgconf texlive texlive-publishers texlive-latex-extra texlive-fonts-extra texlive-science lmodern python3-sphinx make tex-gyre latexmk libjs-mathjax x13as apt install gcc g++ gfortran octave-dev libboost-graph-dev libgsl-dev libmatio-dev libslicot-dev libslicot-pic libsuitesparse-dev flex libfl-dev bison meson pkgconf texlive texlive-publishers texlive-latex-extra texlive-fonts-extra texlive-science lmodern cm-super python3-sphinx make tex-gyre latexmk libjs-mathjax x13as
``` ```
If you use MATLAB, we strongly advise to also `apt install matlab-support` and confirm to rename the GCC libraries shipped with MATLAB to avoid possible conflicts with GCC libraries shipped by your distribution. If you use MATLAB, we strongly advise to also `apt install matlab-support` and confirm to rename the GCC libraries shipped with MATLAB to avoid possible conflicts with GCC libraries shipped by your distribution.
...@@ -241,35 +244,36 @@ The documentation packages have slightly different names in CentOS and RHEL, but ...@@ -241,35 +244,36 @@ The documentation packages have slightly different names in CentOS and RHEL, but
# compile slicot from source and put it into /home/$USER/dynare/slicot/lib/ # compile slicot from source and put it into /home/$USER/dynare/slicot/lib/
mkdir -p /home/$USER/dynare/slicot mkdir -p /home/$USER/dynare/slicot
cd /home/$USER/dynare/slicot cd /home/$USER/dynare/slicot
wget https://deb.debian.org/debian/pool/main/s/slicot/slicot_5.0+20101122.orig.tar.gz wget https://github.com/SLICOT/SLICOT-Reference/archive/refs/tags/v5.9.tar.gz
tar xf slicot_5.0+20101122.orig.tar.gz tar xf v5.9.tar.gz
cd slicot-5.0+20101122 cd SLICOT-Reference-5.9
mkdir -p /home/$USER/dynare/slicot/lib mkdir -p /home/$USER/dynare/slicot/lib
# The following two lines are only for MATLAB # The following two lines are only for MATLAB
make FORTRAN=gfortran OPTS="-O2 -fPIC -fdefault-integer-8" LOADER=gfortran lib make -f makefile_Unix FORTRAN=gfortran OPTS="-O2 -fPIC -fdefault-integer-8" LOADER=gfortran lib
cp slicot.a /home/$USER/dynare/slicot/lib/libslicot64_pic.a cp slicot.a /home/$USER/dynare/slicot/lib/libslicot64_pic.a
# The following two lines are only for Octave # The following two lines are only for Octave
make FORTRAN=gfortran OPTS="-O2 -fPIC" LOADER=gfortran lib make -f makefile_Unix FORTRAN=gfortran OPTS="-O2 -fPIC" LOADER=gfortran lib
cp slicot.a /home/$USER/dynare/slicot/lib/libslicot_pic.a cp slicot.a /home/$USER/dynare/slicot/lib/libslicot_pic.a
# compile x13as from source and put it into /usr/bin/ # compile x13as from source and put it into /usr/bin/
mkdir -p /home/$USER/dynare/x13as mkdir -p /home/$USER/dynare/x13as
cd /home/$USER/dynare/x13as cd /home/$USER/dynare/x13as
wget https://www2.census.gov/software/x-13arima-seats/x13as/unix-linux/program-archives/x13as_asciisrc-v1-1-b60.tar.gz wget https://www2.census.gov/software/x-13arima-seats/x13as/unix-linux/program-archives/x13as_asciisrc-v1-1-b61.tar.gz
tar xf x13as_asciisrc-v1-1-b60.tar.gz tar xf x13as_asciisrc-v1-1-b61.tar.gz
sed -i "s|-static| |" makefile.gf # this removes '-static' in the makefile.gf sed -i "s|-static| |" makefile.gf # this removes '-static' in the makefile.gf
make -f makefile.gf FFLAGS="-O2 -std=legacy" PROGRAM=x13as make -f makefile.gf FFLAGS="-O2 -std=legacy" PROGRAM=x13as
sudo cp x13as /usr/bin/ sudo cp x13as /usr/bin/
``` ```
If you use MATLAB, we strongly advise to also rename or exclude the GCC libraries shipped with MATLAB to avoid possible conflicts with GCC libraries shipped by Fedora, see e.g. [Matlab on Fedora 33](https://mutschler.eu/linux/install-guides/fedora-post-install/#matlab) or [MATLAB-ArchWiki](https://wiki.archlinux.org/index.php/MATLAB) for instructions. If you use MATLAB, we strongly advise to also rename or exclude the GCC libraries shipped with MATLAB to avoid possible conflicts with GCC libraries shipped by Fedora, see e.g. the [OpenGL Section of the ArchWiki article on MATLAB](https://wiki.archlinux.org/title/MATLAB#OpenGL_acceleration) for instructions.
Now use the following commands if using MATLAB (adapt them for Octave, see above): Now use the following commands if using MATLAB (adapt them for Octave, see above):
```sh ```sh
cd /home/$USER/dynare cd /home/$USER/dynare
git clone --recurse-submodules https://git.dynare.org/dynare/dynare.git unstable git clone --recurse-submodules https://git.dynare.org/dynare/dynare.git unstable
cd unstable cd unstable
meson setup -Dmatlab_path=/usr/local/MATLAB/R2020b -Dfortran_args="[ '-B', '/home/$USER/dynare/slicot']" -Dbuildtype=debugoptimized build-matlab meson setup -Dmatlab_path=/usr/local/MATLAB/R2023b -Dfortran_args="[ '-B', '/home/$USER/dynare/slicot']" --buildtype=debugoptimized build-matlab
meson compile -C build-matlab meson compile -C build-matlab
``` ```
...@@ -289,6 +293,43 @@ bison --version # bison (GNU Bison) 3.6.4 ...@@ -289,6 +293,43 @@ bison --version # bison (GNU Bison) 3.6.4
``` ```
Now configure dynare as above. Now configure dynare as above.
## Arch Linux
The following steps show how to install Dynare on Arch Linux from source.
- Install all needed dependencies:
```sh
pacman -S git make meson boost blas gsl libmatio gcc-fortran gcc-libs
```
- Compile and install SLICOT:
```sh
wget https://github.com/SLICOT/SLICOT-Reference/archive/refs/tags/v5.9.tar.gz
tar xf v5.9.tar.gz
cd SLICOT-Reference-5.9
make -f makefile_Unix FORTRAN=gfortran OPTS="-O2 -fno-underscoring -fdefault-integer-8" LOADER=gfortran lib
mkdir -p /usr/local/lib
cp slicot.a /usr/local/lib/libslicot64_pic.a
cd ..
```
- Install `x13as-bin` from the AUR ([link to PKGBUILD](https://aur.archlinux.org/packages/x13as-bin)), either by using your favorite AUR-helper or by following the [Arch wiki](https://wiki.archlinux.org/title/Arch_User_Repository)
- Prepare the Dynare sources:
```sh
git clone --recurse-submodules https://git.dynare.org/Dynare/dynare.git
cd dynare
```
- Configure Dynare from the source directory (adjust `matlab_path` if you use a different version than R2024a):
```sh
meson setup -Dmatlab_path=/usr/local/MATLAB/R2024a --buildtype=debugoptimized build-matlab
```
- Compile:
```sh
meson compile -C build-matlab
```
- Optionally, run the testsuite:
```sh
meson test -C build-matlab
```
If you run into errors with GCC libraries/`libstdc++`, you need to prevent MATLAB from using the libraries it is shipping. For example, you could follow the [OpenGL Section of the ArchWiki article on MATLAB](https://wiki.archlinux.org/title/MATLAB#OpenGL_acceleration) by setting/exporting `LD_PRELOAD` and `LD_LIBRARY` (the exports could also be placed in your `.zprofile`). If necessary, add `java.opts` as described in the section.
## Windows ## Windows
- Install [MSYS2](http://www.msys2.org) - Install [MSYS2](http://www.msys2.org)
...@@ -306,10 +347,10 @@ pacman -S git bison flex make tar mingw-w64-x86_64-meson mingw-w64-x86_64-gcc mi ...@@ -306,10 +347,10 @@ pacman -S git bison flex make tar mingw-w64-x86_64-meson mingw-w64-x86_64-gcc mi
``` ```
- Compile and install SLICOT - Compile and install SLICOT
```sh ```sh
wget https://deb.debian.org/debian/pool/main/s/slicot/slicot_5.0+20101122.orig.tar.gz wget https://github.com/SLICOT/SLICOT-Reference/archive/refs/tags/v5.9.tar.gz
tar xf slicot_5.0+20101122.orig.tar.gz tar xf v5.9.tar.gz
cd slicot-5.0+20101122 cd SLICOT-Reference-5.9
make FORTRAN=gfortran OPTS="-O2 -fno-underscoring -fdefault-integer-8" LOADER=gfortran lib make -f makefile_Unix FORTRAN=gfortran OPTS="-O2 -fno-underscoring -fdefault-integer-8" LOADER=gfortran lib
mkdir -p /usr/local/lib mkdir -p /usr/local/lib
cp slicot.a /usr/local/lib/libslicot64_pic.a cp slicot.a /usr/local/lib/libslicot64_pic.a
cd .. cd ..
...@@ -321,7 +362,7 @@ cd dynare ...@@ -321,7 +362,7 @@ cd dynare
``` ```
- Configure Dynare from the source directory: - Configure Dynare from the source directory:
```sh ```sh
meson setup -Dmatlab_path=<…> -Dbuildtype=debugoptimized -Dprefer_static=true -Dfortran_args="['-B','/usr/local/lib']" build-matlab meson setup -Dmatlab_path=<…> --buildtype=debugoptimized --prefer-static -Dfortran_args="['-B','C:/msys64/usr/local/lib']" build-matlab
``` ```
where the path of MATLAB is specified. Note that you should use where the path of MATLAB is specified. Note that you should use
the MSYS2 notation and not put spaces in the MATLAB path, so you probably want the MSYS2 notation and not put spaces in the MATLAB path, so you probably want
...@@ -405,26 +446,29 @@ export PATH="$BREWDIR/bin:$PATH" ...@@ -405,26 +446,29 @@ export PATH="$BREWDIR/bin:$PATH"
``` ```
- Install required Homebrew packages and link sphinx-doc: - Install required Homebrew packages:
```sh ```sh
arch -$ARCH $BREWDIR/bin/brew install meson bison flex boost gcc gsl libmatio veclibfort octave sphinx-doc docutils wget arch -$ARCH $BREWDIR/bin/brew install meson bison flex boost gcc gsl libmatio veclibfort octave sphinx-doc docutils wget pkg-config git-lfs
``` ```
If you want to build the documentation, you need to link sphinx-doc: If you are installing `git-lfs` for the first time, you need to run `git lfs install` once after installing it.
- Link the sphinx-doc package to be able to compile the documentation:
```sh ```sh
arch -$ARCH $BREWDIR/bin/brew link --force sphinx-doc arch -$ARCH $BREWDIR/bin/brew link --force sphinx-doc
``` ```
- Install [MacTeX](http://www.tug.org/mactex/index.html) using the universal installer, if you want to build the documentation. MacTeX runs natively on both ARM and Intel machines. On Apple Silicon, it is advised to symlink `pdflatex` and `bibtex` into `/usr/local/bin`: - Install [MacTeX](http://www.tug.org/mactex/index.html) using the universal installer, if you want to build the documentation. MacTeX runs natively on both ARM and Intel machines. On Apple Silicon, it is advised to symlink `pdflatex`, `bibtex` and `latexmk` into `/usr/local/bin`:
```sh ```sh
sudo ln -s /Library/TeX/texbin/pdflatex /usr/local/bin/pdflatex sudo ln -s /Library/TeX/texbin/pdflatex /usr/local/bin/pdflatex
sudo ln -s /Library/TeX/texbin/bibtex /usr/local/bin/bibtex sudo ln -s /Library/TeX/texbin/bibtex /usr/local/bin/bibtex
sudo ln -s /Library/TeX/texbin/latexmk /usr/local/bin/latexmk
``` ```
If you don't have admin privileges, then you can also symlink them into `$HOME/.local/bin` and add this folder to your PATH.
- Install MATLAB and additional toolboxes. - Install MATLAB and additional toolboxes.
We recommend, but don't require, the following: Optimization, Global Optimization, Statistics and Machine Learning, Econometrics, and Control System. We recommend, but don't require, the following: Optimization, Global Optimization, Statistics and Machine Learning, Econometrics, and Control System.
For Apple Silicon: MATLAB offers a native Apple silicon version of R2022b as an open beta. You can sign up and install it (including a suitable Java 8 JRE, e.g. Amazon Corretto 8) using For Apple Silicon: MATLAB offers a native Apple silicon version (arm64) as of version R2023b, see [the official instructions](https://de.mathworks.com/support/requirements/apple-silicon.html) how to install it.
[the official instructions](https://de.mathworks.com/support/apple-silicon-r2022b-beta.html). You can also run the Intel version (x86_64) under Rosetta 2.
Unfortunately, this version does not support yet the Optimization, Global Optimization and Econometrics toolboxes.
If you need these, please run the Intel version (under Rosetta 2) instead.
Don't forget to run MATLAB at least once to make sure you have a valid license. Don't forget to run MATLAB at least once to make sure you have a valid license.
- Create a folder for Dynare and its dependencies - Create a folder for Dynare and its dependencies
...@@ -436,30 +480,29 @@ export DYNAREDIR=$HOME/dynare ...@@ -436,30 +480,29 @@ export DYNAREDIR=$HOME/dynare
```sh ```sh
mkdir -p $DYNAREDIR/slicot/lib mkdir -p $DYNAREDIR/slicot/lib
cd $DYNAREDIR/slicot cd $DYNAREDIR/slicot
curl -O https://deb.debian.org/debian/pool/main/s/slicot/slicot_5.0+20101122.orig.tar.gz curl -O https://github.com/SLICOT/SLICOT-Reference/archive/refs/tags/v5.9.tar.gz
tar xf slicot_5.0+20101122.orig.tar.gz tar xf v5.9.tar.gz
cd slicot-5.0+20101122 cd SLICOT-Reference-5.9
make -j$(sysctl -n hw.ncpu) FORTRAN=$BREWDIR/bin/gfortran OPTS="-O2" LOADER=gfortran lib make -f makefile_Unix -j$(sysctl -n hw.ncpu) FORTRAN=$BREWDIR/bin/gfortran OPTS="-O2" LOADER=gfortran lib
cp slicot.a $DYNAREDIR/slicot/lib/libslicot_pic.a cp slicot.a $DYNAREDIR/slicot/lib/libslicot_pic.a
make clean make clean
make -j$(sysctl -n hw.ncpu) FORTRAN=$BREWDIR/bin/gfortran OPTS="-O2 -fdefault-integer-8" LOADER=gfortran lib make -f makefile_Unix -j$(sysctl -n hw.ncpu) FORTRAN=$BREWDIR/bin/gfortran OPTS="-O2 -fdefault-integer-8" LOADER=gfortran lib
cp slicot.a $DYNAREDIR/slicot/lib/libslicot64_pic.a cp slicot.a $DYNAREDIR/slicot/lib/libslicot64_pic.a
cd $HOME/dynare
``` ```
- Compile and install the X-13ARIMA-SEATS Seasonal Adjustment Program - Compile and install the X-13ARIMA-SEATS Seasonal Adjustment Program
```sh ```sh
mkdir -p $DYNAREDIR/x13as mkdir -p $DYNAREDIR/x13as
cd $DYNAREDIR/x13as cd $DYNAREDIR/x13as
curl -O https://www2.census.gov/software/x-13arima-seats/x13as/unix-linux/program-archives/x13as_asciisrc-v1-1-b60.tar.gz curl -O https://www2.census.gov/software/x-13arima-seats/x13as/unix-linux/program-archives/x13as_asciisrc-v1-1-b61.tar.gz
tar xf x13as_asciisrc-v1-1-b60.tar.gz tar xf x13as_asciisrc-v1-1-b61.tar.gz
sed -i '' 's/-static//g' makefile.gf sed -i '' 's/-static//g' makefile.gf
make -j$(sysctl -n hw.ncpu) -f makefile.gf FC=$BREWDIR/bin/gfortran LINKER=$BREWDIR/bin/gcc-13 FFLAGS="-O2 -std=legacy" LDFLAGS=-static-libgcc LIBS="$BREWDIR/lib/gcc/current/libgfortran.a /$BREWDIR/lib/gcc/current/libquadmath.a" PROGRAM=x13as make -j$(sysctl -n hw.ncpu) -f makefile.gf FC=$BREWDIR/bin/gfortran LINKER=$BREWDIR/bin/gcc-14 FFLAGS="-O2 -std=legacy" LDFLAGS=-static-libgcc LIBS="$BREWDIR/lib/gcc/current/libgfortran.a /$BREWDIR/lib/gcc/current/libquadmath.a" PROGRAM=x13as
mkdir -p $HOME/.local/bin sudo cp $DYNAREDIR/x13as/x13as /usr/local/bin/x13as
cp x13as $HOME/.local/bin/x13as cd $DYNAREDIR
cd ;
x13as x13as
``` ```
Alternatively, if you don't have admin privileges you can install it into `$HOME/.local/bin` and add this folder to your PATH.
### Compile Dynare from source ### Compile Dynare from source
The following commands will download the Dynare source code and compile The following commands will download the Dynare source code and compile
...@@ -468,44 +511,48 @@ folder where you want Dynare installed. ...@@ -468,44 +511,48 @@ folder where you want Dynare installed.
- Prepare the Dynare sources for the unstable version: - Prepare the Dynare sources for the unstable version:
```sh ```sh
mkdir -p $DYNAREDIR/unstable
git clone --recurse-submodules https://git.dynare.org/Dynare/dynare.git $DYNAREDIR/unstable git clone --recurse-submodules https://git.dynare.org/Dynare/dynare.git $DYNAREDIR/unstable
cd $DYNAREDIR/unstable cd $DYNAREDIR/unstable
``` ```
You can also choose a specific version of Dynare by checking out the corresponding branch or a specific tag with git. If you want a certain version (e.g. 5.x) , then add `--single-branch --branch 5.x` to the git clone command.
- Configure Dynare from the source directory: - Configure Dynare from the source directory:
```sh ```sh
arch -$ARCH meson setup --native-file scripts/homebrew-native.ini -Dmatlab_path=/Applications/MATLAB_R2022b_Beta.app -Dbuildtype=debugoptimized -Dfortran_args="['-B','$DYNAREDIR/slicot/lib']" build-matlab export BUILDDIR=build-matlab
export MATLABPATH=/Applications/MATLAB_R2023b.app
arch -$ARCH meson setup --native-file macOS/homebrew-native-$ARCH.ini -Dmatlab_path=$MATLABPATH --buildtype=debugoptimized -Dfortran_args="['-B','$DYNAREDIR/slicot/lib']" $BUILDDIR
``` ```
where you need to adapt the path to MATLAB. where you need to adapt the path to MATLAB.
Similarly, if you don't want to compile for Octave, replace the `-Dmatlab_path` option by `-Dbuild_for=octave`, and change the build directory to `build-octave`. Similarly, if you want to compile for Octave, replace the `-Dmatlab_path` option by `-Dbuild_for=octave`, and change the build directory to `build-octave`.
- Compile: - Compile:
```sh ```sh
arch -$ARCH meson compile -C <builddir> arch -$ARCH meson compile -C $BUILDDIR
``` ```
where `<builddir>` is either `build-matlab` or `build-octave`.
If no errors occured, you are done. Dynare is now ready to use. If no errors occured, you are done. Dynare is now ready to use.
If you additionally want to compile the documentation run:
- If you additionally want to compile the documentation run:
```sh
arch -$ARCH meson compile -C $BUILDDIR doc
```
- Optionally, run the testsuite:
```sh ```sh
arch -$ARCH meson compile -C <builddir> doc arch -$ARCH meson test -C $BUILDDIR --num-processes=$(sysctl -n hw.perflevel0.physicalcpu)
``` ```
where `--num-processes` specifies the number of parallel processes to use for the testsuite (here set to the number of performance cores on your mac).
### Optional: pass the full PATH to MATLAB to run system commands ### Optional: pass the full PATH to MATLAB to run system commands
If you start MATLAB from a terminal, you will get the PATH inherited from the shell. If you start MATLAB from a terminal, you will get the PATH inherited from the shell.
However, when you click on the application icon in macOS, you are not running at the terminal level: However, when you click on the application icon in macOS, you are not running at the terminal level:
the program is run by launcher, which does not go through a shell login session. the program is run by launcher, which does not go through a shell login session.
In other words, you get the system default PATH which includes `/usr/bin:/bin:/usr/sbin:/sbin`, but not `/usr/local/bin` or `$HOME/.local/bin`. In other words, you get the system default PATH which includes `/usr/bin:/bin:/usr/sbin:/sbin`, but not `/usr/local/bin` or `$HOME/.local/bin`.
So if you want to use system commands like `pdflatex` or `x13as` you should either call them by their full path (e.g `/Library/TeX/texbin/pdflatex`) So if you want to use system commands like `pdflatex`, `latexmk` or `x13as` you should either call them by their full path (e.g `/Library/TeX/texbin/pdflatex`)
or append the PATH in MATLAB by running `setenv('PATH', [getenv('PATH') ':/usr/local/bin:$HOME/.local/bin:/Library/TeX/texbin']);`. or append the PATH by running `setenv('PATH', [getenv('PATH') ':/usr/local/bin:$HOME/.local/bin:/Library/TeX/texbin']);` in your MATLAB command line once,
Alternatively, you can create a `startup.m` file or change the system default PATH in the `/etc/paths` file. e.g. by adding this to your mod file. Alternatively, you can create a `startup.m` file or change the system default PATH in the `/etc/paths` file.
Last tested on:
- macOS Ventura 13.3.1 (MacBook Air M1, MacBook Pro M2 MAX, M2 Virtual Machine using Parallels, Intel Virtual Machine using Quickemu)
## Docker ## Docker
We offer a variety of pre-configured Docker containers for Dynare, pre-configured with Octave and MATLAB including all recommended toolboxes. We offer a variety of pre-configured Docker containers for Dynare, pre-configured with Octave and MATLAB including all recommended toolboxes.
These are readily available for your convenience on [Docker Hub](https://hub.docker.com/r/dynare/dynare). These are readily available for your convenience on [Docker Hub](https://hub.docker.com/r/dynare/dynare).
The docker folder contains [information and instructions](docker/README.md) to interact, built and customize the containers. The `scripts/docker` folder contains [information and instructions](scripts/docker/README.md) to interact, built and customize the containers.
Subproject commit 5a58fafdca239e61be4d7b2270307b2445bb571a
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
\begin{document} \begin{document}
% ---------------------------------------------------------------- % ----------------------------------------------------------------
\title{Sensitivity Analysis Toolbox for DYNARE\thanks{Copyright \copyright~2012 Dynare \title{Sensitivity Analysis Toolbox for Dynare\thanks{Copyright \copyright~2012-2024 Dynare
Team. Permission is granted to copy, distribute and/or modify Team. Permission is granted to copy, distribute and/or modify
this document under the terms of the GNU Free Documentation this document under the terms of the GNU Free Documentation
License, Version 1.3 or any later version published by the Free License, Version 1.3 or any later version published by the Free
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
\author{Marco Ratto\\ \author{Marco Ratto\\
European Commission, Joint Research Centre \\ European Commission, Joint Research Centre \\
TP361, IPSC, \\21027 Ispra TP581\\21027 Ispra
(VA) Italy\\ (VA) Italy\\
\texttt{marco.ratto@jrc.ec.europa.eu} \texttt{Marco.Ratto@ec.europa.eu}
\thanks{The author gratefully thanks Christophe Planas, Kenneth Judd, Michel Juillard, \thanks{The author gratefully thanks Christophe Planas, Kenneth Judd, Michel Juillard,
Alessandro Rossi, Frank Schorfheide and the participants to the Alessandro Rossi, Frank Schorfheide and the participants to the
Courses on Global Sensitivity Analysis for Macroeconomic Courses on Global Sensitivity Analysis for Macroeconomic
...@@ -52,21 +52,21 @@ helpful suggestions.}} ...@@ -52,21 +52,21 @@ helpful suggestions.}}
%----------------------------------------------------------------------- %-----------------------------------------------------------------------
\begin{abstract} \begin{abstract}
\noindent The Sensitivity Analysis Toolbox for DYNARE is a set of \noindent The Sensitivity Analysis Toolbox for Dynare is a set of
MATLAB routines for the analysis of DSGE models with global MATLAB routines for the analysis of DSGE models with global
sensitivity analysis. The routines are thought to be used within sensitivity analysis. The routines are thought to be used within
the DYNARE v4 environment. the Dynare 6 environment.
\begin{description} \begin{description}
\item \textbf{Keywords}: Stability Mapping , Reduced form solution, DSGE models, \item \textbf{Keywords}: Stability Mapping , Reduced form solution, DSGE models,
Monte Carlo filtering, Global Sensitivity Analysis. Monte Carlo filtering, Global Sensitivity Analysis.
\end{description} \end{description}
\end{abstract} \end{abstract}
\newpage \newpage
% ---------------------------------------------------------------- % ----------------------------------------------------------------
\section{Introduction} \label{s:intro} \section{Introduction} \label{s:intro}
The Sensitivity Analysis Toolbox for DYNARE is a collection of The Sensitivity Analysis Toolbox for Dynare is a collection of
MATLAB routines implemented to answer the following questions: (i) MATLAB routines implemented to answer the following questions: (i)
Which is the domain of structural coefficients assuring the Which is the domain of structural coefficients assuring the
stability and determinacy of a DSGE model? (ii) Which parameters stability and determinacy of a DSGE model? (ii) Which parameters
...@@ -81,20 +81,18 @@ described in \cite{Ratto_CompEcon_2008}. ...@@ -81,20 +81,18 @@ described in \cite{Ratto_CompEcon_2008}.
\section{Use of the Toolbox} \section{Use of the Toolbox}
The DYNARE parser now recognizes sensitivity analysis commands. The Dynare parser now recognizes sensitivity analysis commands.
The syntax is based on a single command: The syntax is based on a single command:
\vspace{0.5cm} \vspace{0.5cm}
\verb"dynare_sensitivity(option1=<opt1_val>,option2=<opt2_val>,...)" \verb"sensitivity(option1=<opt1_val>,option2=<opt2_val>,...)"
\vspace{0.5cm} \noindent with a list of options described in the \vspace{0.5cm} \noindent with a list of options described in the
next section. next section.
With respect to the previous version of the toolbox, in order to In order to work properly, the sensitivity analysis Toolbox does not need
work properly, the sensitivity analysis Toolbox \emph{no longer} a Dynare estimation environment to be set up. Rather, \verb"sensitivity"
needs that the DYNARE estimation environment is set-up. is the only command to run to
Therefore, \verb"dynare_sensitivity" is the only command to run to
make a sensitivity analysis on a DSGE model\footnote{Of course, make a sensitivity analysis on a DSGE model\footnote{Of course,
when the user needs to perform the mapping of the fit with a when the user needs to perform the mapping of the fit with a
posterior sample, a Bayesian estimation has to be performed posterior sample, a Bayesian estimation has to be performed
...@@ -208,16 +206,17 @@ a multivariate normal MC sample, with covariance matrix based on ...@@ -208,16 +206,17 @@ a multivariate normal MC sample, with covariance matrix based on
the inverse Hessian at the optimum: this analysis is useful when the inverse Hessian at the optimum: this analysis is useful when
ML estimation is done (i.e. no Bayesian estimation); ML estimation is done (i.e. no Bayesian estimation);
\item when \verb"ppost=1" the Toolbox analyses \item when \verb"ppost=1" the Toolbox analyses
the RMSE's for the posterior sample obtained by DYNARE's the RMSE's for the posterior sample obtained by Dynare's
Metropolis procedure. Metropolis procedure.
\end{enumerate} \end{enumerate}
The use of cases 2. and 3. requires an estimation step beforehand! The use of cases 2. and 3. require an estimation step beforehand!
To facilitate the sensitivity analysis after estimation, the To facilitate the sensitivity analysis after estimation, the
\verb"dynare_sensitivity" command also allows to indicate some \verb"sensitivity" command also allows to indicate some
options of \verb"dynare_estimation". These are: options of \verb"estimation". These are:
\begin{itemize} \begin{itemize}
\item \verb"datafile" \item \verb"datafile"
\item \verb"diffuse_filter"
\item \verb"mode_file" \item \verb"mode_file"
\item \verb"first_obs" \item \verb"first_obs"
\item \verb"lik_init" \item \verb"lik_init"
...@@ -278,10 +277,10 @@ identifiable. ...@@ -278,10 +277,10 @@ identifiable.
\end{tabular} \end{tabular}
\vspace{1cm} \vspace{1cm}
\noindent For example, the following commands in the DYNARE model file \noindent For example, the following commands in the Dynare model file
\vspace{1cm} \vspace{1cm}
\noindent\verb"dynare_sensitivity(identification=1, morris=2);" \noindent\verb"sensitivity(identification=1, morris=2);"
\vspace{1cm} \vspace{1cm}
\noindent trigger the identification analysis using \cite{Iskrev2010,Iskrev2011}, jointly with the mapping of the acceptable region. \noindent trigger the identification analysis using \cite{Iskrev2010,Iskrev2011}, jointly with the mapping of the acceptable region.
...@@ -293,75 +292,75 @@ Sensitivity analysis results are saved on the hard-disk of the ...@@ -293,75 +292,75 @@ Sensitivity analysis results are saved on the hard-disk of the
computer. The Toolbox uses a dedicated folder called \verb"GSA", computer. The Toolbox uses a dedicated folder called \verb"GSA",
located in \\ located in \\
\\ \\
\verb"<DYNARE_file>\GSA", \\ \verb"<Dynare_file>\GSA", \\
\\ \\
where \verb"<DYNARE_file>.mod" is the name of the DYNARE model where \verb"<Dynare_file>.mod" is the name of the Dynare model
file. file.
\subsection{Binary data files} \subsection{Binary data files}
A set of binary data files is saved in the \verb"GSA" folder: A set of binary data files is saved in the \verb"GSA" folder:
\begin{description} \begin{description}
\item[]\verb"<DYNARE_file>_prior.mat": this file stores \item[]\verb"<Dynare_file>_prior.mat": this file stores
information about the analyses performed sampling from the prior information about the analyses performed sampling from the prior
ranges, i.e. \verb"pprior=1" and \verb"ppost=0"; ranges, i.e. \verb"pprior=1" and \verb"ppost=0";
\item[]\verb"<DYNARE_file>_mc.mat": this file stores \item[]\verb"<Dynare_file>_mc.mat": this file stores
information about the analyses performed sampling from information about the analyses performed sampling from
multivariate normal, i.e. \verb"pprior=0" and \verb"ppost=0"; multivariate normal, i.e. \verb"pprior=0" and \verb"ppost=0";
\item[]\verb"<DYNARE_file>_post.mat": this file stores information \item[]\verb"<Dynare_file>_post.mat": this file stores information
about analyses performed using the Metropolis posterior sample, about analyses performed using the Metropolis posterior sample,
i.e. \verb"ppost=1". i.e. \verb"ppost=1".
\end{description} \end{description}
\begin{description} \begin{description}
\item[]\verb"<DYNARE_file>_prior_*.mat": these files store \item[]\verb"<Dynare_file>_prior_*.mat": these files store
the filtered and smoothed variables for the prior MC sample, the filtered and smoothed variables for the prior MC sample,
generated when doing RMSE analysis (\verb"pprior=1" and generated when doing RMSE analysis (\verb"pprior=1" and
\verb"ppost=0"); \verb"ppost=0");
\item[]\verb"<DYNARE_file>_mc_*.mat": these files store \item[]\verb"<Dynare_file>_mc_*.mat": these files store
the filtered and smoothed variables for the multivariate normal MC the filtered and smoothed variables for the multivariate normal MC
sample, generated when doing RMSE analysis (\verb"pprior=0" and sample, generated when doing RMSE analysis (\verb"pprior=0" and
\verb"ppost=0"). \verb"ppost=0").
\end{description} \end{description}
\subsection{Stability analysis} \subsection{Stability analysis}
Figure files \verb"<DYNARE_file>_prior_*.fig" store results for Figure files \verb"<Dynare_file>_prior_*.fig" store results for
the stability mapping from prior MC samples: the stability mapping from prior MC samples:
\begin{description} \begin{description}
\item[]\verb"<DYNARE_file>_prior_stab_SA_*.fig": plots of the Smirnov \item[]\verb"<Dynare_file>_prior_stab_SA_*.fig": plots of the Smirnov
test analyses confronting the cdf of the sample fulfilling test analyses confronting the CDF of the sample fulfilling
Blanchard-Kahn conditions with the cdf of the rest of the sample; Blanchard-Kahn conditions with the CDF of the rest of the sample;
\item[]\verb"<DYNARE_file>_prior_stab_indet_SA_*.fig": plots of the Smirnov \item[]\verb"<Dynare_file>_prior_stab_indet_SA_*.fig": plots of the Smirnov
test analyses confronting the cdf of the sample producing test analyses confronting the CDF of the sample producing
indeterminacy with the cdf of the original prior sample; indeterminacy with the CDF of the original prior sample;
\item[]\verb"<DYNARE_file>_prior_stab_unst_SA_*.fig": plots of the Smirnov \item[]\verb"<Dynare_file>_prior_stab_unst_SA_*.fig": plots of the Smirnov
test analyses confronting the cdf of the sample producing unstable test analyses confronting the CDF of the sample producing unstable
(explosive roots) behaviour with the cdf of the original prior (explosive roots) behaviour with the CDF of the original prior
sample; sample;
\item[]\verb"<DYNARE_file>_prior_stable_corr_*.fig": plots of \item[]\verb"<Dynare_file>_prior_stable_corr_*.fig": plots of
bivariate projections of the sample fulfilling Blanchard-Kahn bivariate projections of the sample fulfilling Blanchard-Kahn
conditions; conditions;
\item[]\verb"<DYNARE_file>_prior_indeterm_corr_*.fig": plots of \item[]\verb"<Dynare_file>_prior_indeterm_corr_*.fig": plots of
bivariate projections of the sample producing indeterminacy; bivariate projections of the sample producing indeterminacy;
\item[]\verb"<DYNARE_file>_prior_unstable_corr_*.fig": plots of \item[]\verb"<Dynare_file>_prior_unstable_corr_*.fig": plots of
bivariate projections of the sample producing instability; bivariate projections of the sample producing instability;
\item[]\verb"<DYNARE_file>_prior_unacceptable_corr_*.fig": plots of \item[]\verb"<Dynare_file>_prior_unacceptable_corr_*.fig": plots of
bivariate projections of the sample producing unacceptable bivariate projections of the sample producing unacceptable
solutions, i.e. either instability or indeterminacy or the solutions, i.e. either instability or indeterminacy or the
solution could not be found (e.g. the steady state solution could solution could not be found (e.g. the steady state solution could
not be found by the solver). not be found by the solver).
\end{description} \end{description}
Similar conventions apply for \verb"<DYNARE_file>_mc_*.fig" files, Similar conventions apply for \verb"<Dynare_file>_mc_*.fig" files,
obtained when samples from multivariate normal are used. obtained when samples from multivariate normal are used.
\subsection{RMSE analysis} \subsection{RMSE analysis}
Figure files \verb"<DYNARE_file>_rmse_*.fig" store results for the Figure files \verb"<Dynare_file>_rmse_*.fig" store results for the
RMSE analysis. RMSE analysis.
\begin{description} \begin{description}
\item[]\verb"<DYNARE_file>_rmse_prior*.fig": save results for \item[]\verb"<Dynare_file>_rmse_prior*.fig": save results for
the analysis using prior MC samples; the analysis using prior MC samples;
\item[]\verb"<DYNARE_file>_rmse_mc*.fig": save results for \item[]\verb"<Dynare_file>_rmse_mc*.fig": save results for
the analysis using multivariate normal MC samples; the analysis using multivariate normal MC samples;
\item[]\verb"<DYNARE_file>_rmse_post*.fig": save results for \item[]\verb"<Dynare_file>_rmse_post*.fig": save results for
the analysis using Metropolis posterior samples. the analysis using Metropolis posterior samples.
\end{description} \end{description}
...@@ -369,33 +368,33 @@ The following types of figures are saved (we show prior sample to ...@@ -369,33 +368,33 @@ The following types of figures are saved (we show prior sample to
fix ideas, but the same conventions are used for multivariate fix ideas, but the same conventions are used for multivariate
normal and posterior): normal and posterior):
\begin{description} \begin{description}
\item[]\verb"<DYNARE_file>_rmse_prior_*.fig": for each parameter, plots the cdf's \item[]\verb"<Dynare_file>_rmse_prior_*.fig": for each parameter, plots the CDF's
corresponding to the best 10\% RMES's of each observed series; corresponding to the best 10\% RMES's of each observed series;
\item[]\verb"<DYNARE_file>_rmse_prior_dens_*.fig": for each parameter, plots the pdf's \item[]\verb"<Dynare_file>_rmse_prior_dens_*.fig": for each parameter, plots the pdf's
corresponding to the best 10\% RMES's of each observed series; corresponding to the best 10\% RMES's of each observed series;
\item[]\verb"<DYNARE_file>_rmse_prior_<name of observedseries>_corr_*.fig": for each observed series plots the \item[]\verb"<Dynare_file>_rmse_prior_<name of observedseries>_corr_*.fig": for each observed series plots the
bi-dimensional projections of samples with the best 10\% RMSE's, bi-dimensional projections of samples with the best 10\% RMSE's,
when the correlation is significant; when the correlation is significant;
\item[]\verb"<DYNARE_file>_rmse_prior_lnlik*.fig": for each observed \item[]\verb"<Dynare_file>_rmse_prior_lnlik*.fig": for each observed
series, plots \emph{in red} the cdf of the log-likelihood series, plots \emph{in red} the CDF of the log-likelihood
corresponding to the best 10\% RMSE's, \emph{in green} the cdf of corresponding to the best 10\% RMSE's, \emph{in green} the CDF of
the rest of the sample and \emph{in blue }the cdf of the full the rest of the sample and \emph{in blue }the CDF of the full
sample; this allows to see the presence of some idiosyncratic sample; this allows to see the presence of some idiosyncratic
behaviour; behaviour;
\item[]\verb"<DYNARE_file>_rmse_prior_lnpost*.fig": for each observed \item[]\verb"<Dynare_file>_rmse_prior_lnpost*.fig": for each observed
series, plots \emph{in red} the cdf of the log-posterior series, plots \emph{in red} the CDF of the log-posterior
corresponding to the best 10\% RMSE's, \emph{in green} the cdf of corresponding to the best 10\% RMSE's, \emph{in green} the CDF of
the rest of the sample and \emph{in blue }the cdf of the full the rest of the sample and \emph{in blue }the CDF of the full
sample; this allows to see idiosyncratic behaviour; sample; this allows to see idiosyncratic behaviour;
\item[]\verb"<DYNARE_file>_rmse_prior_lnprior*.fig": for each observed \item[]\verb"<Dynare_file>_rmse_prior_lnprior*.fig": for each observed
series, plots \emph{in red} the cdf of the log-prior corresponding series, plots \emph{in red} the CDF of the log-prior corresponding
to the best 10\% RMSE's, \emph{in green} the cdf of the rest of to the best 10\% RMSE's, \emph{in green} the CDF of the rest of
the sample and \emph{in blue }the cdf of the full sample; this the sample and \emph{in blue }the CDF of the full sample; this
allows to see idiosyncratic behaviour; allows to see idiosyncratic behaviour;
\item[]\verb"<DYNARE_file>_rmse_prior_lik_SA_*.fig": when \item[]\verb"<Dynare_file>_rmse_prior_lik_SA_*.fig": when
\verb"lik_only=1", this shows the Smirnov tests for the filtering \verb"lik_only=1", this shows the Smirnov tests for the filtering
of the best 10\% log-likelihood values; of the best 10\% log-likelihood values;
\item[]\verb"<DYNARE_file>_rmse_prior_post_SA_*.fig": when \item[]\verb"<Dynare_file>_rmse_prior_post_SA_*.fig": when
\verb"lik_only=1", this shows the Smirnov test for the filtering \verb"lik_only=1", this shows the Smirnov test for the filtering
of the best 10\% log-posterior values. of the best 10\% log-posterior values.
\end{description} \end{description}
...@@ -405,19 +404,19 @@ In the case of the mapping of the reduced form solution, synthetic ...@@ -405,19 +404,19 @@ In the case of the mapping of the reduced form solution, synthetic
figures are saved in the \verb"\GSA" folder: figures are saved in the \verb"\GSA" folder:
\begin{description} \begin{description}
\item[]\verb"<DYNARE_file>_redform_<endo name>_vs_lags_*.fig": \item[]\verb"<Dynare_file>_redform_<endo name>_vs_lags_*.fig":
shows bar charts of the sensitivity indices for the \emph{ten most shows bar charts of the sensitivity indices for the \emph{ten most
important} parameters driving the reduced form coefficients of the important} parameters driving the reduced form coefficients of the
selected endogenous variables (\verb"namendo") versus lagged selected endogenous variables (\verb"namendo") versus lagged
endogenous variables (\verb"namlagendo"); suffix \verb"log" endogenous variables (\verb"namlagendo"); suffix \verb"log"
indicates the results for log-transformed entries; indicates the results for log-transformed entries;
\item[]\verb"<DYNARE_file>_redform_<endo name>_vs_shocks_*.fig": \item[]\verb"<Dynare_file>_redform_<endo name>_vs_shocks_*.fig":
shows bar charts of the sensitivity indices for the \emph{ten most shows bar charts of the sensitivity indices for the \emph{ten most
important} parameters driving the reduced form coefficients of the important} parameters driving the reduced form coefficients of the
selected endogenous variables (\verb"namendo") versus exogenous selected endogenous variables (\verb"namendo") versus exogenous
variables (\verb"namexo"); suffix \verb"log" indicates the results variables (\verb"namexo"); suffix \verb"log" indicates the results
for log-transformed entries; for log-transformed entries;
\item[]\verb"<DYNARE_file>_redform_GSA(_log).fig": shows bar chart of \item[]\verb"<Dynare_file>_redform_GSA(_log).fig": shows bar chart of
all sensitivity indices for each parameter: this allows to notice all sensitivity indices for each parameter: this allows to notice
parameters that have a minor effect for \emph{any} of the reduced parameters that have a minor effect for \emph{any} of the reduced
form coefficients, form coefficients,
...@@ -449,24 +448,24 @@ without the need of any user's intervention. ...@@ -449,24 +448,24 @@ without the need of any user's intervention.
\subsection{Screening analysis} \subsection{Screening analysis}
The results of the screening analysis with Morris sampling design The results of the screening analysis with Morris sampling design
are stored in the subfolder \verb"\GSA\SCREEN". The data file are stored in the subfolder \verb"\GSA\SCREEN". The data file
\verb"<DYNARE_file>_prior" stores all the information of the \verb"<Dynare_file>_prior" stores all the information of the
analysis (Morris sample, reduced form coefficients, etc.). analysis (Morris sample, reduced form coefficients, etc.).
Screening analysis merely concerns reduced form coefficients. Screening analysis merely concerns reduced form coefficients.
Similar synthetic bar charts as for the reduced form analysis with Similar synthetic bar charts as for the reduced form analysis with
MC samples are saved: MC samples are saved:
\begin{description} \begin{description}
\item[]\verb"<DYNARE_file>_redform_<endo name>_vs_lags_*.fig": \item[]\verb"<Dynare_file>_redform_<endo name>_vs_lags_*.fig":
shows bar charts of the elementary effect tests for the \emph{ten shows bar charts of the elementary effect tests for the \emph{ten
most important} parameters driving the reduced form coefficients most important} parameters driving the reduced form coefficients
of the selected endogenous variables (\verb"namendo") versus of the selected endogenous variables (\verb"namendo") versus
lagged endogenous variables (\verb"namlagendo"); lagged endogenous variables (\verb"namlagendo");
\item[]\verb"<DYNARE_file>_redform_<endo name>_vs_shocks_*.fig": \item[]\verb"<Dynare_file>_redform_<endo name>_vs_shocks_*.fig":
shows bar charts of the elementary effect tests for the \emph{ten shows bar charts of the elementary effect tests for the \emph{ten
most important} parameters driving the reduced form coefficients most important} parameters driving the reduced form coefficients
of the selected endogenous variables (\verb"namendo") versus of the selected endogenous variables (\verb"namendo") versus
exogenous variables (\verb"namexo"); exogenous variables (\verb"namexo");
\item[]\verb"<DYNARE_file>_redform_screen.fig": shows bar chart of \item[]\verb"<Dynare_file>_redform_screen.fig": shows bar chart of
all elementary effect tests for each parameter: this allows to all elementary effect tests for each parameter: this allows to
identify parameters that have a minor effect for \emph{any} of the identify parameters that have a minor effect for \emph{any} of the
reduced form coefficients. reduced form coefficients.
......
...@@ -2,7 +2,6 @@ function build_internal_documentation() ...@@ -2,7 +2,6 @@ function build_internal_documentation()
% The name of the function should be explicit... % The name of the function should be explicit...
datafiles = []; datafiles = [];
datafiles = [ datafiles ; {'../../matlab/utilities/dataset'}, {'initialize_dataset'}];
datafiles = [ datafiles ; {'../../matlab/utilities/dataset'}, {'descriptive_statistics'}]; datafiles = [ datafiles ; {'../../matlab/utilities/dataset'}, {'descriptive_statistics'}];
datafiles = [ datafiles ; {'../../matlab/utilities/dataset'}, {'compute_stdv'}]; datafiles = [ datafiles ; {'../../matlab/utilities/dataset'}, {'compute_stdv'}];
datafiles = [ datafiles ; {'../../matlab/utilities/dataset'}, {'compute_cova'}]; datafiles = [ datafiles ; {'../../matlab/utilities/dataset'}, {'compute_cova'}];
...@@ -81,4 +80,4 @@ if rows(miscfiles) ...@@ -81,4 +80,4 @@ if rows(miscfiles)
fprintf(fid,'\n\n\n'); fprintf(fid,'\n\n\n');
end end
end end
fclose(fid); fclose(fid);
\ No newline at end of file
/usr/share/javascript/mathjax/
\ No newline at end of file
...@@ -6,6 +6,7 @@ Bibliography ...@@ -6,6 +6,7 @@ Bibliography
* Abramowitz, Milton and Irene A. Stegun (1964): “Handbook of Mathematical Functions”, Courier Dover Publications. * Abramowitz, Milton and Irene A. Stegun (1964): “Handbook of Mathematical Functions”, Courier Dover Publications.
* Adjemian, Stéphane, Matthieu Darracq Parriès and Stéphane Moyen (2008): “Towards a monetary policy evaluation framework”, *European Central Bank Working Paper*, 942. * Adjemian, Stéphane, Matthieu Darracq Parriès and Stéphane Moyen (2008): “Towards a monetary policy evaluation framework”, *European Central Bank Working Paper*, 942.
* Adjemian, Stéphane and Michel Juillard (2025): “Stochastic Extended Path”, *Dynare Working Papers*, 84, CEPREMAP.
* Aguiar, Mark and Gopinath, Gita (2004): “Emerging Market Business Cycles: The Cycle is the Trend,” *NBER* Working Paper, 10734. * Aguiar, Mark and Gopinath, Gita (2004): “Emerging Market Business Cycles: The Cycle is the Trend,” *NBER* Working Paper, 10734.
* Amisano, Gianni and Tristani, Oreste (2010): “Euro area inflation persistence in an estimated nonlinear DSGE model”, *Journal of Economic Dynamics and Control*, 34(10), 1837–1858. * Amisano, Gianni and Tristani, Oreste (2010): “Euro area inflation persistence in an estimated nonlinear DSGE model”, *Journal of Economic Dynamics and Control*, 34(10), 1837–1858.
* Andreasen, Martin M., Jesús Fernández-Villaverde, and Juan Rubio-Ramírez (2018): “The Pruned State-Space System for Non-Linear DSGE Models: Theory and Empirical Applications,” *Review of Economic Studies*, 85(1), 1-49. * Andreasen, Martin M., Jesús Fernández-Villaverde, and Juan Rubio-Ramírez (2018): “The Pruned State-Space System for Non-Linear DSGE Models: Theory and Empirical Applications,” *Review of Economic Studies*, 85(1), 1-49.
...@@ -13,20 +14,24 @@ Bibliography ...@@ -13,20 +14,24 @@ Bibliography
* Andrews, Donald W.K (1991): “Heteroskedasticity and autocorrelation consistent covariance matrix estimation”, *Econometrica*, 59(3), 817–858. * Andrews, Donald W.K (1991): “Heteroskedasticity and autocorrelation consistent covariance matrix estimation”, *Econometrica*, 59(3), 817–858.
* Backus, David K., Patrick J. Kehoe, and Finn E. Kydland (1992): “International Real Business Cycles,” *Journal of Political Economy*, 100(4), 745–775. * Backus, David K., Patrick J. Kehoe, and Finn E. Kydland (1992): “International Real Business Cycles,” *Journal of Political Economy*, 100(4), 745–775.
* Baxter, Marianne and Robert G. King (1999): “Measuring Business Cycles: Approximate Band-pass Filters for Economic Time Series,” *Review of Economics and Statistics*, 81(4), 575–593. * Baxter, Marianne and Robert G. King (1999): “Measuring Business Cycles: Approximate Band-pass Filters for Economic Time Series,” *Review of Economics and Statistics*, 81(4), 575–593.
* Bini, Dario A., Guy Latouche, and Beatrice Meini (2002): “Solving matrix polynomial equations arising in queueing problems,” *Linear Algebra and its Applications*, 340, 225–244.
* Boehl, Gregor (2022): “DIME MCMC: A Swiss Army Knife for Bayesian Inference”, *SSRN No. 4250395*
* Born, Benjamin and Johannes Pfeifer (2014): “Policy risk and the business cycle”, *Journal of Monetary Economics*, 68, 68-85. * Born, Benjamin and Johannes Pfeifer (2014): “Policy risk and the business cycle”, *Journal of Monetary Economics*, 68, 68-85.
* Boucekkine, Raouf (1995): “An alternative methodology for solving nonlinear forward-looking models,” *Journal of Economic Dynamics and Control*, 19, 711–734. * Boucekkine, Raouf (1995): “An alternative methodology for solving nonlinear forward-looking models,” *Journal of Economic Dynamics and Control*, 19, 711–734.
* Brayton, Flint and Peter Tinsley (1996): "A Guide to FRB/US: A Macroeconomic Model of the United States", *Finance and Economics Discussion Series*, 1996-42. * Brayton, Flint and Peter Tinsley (1996): A Guide to FRB/US: A Macroeconomic Model of the United States, *Finance and Economics Discussion Series*, 1996-42.
* Brayton, Flint, Morris Davis and Peter Tulip (2000): "Polynomial Adjustment Costs in FRB/US", *Unpublished manuscript*. * Brayton, Flint, Morris Davis and Peter Tulip (2000): Polynomial Adjustment Costs in FRB/US, *Unpublished manuscript*.
* Brooks, Stephen P., and Andrew Gelman (1998): “General methods for monitoring convergence of iterative simulations,” *Journal of Computational and Graphical Statistics*, 7, pp. 434–455. * Brooks, Stephen P., and Andrew Gelman (1998): “General methods for monitoring convergence of iterative simulations,” *Journal of Computational and Graphical Statistics*, 7, pp. 434–455.
* Cardoso, Margarida F., R. L. Salcedo and S. Feyo de Azevedo (1996): “The simplex simulated annealing approach to continuous non-linear optimization,” *Computers & Chemical Engineering*, 20(9), 1065-1080. * Cardoso, Margarida F., R. L. Salcedo and S. Feyo de Azevedo (1996): “The simplex simulated annealing approach to continuous non-linear optimization,” *Computers & Chemical Engineering*, 20(9), 1065-1080.
* Chib, Siddhartha and Srikanth Ramamurthy (2010): “Tailored randomized block MCMC methods with application to DSGE models,” *Journal of Econometrics*, 155, 19–38. * Chib, Siddhartha and Srikanth Ramamurthy (2010): “Tailored randomized block MCMC methods with application to DSGE models,” *Journal of Econometrics*, 155, 19–38.
* Christiano, Lawrence J., Martin Eichenbaum and Charles L. Evans (2005): “Nominal Rigidities and the Dynamic Effects of a Shock to Monetary Policy,” *Journal of Political Economy*, 113(1), 1–45.
* Christiano, Lawrence J., Mathias Trabandt, and Karl Walentin (2010): “DSGE Models for Monetary Policy Analysis,” In: *Handbook of Monetary Economics 3*, 285–367.
* Christiano, Lawrence J., Mathias Trabandt and Karl Walentin (2011): “Introducing financial frictions and unemployment into a small open economy model,” *Journal of Economic Dynamics and Control*, 35(12), 1999–2041. * Christiano, Lawrence J., Mathias Trabandt and Karl Walentin (2011): “Introducing financial frictions and unemployment into a small open economy model,” *Journal of Economic Dynamics and Control*, 35(12), 1999–2041.
* Christoffel, Kai, Günter Coenen and Anders Warne (2010): “Forecasting with DSGE models,” *ECB Working Paper Series*, 1185. * Christoffel, Kai, Günter Coenen and Anders Warne (2010): “Forecasting with DSGE models,” *ECB Working Paper Series*, 1185.
* Collard, Fabrice (2001): “Stochastic simulations with Dynare: A practical guide”. * Collard, Fabrice (2001): “Stochastic simulations with Dynare: A practical guide”.
* Collard, Fabrice and Michel Juillard (2001a): “Accuracy of stochastic perturbation methods: The case of asset pricing models,” *Journal of Economic Dynamics and Control*, 25, 979–999. * Collard, Fabrice and Michel Juillard (2001a): “Accuracy of stochastic perturbation methods: The case of asset pricing models,” *Journal of Economic Dynamics and Control*, 25, 979–999.
* Collard, Fabrice and Michel Juillard (2001b): “A Higher-Order Taylor Expansion Approach to Simulation of Stochastic Forward-Looking Models with an Application to a Non-Linear Phillips Curve,” *Computational Economics*, 17, 125–139. * Collard, Fabrice and Michel Juillard (2001b): “A Higher-Order Taylor Expansion Approach to Simulation of Stochastic Forward-Looking Models with an Application to a Non-Linear Phillips Curve,” *Computational Economics*, 17, 125–139.
* Corana, Angelo, M. Marchesi, Claudio Martini, and Sandro Ridella (1987): “Minimizing multimodal functions of continuous variables with the “simulated annealing” algorithm”, *ACM Transactions on Mathematical Software*, 13(3), 262–280. * Corana, Angelo, M. Marchesi, Claudio Martini, and Sandro Ridella (1987): “Minimizing multimodal functions of continuous variables with the “simulated annealing” algorithm”, *ACM Transactions on Mathematical Software*, 13(3), 262–280.
* Cuba-Borda, Pablo, Luca Guerrieri, Matteo Iacoviello, and Molin Zhong (2019): "Likelihood evaluation of models with occasionally binding constraints", Journal of Applied Econometrics, 34(7), 1073-1085 * Cuba-Borda, Pablo, Luca Guerrieri, Matteo Iacoviello, and Molin Zhong (2019): Likelihood evaluation of models with occasionally binding constraints, Journal of Applied Econometrics, 34(7), 1073-1085
* Del Negro, Marco and Frank Schorfheide (2004): “Priors from General Equilibrium Models for VARs”, *International Economic Review*, 45(2), 643–673. * Del Negro, Marco and Frank Schorfheide (2004): “Priors from General Equilibrium Models for VARs”, *International Economic Review*, 45(2), 643–673.
* Dennis, Richard (2007): “Optimal Policy In Rational Expectations Models: New Solution Algorithms”, *Macroeconomic Dynamics*, 11(1), 31–55. * Dennis, Richard (2007): “Optimal Policy In Rational Expectations Models: New Solution Algorithms”, *Macroeconomic Dynamics*, 11(1), 31–55.
* Duffie, Darrel and Kenneth J. Singleton (1993): “Simulated Moments Estimation of Markov Models of Asset Prices”, *Econometrica*, 61(4), 929-952. * Duffie, Darrel and Kenneth J. Singleton (1993): “Simulated Moments Estimation of Markov Models of Asset Prices”, *Econometrica*, 61(4), 929-952.
...@@ -46,6 +51,7 @@ Bibliography ...@@ -46,6 +51,7 @@ Bibliography
* Hansen, Lars P. (1982): “Large sample properties of generalized method of moments estimators,” Econometrica, 50(4), 1029–1054. * Hansen, Lars P. (1982): “Large sample properties of generalized method of moments estimators,” Econometrica, 50(4), 1029–1054.
* Hansen, Nikolaus and Stefan Kern (2004): “Evaluating the CMA Evolution Strategy on Multimodal Test Functions”. In: *Eighth International Conference on Parallel Problem Solving from Nature PPSN VIII*, Proceedings, Berlin: Springer, 282–291. * Hansen, Nikolaus and Stefan Kern (2004): “Evaluating the CMA Evolution Strategy on Multimodal Test Functions”. In: *Eighth International Conference on Parallel Problem Solving from Nature PPSN VIII*, Proceedings, Berlin: Springer, 282–291.
* Harvey, Andrew C. and Garry D.A. Phillips (1979): “Maximum likelihood estimation of regression models with autoregressive-moving average disturbances,” *Biometrika*, 66(1), 49–58. * Harvey, Andrew C. and Garry D.A. Phillips (1979): “Maximum likelihood estimation of regression models with autoregressive-moving average disturbances,” *Biometrika*, 66(1), 49–58.
* Herbst, Edward and Schorfheide, Frank (2014): “Sequential Monte Carlo Sampling for DSGE Models,” *Journal of Applied Econometrics*, 29, 1073-1098.
* Herbst, Edward (2015): “Using the “Chandrasekhar Recursions” for Likelihood Evaluation of DSGE Models,” *Computational Economics*, 45(4), 693–705. * Herbst, Edward (2015): “Using the “Chandrasekhar Recursions” for Likelihood Evaluation of DSGE Models,” *Computational Economics*, 45(4), 693–705.
* Ireland, Peter (2004): “A Method for Taking Models to the Data,” *Journal of Economic Dynamics and Control*, 28, 1205–26. * Ireland, Peter (2004): “A Method for Taking Models to the Data,” *Journal of Economic Dynamics and Control*, 28, 1205–26.
* Iskrev, Nikolay (2010): “Local identification in DSGE models,” *Journal of Monetary Economics*, 57(2), 189–202. * Iskrev, Nikolay (2010): “Local identification in DSGE models,” *Journal of Monetary Economics*, 57(2), 189–202.
...@@ -60,7 +66,7 @@ Bibliography ...@@ -60,7 +66,7 @@ Bibliography
* Koopman, S. J. and J. Durbin (2003): “Filtering and Smoothing of State Vector for Diffuse State Space Models,” *Journal of Time Series Analysis*, 24(1), 85–98. * Koopman, S. J. and J. Durbin (2003): “Filtering and Smoothing of State Vector for Diffuse State Space Models,” *Journal of Time Series Analysis*, 24(1), 85–98.
* Kuntsevich, Alexei V. and Franz Kappel (1997): “SolvOpt - The solver for local nonlinear optimization problems (version 1.1, Matlab, C, FORTRAN)”, University of Graz, Graz, Austria. * Kuntsevich, Alexei V. and Franz Kappel (1997): “SolvOpt - The solver for local nonlinear optimization problems (version 1.1, Matlab, C, FORTRAN)”, University of Graz, Graz, Austria.
* Laffargue, Jean-Pierre (1990): “Résolution d’un modèle macroéconomique avec anticipations rationnelles”, *Annales d’Économie et Statistique*, 17, 97–119. * Laffargue, Jean-Pierre (1990): “Résolution d’un modèle macroéconomique avec anticipations rationnelles”, *Annales d’Économie et Statistique*, 17, 97–119.
* Liu, Jane and Mike West (2001): “Combined parameter and state estimation in simulation-based filtering”, in *Sequential Monte Carlo Methods in Practice*, Eds. Doucet, Freitas and Gordon, Springer Verlag. * Liu, Jane and Mike West (2001): “Combined parameter and state estimation in simulation-based filtering”, in *Sequential Monte Carlo Methods in Practice*, Eds. Doucet, Freitas and Gordon, Springer Verlag, Chapter 10, 197-223.
* Murray, Lawrence M., Emlyn M. Jones and John Parslow (2013): “On Disturbance State-Space Models and the Particle Marginal Metropolis-Hastings Sampler”, *SIAM/ASA Journal on Uncertainty Quantification*, 1, 494–521. * Murray, Lawrence M., Emlyn M. Jones and John Parslow (2013): “On Disturbance State-Space Models and the Particle Marginal Metropolis-Hastings Sampler”, *SIAM/ASA Journal on Uncertainty Quantification*, 1, 494–521.
* Mutschler, Willi (2015): “Identification of DSGE models - The effect of higher-order approximation and pruning“, *Journal of Economic Dynamics & Control*, 56, 34-54. * Mutschler, Willi (2015): “Identification of DSGE models - The effect of higher-order approximation and pruning“, *Journal of Economic Dynamics & Control*, 56, 34-54.
* Mutschler, Willi (2018): “Higher-order statistics for DSGE models”, *Econometrics and Statistics*, 6(C), 44-56. * Mutschler, Willi (2018): “Higher-order statistics for DSGE models”, *Econometrics and Statistics*, 6(C), 44-56.
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright © 2018-2022 Dynare Team # Copyright © 2018-2025 Dynare Team
# #
# This file is part of Dynare. # This file is part of Dynare.
# #
...@@ -31,12 +31,10 @@ templates_path = ['_templates'] ...@@ -31,12 +31,10 @@ templates_path = ['_templates']
html_static_path = ['_static'] html_static_path = ['_static']
mathjax_path = 'mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
master_doc = 'index' master_doc = 'index'
project = u'Dynare' project = u'Dynare'
copyright = u'1996–2022 Dynare Team' copyright = u'1996–2025 Dynare Team'
author = u'Dynare Team' author = u'Dynare Team'
add_function_parentheses = False add_function_parentheses = False
...@@ -73,12 +71,15 @@ latex_elements = { ...@@ -73,12 +71,15 @@ latex_elements = {
warningBorderColor={RGB}{255,50,50},OuterLinkColor={RGB}{34,139,34}, \ warningBorderColor={RGB}{255,50,50},OuterLinkColor={RGB}{34,139,34}, \
InnerLinkColor={RGB}{51,51,255},TitleColor={RGB}{51,51,255}', InnerLinkColor={RGB}{51,51,255},TitleColor={RGB}{51,51,255}',
'papersize': 'a4paper', 'papersize': 'a4paper',
'preamble': r'\DeclareUnicodeCharacter{200B}{}', # Part of the workaround for #1707 # Add support for the perpendicular symbol input as UTF-8
'preamble': r'''
\DeclareUnicodeCharacter{27C2}{\ensuremath{\perp}}
'''
} }
latex_documents = [ latex_documents = [
(master_doc, 'dynare-manual.tex', u'Dynare Reference Manual', (master_doc, 'dynare-manual.tex', u'Dynare Reference Manual',
u'Dynare team', 'manual'), u'Dynare Team', 'manual'),
] ]
man_pages = [ man_pages = [
......
...@@ -8,6 +8,20 @@ ...@@ -8,6 +8,20 @@
Dynare misc commands Dynare misc commands
#################### ####################
.. matcomm:: send_endogenous_variables_to_workspace ;
Puts the simulation results for the endogenous variables stored in ``oo_.endo_simul``
into vectors with the same name as the respective variables into the base workspace.
.. matcomm:: send_exogenous_variables_to_workspace ;
Puts the simulation results for the exogenous variables stored in ``oo_.exo_simul``
into vectors with the same name as the respective variables into the base workspace.
.. matcomm:: send_irfs_to_workspace ;
Puts the IRFs stored in ``oo_.irfs`` into vectors with the same name into the base workspace.
.. command:: prior_function(OPTIONS); .. command:: prior_function(OPTIONS);
Executes a user-defined function on parameter draws from the prior Executes a user-defined function on parameter draws from the prior
...@@ -155,7 +169,7 @@ Dynare misc commands ...@@ -155,7 +169,7 @@ Dynare misc commands
|br| |br|
.. matcomm:: prior [OPTIONS[, ...]]; .. matcomm:: prior [OPTIONS[ ...]];
Prints information about the prior distribution given the provided Prints information about the prior distribution given the provided
options. If no options are provided, the command returns the list of options. If no options are provided, the command returns the list of
...@@ -216,27 +230,137 @@ Dynare misc commands ...@@ -216,27 +230,137 @@ Dynare misc commands
Searches all occurrences of a variable in a model, and prints the Searches all occurrences of a variable in a model, and prints the
equations where the variable appear in the command line window. If OPTION is equations where the variable appear in the command line window. If OPTION is
set to `withparamvalues`, the values of the parameters (if available) are set to `withparamvalues`, the values of the parameters (if available) are
displayed instead of the name of the parameters. displayed instead of the name of the parameters. Requires the `json` command
line option to be set.
*Example* *Example*
Assuming that we already ran a `.mod` file and that the workspace has not Assuming that we already ran a `.mod` file and that the workspace has not
been cleaned after, we can search for all the equations containing variable `X` been cleaned after, we can search for all the equations containing variable `X`
::
>> search X
Y = alpha*X/(1-X)+e;
diff(X) = beta*(X(-1)-mX) + gamma1*Z + gamma2*R + u;
To replace the parameters with estimated or calibrated parameters:
::
>> search X withparamvalues
Y = 1.254634*X/(1-X)+e;
diff(X) = -0.031459*(X(-1)-mX) + 0.1*Z - 0.2*R + u;
|br|
.. matcomm:: dplot [OPTION VALUE[ ...]]
Plot expressions extracting data from different dseries objects.
*Options*
.. option:: --expression EXPRESSION
``EXPRESSION`` is a mathematical expression involving variables
available in the dseries objects, dseries methods, numbers or
parameters. All the referenced objects are supposed to be
available in the calling workspace.
.. option:: --dseries NAME
``NAME`` is the name of a dseries object from which the
variables involved in ``EXPRESSION`` will be extracted.
.. option:: --range DATE1:DATE2
This option is not mandatory and allows to plot the expressions
only over a sub-range. ``DATE1`` and ``DATE2`` must be dates as
defined in :ref:`dates in a mod file`.
.. option:: --style MATLAB_SCRIPT_NAME
Name of a Matlab script (without extension) containing Matlab
commands to customize the produced figure.
.. option:: --title MATLAB_STRING
Adds a title to the figure.
.. option:: --with-legend
Prints a legend below the produced plot.
*Remarks*
- More than one --expression argument is allowed, and they must come first.
- For each dseries object we plot all the expressions. We use two
nested loops, the outer loop is over the dseries objects and the
inner loop over the expressions. This determines the ordering of
the plotted lines.
- All dseries objects must be defined in the calling workspace, if a
dseries object is missing the routine throws a warning (we only
build the plots for the available dseries objects), if all dseries
objects are missing the routine throws an error.
- If the range is not provided, the expressions cannot involve leads or lags.
*Example*
::
>> toto = dseries(randn(100,3), dates('2000Q1'), {'x','y','z'});
>> noddy = dseries(randn(100,3), dates('2000Q1'), {'x','y','z'});
>> b = 3;
>> dplot --expression 2/b*cumsum(x/y(-1)-1) --dseries toto --dseries noddy --range 2001Q1:2024Q1 --title 'This is my plot'
will produce plots for ``2/b*cumsum(x/y(-1)-1)``, where ``x`` and
``y`` are variables in dseries objects ``toto`` and ``noddy``, in
the same figure.
.. command:: set_dynare_threads(NAME_OF_MEX_FILE,INTEGER);
A NAME_OF_MEX_FILE and INTEGER pair that can be used to set the number of
parallel threads employed during the execution of .mex files. To get the number
of logical cores `n` available, you can run ``n=numprocs``.
Available NAME_OF_MEX_FILE options are:
``'sparse_hessian_times_B_kronecker_C'``
.mex file used during computation of second-order solutions and in
`identification`. Default number of threads: number of logical cores.
:: ``'local_state_space_iteration_2'``
>> search X .mex file used during nonlinear filtering at `order=2` without
`k_order_solver` or with `pruning`. Default number of threads:
number of logical cores.
Y = alpha*X/(1-X)+e; ``'local_state_space_iteration_3'``
diff(X) = beta*(X(-1)-mX) + gamma1*Z + gamma2*R + u; .mex file used during nonlinear filtering at `order=3` without
`k_order_solver` or with `pruning`. Default number of threads:
number of logical cores.
To replace the parameters with estimated or calibrated parameters: ``'local_state_space_iteration_k'``
:: .mex file used during nonlinear filtering at `order>3` (without `pruning`)
or at `order=3` with `k_order_solver` and without `pruning`. Default number of threads: 1.
>> search X withparamvalues ``'perfect_foresight_problem'``
.mex file used during perfect foresight simulations. Default number of threads:
number of logical cores.
Y = 1.254634*X/(1-X)+e; ``'k_order_perturbation'``
diff(X) = -0.031459*(X(-1)-mX) + 0.1*Z - 0.2*R + u; .mex file used for perturbation solutions with `k_order_solver`. Default number of threads:
half the number of logical cores, but at least 1.
...@@ -79,3 +79,10 @@ description, please refer to the comments inside the files themselves. ...@@ -79,3 +79,10 @@ description, please refer to the comments inside the files themselves.
File demonstrating how to conduct optimal policy experiments in a File demonstrating how to conduct optimal policy experiments in a
simple New Keynesian model under commitment (Ramsey) with a user-defined simple New Keynesian model under commitment (Ramsey) with a user-defined
conditional steady state file conditional steady state file
``rbc_irf_matching.mod``
Baseline RBC model with government spending shocks estimated via impulse response function (IRF) matching.
Both Frequentist (Maximum Likelihood) and Bayesian (Slice Sampling) approaches are presented.
Additionally, it is shown how to estimate an AR(2)-process
by working with the roots of the autoregressive process instead of the coefficients
...@@ -11,7 +11,7 @@ Currently the development team of Dynare is composed of: ...@@ -11,7 +11,7 @@ Currently the development team of Dynare is composed of:
* Willi Mutschler (University of Tübingen) * Willi Mutschler (University of Tübingen)
* Johannes Pfeifer (University of the Bundeswehr Munich) * Johannes Pfeifer (University of the Bundeswehr Munich)
* Marco Ratto (European Commission, Joint Research Centre - JRC) * Marco Ratto (European Commission, Joint Research Centre - JRC)
* Normann Rion (CY Cergy Paris Université and CEPREMAP) * Normann Rion (CEPREMAP)
* Sébastien Villemot (CEPREMAP) * Sébastien Villemot (CEPREMAP)
The following people used to be members of the team: The following people used to be members of the team:
...@@ -26,7 +26,7 @@ The following people used to be members of the team: ...@@ -26,7 +26,7 @@ The following people used to be members of the team:
* Ferhat Mihoubi * Ferhat Mihoubi
* George Perendia * George Perendia
Copyright © 1996-2023, Dynare Team. Copyright © 1996-2025, Dynare Team.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
......
...@@ -8,14 +8,14 @@ Software requirements ...@@ -8,14 +8,14 @@ Software requirements
===================== =====================
Packaged versions of Dynare are available for Windows (10 and 11), several Packaged versions of Dynare are available for Windows (10 and 11), several
GNU/Linux distributions (Debian, Ubuntu, Linux Mint, Arch Linux), macOS (12 GNU/Linux distributions (Debian, Ubuntu, Linux Mint, Arch Linux), macOS (15
Monterey”), and FreeBSD. Dynare should work on other systems, but some Sequoia”), and FreeBSD. Dynare should work on other systems, but some
compilation steps are necessary in that case. compilation steps are necessary in that case.
In order to run Dynare, you need one of the following: In order to run Dynare, you need one of the following:
* MATLAB, any version ranging from 8.3 (R2014a) to 23.2 (R2023b); * MATLAB, any version ranging from 9.5 (R2018b) to 24.2 (R2024b);
* GNU Octave, any version ranging from 6.2.0 to 8.3.0, with the statistics package * GNU Octave, any version ranging from 7.1.0 to 9.4.0, with the ``statistics`` package
from `Octave-Forge`_. Note however that the Dynare installer for Windows from `Octave-Forge`_. Note however that the Dynare installer for Windows
requires a more specific version of Octave, as indicated on the download requires a more specific version of Octave, as indicated on the download
page. page.
...@@ -23,11 +23,20 @@ In order to run Dynare, you need one of the following: ...@@ -23,11 +23,20 @@ In order to run Dynare, you need one of the following:
The following optional extensions are also useful to benefit from The following optional extensions are also useful to benefit from
extra features, but are in no way required: extra features, but are in no way required:
* If under MATLAB: the Optimization Toolbox, the Statistics Toolbox, * If under MATLAB: the
the Control System Toolbox;
* If under Octave, the following `Octave-Forge`_ packages: ``optim, io, * Optimization Toolbox (providing various optimizers
control``. like ``fminsearch``, ``fmincon``, or ``fminunc``, used in e.g. ``mode_compute``,
``opt_algo`` or ``ALGO``),
* Statistics Toolbox (for faster and sometimes more robust implementations of
statistical distributions),
* Global Optimization Toolbox (for ``particleswarm`` and ``simulannealbnd``, used in
e.g. ``mode_compute``, ``opt_algo`` or ``ALGO``)
* Control System Toolbox (for the Lyapunov solver ``dlyapchol`` triggered with ``lyapunov=square_root_solver``)
* Parallel Computing Toolbox (to speed up the ``dime`` sampler)
* If under Octave, the following `Octave-Forge`_ packages: ``optim``, ``io``,
``control``.
Installation of Dynare Installation of Dynare
...@@ -91,33 +100,35 @@ Debian, Ubuntu and Linux Mint). ...@@ -91,33 +100,35 @@ Debian, Ubuntu and Linux Mint).
On macOS On macOS
-------- --------
.. warning::
Installing into ``/Applications/dynare`` might fail if you have older versions of Dynare already installed in ``/Applications/Dynare``.
To fix this, modify the ownership by executing the following command in Terminal.app::
sudo chown -R "$USER":staff /Applications/Dynare
Alternatively, you can modify the installation path in the automated installed using *Customize* and *Location*.
After installation, the folder will contain several sub-directories, among which are ``matlab``, ``mex``, and ``doc``.
Several versions of Dynare can coexist (by default in ``/Applications/Dynare``),
as long as you correctly adjust your path settings (see :ref:`words-warning`).
With MATLAB With MATLAB
^^^^^^^^^^^ ^^^^^^^^^^^
To install Dynare for use with MATLAB, execute the automated installer called To install Dynare for use with MATLAB, execute the automated installer called
``dynare-x.y.pkg`` (where *x.y* is the version number), and follow the ``dynare-x.y-arch.pkg`` (where *x.y* is the version number and *arch* is either arm64 for Apple Silicon or x86_64 for Intel architectures),
instructions. The default installation directory is and follow the instructions.
``/Applications/Dynare/x.y``. After installation, this directory will contain This installation does not require administrative privileges.
several sub-directories, among which are ``matlab``, ``mex``, and ``doc``. If for some reason admin rights are requested, use *Change Install Location* and select *Install for me only*.
The default installation directory is ``/Applications/Dynare/x.y-arch``.
Note that several versions of Dynare can coexist (by default in
``/Applications/Dynare``), as long as you correctly adjust your path It is recommended to install the Xcode Command Line Tools (this is an Apple product)
settings (see :ref:`words-warning`). and GCC via Homebrew_ (see :ref:`prerequisites-macos`).
By default, the installer installs a version of GCC (for use with :opt:`use_dll`) To deinstall Dynare, simply delete the folder where you installed the program. The package installer does
in the installation directory, under the ``.brew`` folder. To do so, it also not put any files anywhere else in the system.
installs a version of Homebrew_ in the same folder and
Xcode Command Line Tools (this is an Apple product) in a system folder.
All of this requires a bit of time and hard disk space. The amount of time it
takes will depend on your computing power and internet connection. To reduce
the time the Dynare installer takes, you can install Xcode Command Line Tools
yourself (see :ref:`prerequisites-macos`). Dynare, Homebrew, and GCC use
about 600 MB of disk space while the Xcode Command Line Tools require about 400
MB.
If you do not use the :opt:`use_dll` option, you have the choice to forgo the
installation of GCC and hence Dynare will only take about 50 MB of disk space.
With Octave With Octave
^^^^^^^^^^^ ^^^^^^^^^^^
...@@ -139,6 +150,8 @@ once):: ...@@ -139,6 +150,8 @@ once)::
octave:1> pkg install -forge io statistics control struct optim octave:1> pkg install -forge io statistics control struct optim
If you want to use the `x13` functionality of `dseries`, you also need to build the `x13as` binary. [#fx13]_
On FreeBSD On FreeBSD
---------- ----------
...@@ -192,8 +205,26 @@ Dynare now ships a compilation environment that can be used with the ...@@ -192,8 +205,26 @@ Dynare now ships a compilation environment that can be used with the
:opt:`use_dll` option. To install this environment correctly, the Dynare :opt:`use_dll` option. To install this environment correctly, the Dynare
installer ensures that the Xcode Command Line Tools (an Apple product) have installer ensures that the Xcode Command Line Tools (an Apple product) have
been installed on a system folder. To install the Xcode Command Line Tools been installed on a system folder. To install the Xcode Command Line Tools
yourself, simply type ``xcode-select --install`` into the Terminal yourself, simply type ``xcode-select --install`` into the terminal
(``/Applications/Utilities/Terminal.app``) prompt. (``/Applications/Utilities/Terminal.app``) prompt.
Additionally, to make MATLAB aware that you agree to the terms of Xcode, run the following two commands in the Terminal prompt::
CLT_VERSION=$(pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version | awk '{print $2}' | cut -d'.' -f1-2)
defaults write com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense "${CLT_VERSION}"
defaults read com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense
Otherwise you will see a warning that Xcode is installed, but its license has not been accepted.
You can check this e.g. by running the following command in the MATLAB command window::
mex -setup
Moreover, we recommend making use of optimized compilation flags when using :opt:`use_dll` and for this you need to install GCC via Homebrew_::
brew install gcc
If you already have installed GCC, Dynare will automatically prefer it for :opt:`use_dll`
if the binaries are either in ``/opt/homebrew/bin`` on Apple Silicon (arm64) or in ``/usr/local/bin`` on Intel (x86_64) systems.
Otherwise, it will fall back to Clang in ``/usr/bin/clang``, which works both on arm64 and x86_64 systems.
With Octave With Octave
^^^^^^^^^^^ ^^^^^^^^^^^
...@@ -313,3 +344,8 @@ Dynare unusable. ...@@ -313,3 +344,8 @@ Dynare unusable.
.. _Dynare wiki: https://git.dynare.org/Dynare/dynare/wikis .. _Dynare wiki: https://git.dynare.org/Dynare/dynare/wikis
.. _Octave-Forge: https://octave.sourceforge.io/ .. _Octave-Forge: https://octave.sourceforge.io/
.. _Homebrew: https://brew.sh .. _Homebrew: https://brew.sh
.. rubric:: Footnotes
.. [#fx13] See the instructions at `<https://forum.dynare.org/t/missing-installation-package/27350/4>`__.
\ No newline at end of file
...@@ -94,26 +94,24 @@ Citing Dynare in your research ...@@ -94,26 +94,24 @@ Citing Dynare in your research
You should cite Dynare if you use it in your research. The You should cite Dynare if you use it in your research. The
recommended way todo this is to cite the present manual, as: recommended way todo this is to cite the present manual, as:
Stéphane Adjemian, Houtan Bastani, Michel Juillard, Frédéric Karamé, Stéphane Adjemian, Michel Juillard, Frédéric Karamé, Willi Mutschler,
Ferhat Mihoubi, Willi Mutschler, Johannes Pfeifer, Marco Ratto, Johannes Pfeifer, Marco Ratto, Normann Rion and Sébastien Villemot (2024),
Normann Rion and Sébastien Villemot (2022), “Dynare: Reference Manual, “Dynare: Reference Manual, Version 6,” *Dynare Working Papers*, 80, CEPREMAP
Version 5,” *Dynare Working Papers*, 72, CEPREMAP
For convenience, you can copy and paste the following into your BibTeX file: For convenience, you can copy and paste the following into your BibTeX file:
.. code-block:: bibtex .. code-block:: bibtex
@TechReport{Adjemianetal2022, @TechReport{Adjemianetal2024,
author = {Adjemian, St\'ephane and Bastani, Houtan and author = {Adjemian, St\'ephane and Juillard, Michel and
Juillard, Michel and Karam\'e, Fr\'ederic and Karam\'e, Fr\'ederic and Mutschler, Willi and
Mihoubi, Ferhat and Mutschler, Willi Pfeifer, Johannes and Ratto, Marco and
and Pfeifer, Johannes and Ratto, Marco and
Rion, Normann and Villemot, S\'ebastien}, Rion, Normann and Villemot, S\'ebastien},
title = {Dynare: Reference Manual Version 5}, title = {Dynare: Reference Manual, Version 6},
year = {2022}, year = {2024},
institution = {CEPREMAP}, institution = {CEPREMAP},
type = {Dynare Working Papers}, type = {Dynare Working Papers},
number = {72}, number = {80},
} }
If you want to give a URL, use the address of the Dynare website: If you want to give a URL, use the address of the Dynare website:
......
...@@ -125,23 +125,20 @@ by the ``dynare`` command. ...@@ -125,23 +125,20 @@ by the ``dynare`` command.
.. option:: noclearall .. option:: noclearall
By default, ``dynare`` will issue a ``clear all`` command to By default, ``dynare`` deletes all the global variables and the
MATLAB (<R2015b) or Octave, thereby deleting all workspace functions using persistent variables, in order to benefit from the JIT
variables and functions; this option instructs ``dynare`` not (just-in-time) compilation. This option instructs ``dynare`` not to
to clear the workspace. Note that starting with MATLAB 2015b clear those.
``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.
.. option:: onlyclearglobals .. option:: onlyclearglobals
By default, ``dynare`` will issue a ``clear all`` command to By default, ``dynare`` deletes all the global variables and the
MATLAB versions before 2015b and to Octave, thereby deleting functions using persistent variables, in order to benefit from the JIT
all workspace variables; this option instructs ``dynare`` to (just-in-time) compilation. This option instructs ``dynare`` to clear
clear only the global variables (i.e. ``M_, options_, oo_, only its own global variables (*i.e.* ``M_, options_, oo_,
estim_params_, bayestopt_``, and ``dataset_``), leaving the estim_params_, bayestopt_``, ``dataset_``, ``dataset_info`` and
other variables in the workspace. ``estimation_info``), leaving the other variables in the workspace, and
not clearing functions using persistent variables.
.. option:: debug .. option:: debug
...@@ -160,7 +157,7 @@ by the ``dynare`` command. ...@@ -160,7 +157,7 @@ by the ``dynare`` command.
Instructs ``dynare`` to save the intermediary file which is obtained Instructs ``dynare`` to save the intermediary file which is obtained
after macro processing (see :ref:`macro-proc-lang`); the saved output after macro processing (see :ref:`macro-proc-lang`); the saved output
will go in the file specified, or if no file is specified in will go in the file specified, or if no file is specified in
``FILENAME-macroexp.mod``. See the :ref:`note on quotes<quote-note>` ``FILENAME_macroexp.mod``. See the :ref:`note on quotes<quote-note>`
for info on passing a ``FILENAME`` argument containing spaces. for info on passing a ``FILENAME`` argument containing spaces.
.. option:: onlymacro .. option:: onlymacro
...@@ -191,10 +188,13 @@ by the ``dynare`` command. ...@@ -191,10 +188,13 @@ by the ``dynare`` command.
Instructs Dynare to no create a logfile of this run in Instructs Dynare to no create a logfile of this run in
``FILENAME.log.`` The default is to create the logfile. ``FILENAME.log.`` The default is to create the logfile.
.. option:: output=second|third .. option:: output=first|second|third
Instructs the preprocessor to output derivatives of the dynamic model at Instructs the preprocessor to output derivatives of the dynamic model at
least up to the given order. least up to the given order. The `first` option is useful in
larger models when debugging steady state computation, because it allows
overriding the default computation and output of dynamic second order derivatives
in case of the mod-file not containing commands for further computations.
.. option:: language=matlab|julia .. option:: language=matlab|julia
...@@ -409,9 +409,11 @@ by the ``dynare`` command. ...@@ -409,9 +409,11 @@ by the ``dynare`` command.
.. option:: fast .. option:: fast
Only useful with model option :opt:`use_dll`. Don’t recompile the Don’t rewrite the output files otherwise written to the disk by the preprocessor
MEX files when running again the same model file and the lists when re-running the same model file while the lists of variables and the equations
of variables and the equations haven’t changed. We use a 32 haven’t changed. Note that the whole model still needs to be preprocessed. This option
is most useful with model option :opt:`use_dll`, because
the time-consuming compilation of the MEX files will be skipped. We use a 32
bit checksum, stored in ``<model filename>/checksum``. There bit checksum, stored in ``<model filename>/checksum``. There
is a very small probability that the preprocessor misses a is a very small probability that the preprocessor misses a
change in the model. In case of doubt, re-run without the fast change in the model. In case of doubt, re-run without the fast
...@@ -552,7 +554,7 @@ by the ``dynare`` command. ...@@ -552,7 +554,7 @@ by the ``dynare`` command.
executing the ``dynare`` command will leave variables containing executing the ``dynare`` command will leave variables containing
results in the workspace available for further processing. More results in the workspace available for further processing. More
details are given under the relevant computing tasks. The details are given under the relevant computing tasks. The
``M_``,``oo_``, and ``options_`` structures are saved in a file ``M_``, ``oo_``, and ``options_`` structures are saved in a file
called ``FILENAME_results.mat`` located in the ``MODFILENAME/Output`` folder. called ``FILENAME_results.mat`` located in the ``MODFILENAME/Output`` folder.
If they exist, ``estim_params_``, If they exist, ``estim_params_``,
``bayestopt_``, ``dataset_``, ``oo_recursive_`` and ``bayestopt_``, ``dataset_``, ``oo_recursive_`` and
......