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

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
Show changes
Commits on Source (252)
Showing
with 1440 additions and 351 deletions
...@@ -19,6 +19,7 @@ BreakInheritanceList: AfterColon ...@@ -19,6 +19,7 @@ BreakInheritanceList: AfterColon
Cpp11BracedListStyle: true Cpp11BracedListStyle: true
DeriveLineEnding: false DeriveLineEnding: false
IndentPPDirectives: AfterHash IndentPPDirectives: AfterHash
InsertNewlineAtEOF: true
PackConstructorInitializers: NextLine PackConstructorInitializers: NextLine
PPIndentWidth: 1 PPIndentWidth: 1
PointerAlignment: Left PointerAlignment: Left
......
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
TERM: linux TERM: linux
MATLAB_VERSION: R2023b MATLAB_VERSION: R2024b
OLD_MATLAB_VERSION: R2018b OLD_MATLAB_VERSION: R2018b
# To ensure that "false && true" fails, see https://gitlab.com/gitlab-org/gitlab-runner/-/issues/25394#note_412609647 # 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' FF_ENABLE_BASH_EXIT_CODE_CHECK: 'true'
...@@ -11,12 +11,10 @@ variables: ...@@ -11,12 +11,10 @@ variables:
# - 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
# + 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:
- 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ -n $CI_COMMIT_TAG ]]; then export VERSION=$CI_COMMIT_TAG; fi' - 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ -n $CI_COMMIT_TAG ]]; then export VERSION=$CI_COMMIT_TAG; fi'
- 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ $CI_COMMIT_REF_NAME == master ]]; then export VERSION=6-unstable-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
- 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]]; then export VERSION=$CI_COMMIT_REF_NAME-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi' - 'if [[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]]; then export VERSION=$CI_COMMIT_REF_NAME-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
- 'if [[ -z $VERSION ]]; then export VERSION=$CI_PROJECT_NAMESPACE-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi' - 'if [[ -z $VERSION ]]; then export VERSION=$CI_PROJECT_NAMESPACE-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA; fi'
...@@ -162,7 +160,6 @@ test_old_matlab: ...@@ -162,7 +160,6 @@ test_old_matlab:
paths: paths:
- build-old-matlab/meson-logs/testlog.txt - build-old-matlab/meson-logs/testlog.txt
when: always when: always
when: manual
test_octave: test_octave:
stage: test stage: test
...@@ -175,7 +172,6 @@ test_octave: ...@@ -175,7 +172,6 @@ test_octave:
- build-octave/meson-logs/testlog.txt - build-octave/meson-logs/testlog.txt
when: always when: always
needs: [ "build_octave" ] needs: [ "build_octave" ]
when: manual
test_clang_format: test_clang_format:
stage: test stage: test
...@@ -184,6 +180,17 @@ test_clang_format: ...@@ -184,6 +180,17 @@ test_clang_format:
- ninja -C build-clang-format clang-format-check - ninja -C build-clang-format clang-format-check
needs: [] 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.
...@@ -191,7 +198,7 @@ test_clang_format: ...@@ -191,7 +198,7 @@ test_clang_format:
sign_windows: sign_windows:
stage: sign stage: sign
rules: rules:
- if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_REF_NAME == "master"' - if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_TAG =~ /^6/'
when: on_success when: on_success
- when: never - when: never
tags: tags:
...@@ -205,10 +212,10 @@ sign_windows: ...@@ -205,10 +212,10 @@ sign_windows:
- windows/exe-signed/* - windows/exe-signed/*
expire_in: 3 days expire_in: 3 days
deploy_manual_unstable: deploy_manual_stable:
stage: deploy stage: deploy
rules: rules:
- if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_REF_NAME == "master"' - if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_TAG =~ /^6\.[0-9]+$/'
when: on_success when: on_success
- when: never - when: never
tags: tags:
...@@ -216,12 +223,13 @@ deploy_manual_unstable: ...@@ -216,12 +223,13 @@ deploy_manual_unstable:
dependencies: dependencies:
- build_doc - build_doc
script: script:
- 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/
- cp build-doc/dynare-manual.pdf /srv/www.dynare.org/manual.pdf
deploy_snapshot_unstable: deploy_release_stable:
stage: deploy stage: deploy
rules: rules:
- if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_REF_NAME == "master"' - if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_TAG =~ /^6\.[0-9]+$/'
when: on_success when: on_success
- when: never - when: never
tags: tags:
...@@ -233,11 +241,33 @@ deploy_snapshot_unstable: ...@@ -233,11 +241,33 @@ deploy_snapshot_unstable:
- pkg_macOS_arm64 - pkg_macOS_arm64
- pkg_macOS_x86_64 - 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/release/source/
- 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 - cp windows/exe-signed/* /srv/www.dynare.org/release/windows/
- 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 - cp windows/7z/* /srv/www.dynare.org/release/windows-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 - cp windows/zip/* /srv/www.dynare.org/release/windows-zip/
- 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 - cp macOS/pkg/*-arm64.pkg /srv/www.dynare.org/release/macos-arm64/
- 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 - cp macOS/pkg/*-x86_64.pkg /srv/www.dynare.org/release/macos-x86_64/
- ~/update-snapshot-list.sh - ~/update-release-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
deploy_beta_stable:
stage: deploy
rules:
- if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_TAG =~ /^6(\.[0-9]+)?-(beta|rc)[0-9]+$/'
when: on_success
- when: never
tags:
- deploy
dependencies:
- pkg_source
- pkg_windows
- sign_windows
- pkg_macOS_arm64
- pkg_macOS_x86_64
script:
- cp build-src/meson-dist/*.tar.xz /srv/www.dynare.org/beta/source/
- cp windows/exe-signed/* /srv/www.dynare.org/beta/windows/
- cp windows/7z/* /srv/www.dynare.org/beta/windows-7z/
- cp windows/zip/* /srv/www.dynare.org/beta/windows-zip/
- cp macOS/pkg/*-arm64.pkg /srv/www.dynare.org/beta/macos-arm64/
- cp macOS/pkg/*-x86_64.pkg /srv/www.dynare.org/beta/macos-x86_64/
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
[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/dseries path = matlab/dseries
url = ../../Dynare/dseries.git url = ../../Dynare/dseries.git
branch = master branch = master
......
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)
...@@ -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/R2023b -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,15 +244,15 @@ The documentation packages have slightly different names in CentOS and RHEL, but ...@@ -241,15 +244,15 @@ 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/
...@@ -262,14 +265,15 @@ make -f makefile.gf FFLAGS="-O2 -std=legacy" PROGRAM=x13as ...@@ -262,14 +265,15 @@ 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/R2023b -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
...@@ -439,13 +480,13 @@ export DYNAREDIR=$HOME/dynare ...@@ -439,13 +480,13 @@ 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
``` ```
...@@ -456,7 +497,7 @@ cd $DYNAREDIR/x13as ...@@ -456,7 +497,7 @@ 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-b60.tar.gz
tar xf x13as_asciisrc-v1-1-b60.tar.gz tar xf x13as_asciisrc-v1-1-b60.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
sudo cp $DYNAREDIR/x13as/x13as /usr/local/bin/x13as sudo cp $DYNAREDIR/x13as/x13as /usr/local/bin/x13as
cd $DYNAREDIR cd $DYNAREDIR
x13as x13as
...@@ -479,7 +520,7 @@ If you want a certain version (e.g. 5.x) , then add `--single-branch --branch 5. ...@@ -479,7 +520,7 @@ If you want a certain version (e.g. 5.x) , then add `--single-branch --branch 5.
```sh ```sh
export BUILDDIR=build-matlab export BUILDDIR=build-matlab
export MATLABPATH=/Applications/MATLAB_R2023b.app export MATLABPATH=/Applications/MATLAB_R2023b.app
arch -$ARCH meson setup --native-file macOS/homebrew-native-$ARCH.ini -Dmatlab_path=$MATLABPATH -Dbuildtype=debugoptimized -Dfortran_args="['-B','$DYNAREDIR/slicot/lib']" $BUILDDIR 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 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`.
......
...@@ -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.
......
...@@ -16,8 +16,8 @@ Bibliography ...@@ -16,8 +16,8 @@ Bibliography
* 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. * 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.
* 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.
...@@ -29,7 +29,7 @@ Bibliography ...@@ -29,7 +29,7 @@ Bibliography
* 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.
...@@ -49,7 +49,7 @@ Bibliography ...@@ -49,7 +49,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 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.
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright © 2018-2023 Dynare Team # Copyright © 2018-2025 Dynare Team
# #
# This file is part of Dynare. # This file is part of Dynare.
# #
...@@ -34,7 +34,7 @@ html_static_path = ['_static'] ...@@ -34,7 +34,7 @@ html_static_path = ['_static']
master_doc = 'index' master_doc = 'index'
project = u'Dynare' project = u'Dynare'
copyright = u'1996–2023 Dynare Team' copyright = u'1996–2025 Dynare Team'
author = u'Dynare Team' author = u'Dynare Team'
add_function_parentheses = False add_function_parentheses = False
...@@ -71,12 +71,11 @@ latex_elements = { ...@@ -71,12 +71,11 @@ 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
} }
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,17 +8,17 @@ ...@@ -8,17 +8,17 @@
Dynare misc commands Dynare misc commands
#################### ####################
.. matcomm:: send_endogenous_variables_to_workspace .. matcomm:: send_endogenous_variables_to_workspace ;
Puts the simulation results for the endogenous variables stored in ``oo_.endo_simul`` 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. into vectors with the same name as the respective variables into the base workspace.
.. matcomm:: send_exogenous_variables_to_workspace .. matcomm:: send_exogenous_variables_to_workspace ;
Puts the simulation results for the exogenous variables stored in ``oo_.exo_simul`` 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. into vectors with the same name as the respective variables into the base workspace.
.. matcomm:: send_irfs_to_workspace .. matcomm:: send_irfs_to_workspace ;
Puts the IRFs stored in ``oo_.irfs`` into vectors with the same name into the base workspace. Puts the IRFs stored in ``oo_.irfs`` into vectors with the same name into the base workspace.
...@@ -230,27 +230,97 @@ Dynare misc commands ...@@ -230,27 +230,97 @@ 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 >> search X
Y = alpha*X/(1-X)+e; Y = alpha*X/(1-X)+e;
diff(X) = beta*(X(-1)-mX) + gamma1*Z + gamma2*R + u; diff(X) = beta*(X(-1)-mX) + gamma1*Z + gamma2*R + u;
To replace the parameters with estimated or calibrated parameters: To replace the parameters with estimated or calibrated parameters:
:: ::
>> search X withparamvalues >> search X withparamvalues
Y = 1.254634*X/(1-X)+e; Y = 1.254634*X/(1-X)+e;
diff(X) = -0.031459*(X(-1)-mX) + 0.1*Z - 0.2*R + u; 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.
...@@ -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 (13 GNU/Linux distributions (Debian, Ubuntu, Linux Mint, Arch Linux), macOS (15
Ventura), 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 9.5 (R2018b) to 23.2 (R2023b); * MATLAB, any version ranging from 9.5 (R2018b) to 24.2 (R2024b);
* GNU Octave, any version ranging from 7.1.0 to 8.4.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,8 +23,16 @@ In order to run Dynare, you need one of the following: ...@@ -23,8 +23,16 @@ 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;
* Optimization Toolbox (providing various optimizers
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``)
* If under Octave, the following `Octave-Forge`_ packages: ``optim``, ``io``, * If under Octave, the following `Octave-Forge`_ packages: ``optim``, ``io``,
``control``. ``control``.
...@@ -91,6 +99,18 @@ Debian, Ubuntu and Linux Mint). ...@@ -91,6 +99,18 @@ 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
^^^^^^^^^^^ ^^^^^^^^^^^
...@@ -100,15 +120,6 @@ and follow the instructions. ...@@ -100,15 +120,6 @@ and follow the instructions.
This installation does not require administrative privileges. This installation does not require administrative privileges.
If for some reason admin rights are requested, use *Change Install Location* and select *Install for me only*. 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``. The default installation directory is ``/Applications/Dynare/x.y-arch``.
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`).
It is recommended to install the Xcode Command Line Tools (this is an Apple product) It is recommended to install the Xcode Command Line Tools (this is an Apple product)
and GCC via Homebrew_ (see :ref:`prerequisites-macos`). and GCC via Homebrew_ (see :ref:`prerequisites-macos`).
...@@ -133,6 +144,8 @@ once):: ...@@ -133,6 +144,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
---------- ----------
...@@ -325,3 +338,8 @@ Dynare unusable. ...@@ -325,3 +338,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
......
This diff is collapsed.
...@@ -22,6 +22,8 @@ Dates ...@@ -22,6 +22,8 @@ Dates
===== =====
.. highlight:: matlab .. highlight:: matlab
.. _dates in a mod file:
Dates in a mod file Dates in a mod file
------------------- -------------------
...@@ -29,10 +31,15 @@ Dynare understands dates in a mod file. Users can declare annual, bi-annual, ...@@ -29,10 +31,15 @@ Dynare understands dates in a mod file. Users can declare annual, bi-annual,
quarterly, or monthly dates using the following syntax:: quarterly, or monthly dates using the following syntax::
1990Y 1990Y
1990A
1990S2 1990S2
1990H2
1990Q4 1990Q4
1990M11 1990M11
Note that there are two syntaxes for annual dates (`1990A` is equivalent to
`1990Y`), and for bi-annual dates (`1990H2` is equivalent to `1990S2`).
Behind the scene, Dynare’s preprocessor translates these expressions Behind the scene, Dynare’s preprocessor translates these expressions
into instantiations of the MATLAB/Octave’s class ``dates`` described into instantiations of the MATLAB/Octave’s class ``dates`` described
below. Basic operations can be performed on dates: below. Basic operations can be performed on dates:
...@@ -52,7 +59,7 @@ below. Basic operations can be performed on dates: ...@@ -52,7 +59,7 @@ below. Basic operations can be performed on dates:
Has two functions: difference and subtraction. If the second Has two functions: difference and subtraction. If the second
argument is a date, calculates the difference between the first argument is a date, calculates the difference between the first
date and the secmond date (e.g. ``1951Q2-1950Q1`` is equal to date and the second date (e.g. ``1951Q2-1950Q1`` is equal to
``5``). If the second argument is an integer ``X``, subtracts ``5``). If the second argument is an integer ``X``, subtracts
``X`` periods from the date (e.g. ``1951Q2-2`` is equal to ``X`` periods from the date (e.g. ``1951Q2-2`` is equal to
``1950Q4``). ``1950Q4``).
...@@ -67,7 +74,7 @@ below. Basic operations can be performed on dates: ...@@ -67,7 +74,7 @@ below. Basic operations can be performed on dates:
Can be used to create a range of dates. For instance, ``r = Can be used to create a range of dates. For instance, ``r =
1950Q1:1951Q1`` creates a ``dates`` object with five elements: 1950Q1:1951Q1`` creates a ``dates`` object with five elements:
``1950Q1, 1950Q2, 1950Q3, 1950Q4`` and ``1951Q1``. By default the ``1950Q1``, ``1950Q2``, ``1950Q3``, ``1950Q4`` and ``1951Q1``. By default the
increment between each element is one period. This default can be increment between each element is one period. This default can be
changed using, for instance, the following instruction: changed using, for instance, the following instruction:
``1950Q1:2:1951Q1`` which will instantiate a ``dates`` object with ``1950Q1:2:1951Q1`` which will instantiate a ``dates`` object with
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright © 2018-2019 Dynare Team # Copyright © 2018-2024 Dynare Team
# #
# This file is part of Dynare. # This file is part of Dynare.
# #
...@@ -80,9 +80,7 @@ class DynObject(ObjectDescription): ...@@ -80,9 +80,7 @@ class DynObject(ObjectDescription):
signode += addnodes.desc_name(name, name) signode += addnodes.desc_name(name, name)
if self.has_arguments: if self.has_arguments:
if not arglist: if arglist:
signode += addnodes.desc_parameterlist()
else:
signode += addnodes.desc_addname(arglist,arglist) signode += addnodes.desc_addname(arglist,arglist)
return fullname, prefix return fullname, prefix
...@@ -99,7 +97,7 @@ class DynObject(ObjectDescription): ...@@ -99,7 +97,7 @@ class DynObject(ObjectDescription):
self.state_machine.reporter.warning( self.state_machine.reporter.warning(
'duplicate object description of %s, ' % fullname + 'duplicate object description of %s, ' % fullname +
'other instance in ' + 'other instance in ' +
self.env.doc2path(objects[fullname][0]),line=self.lineno) str(self.env.doc2path(objects[fullname][0])),line=self.lineno)
objects[fullname] = (self.env.docname, self.objtype) objects[fullname] = (self.env.docname, self.objtype)
indextext = self.get_index_text(fullname,name_obj) indextext = self.get_index_text(fullname,name_obj)
...@@ -244,7 +242,7 @@ class DynSimpleObject(ObjectDescription): ...@@ -244,7 +242,7 @@ class DynSimpleObject(ObjectDescription):
self.state_machine.reporter.warning( self.state_machine.reporter.warning(
'duplicate object description of %s, ' % fullname + 'duplicate object description of %s, ' % fullname +
'other instance in ' + 'other instance in ' +
self.env.doc2path(objects[fullname][0]), line=self.lineno) str(self.env.doc2path(objects[fullname][0])), line=self.lineno)
objects[fullname] = self.env.docname, self.objtype objects[fullname] = self.env.docname, self.objtype
indextext = self.get_index_text(fullname,name_obj) indextext = self.get_index_text(fullname,name_obj)
......
...@@ -60,7 +60,7 @@ class DynareLexer(RegexLexer): ...@@ -60,7 +60,7 @@ class DynareLexer(RegexLexer):
"addSeries","addParagraph","addVspace","write","compile") "addSeries","addParagraph","addVspace","write","compile")
operators = ( operators = (
"STEADY_STATE","EXPECTATION","var_expectation","pac_expectation") "STEADY_STATE","EXPECTATION","var_expectation","pac_expectation","pac_target_nonstationary")
macro_dirs = ( macro_dirs = (
"@#includepath", "@#include", "@#define", "@#if", "@#includepath", "@#include", "@#define", "@#if",
...@@ -83,7 +83,8 @@ class DynareLexer(RegexLexer): ...@@ -83,7 +83,8 @@ class DynareLexer(RegexLexer):
'osr_params_bounds','ramsey_constraints','irf_calibration', 'osr_params_bounds','ramsey_constraints','irf_calibration',
'moment_calibration','identification','svar_identification', 'moment_calibration','identification','svar_identification',
'matched_moments','occbin_constraints','surprise','overwrite','bind','relax', 'matched_moments','occbin_constraints','surprise','overwrite','bind','relax',
'verbatim','end','node','cluster','paths','hooks'), prefix=r'\b', suffix=r'\s*\b'),Keyword.Reserved), 'verbatim','end','node','cluster','paths','hooks','target','pac_target_info','auxname_target_nonstationary',
'component', 'growth', 'auxname', 'kind'), prefix=r'\b', suffix=r'\s*\b'),Keyword.Reserved),
# FIXME: Commands following multiline comments are not highlighted properly. # FIXME: Commands following multiline comments are not highlighted properly.
(words(commands + report_commands, (words(commands + report_commands,
......
...@@ -32,6 +32,10 @@ function [ys,params,check] = NK_baseline_steadystate(ys,exo,M_,options_) ...@@ -32,6 +32,10 @@ function [ys,params,check] = NK_baseline_steadystate(ys,exo,M_,options_)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>. % along with Dynare. If not, see <https://www.gnu.org/licenses/>.
% make parameter explicitly known to Matlab to avoid naming conflicts; actual value is read out
% in next eval-loop
delta=0;
% read out parameters to access them with their name % read out parameters to access them with their name
NumberOfParameters = M_.param_nbr; NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters for ii = 1:NumberOfParameters
......
// --+ options: json=compute, stochastic +--
var y x z v;
varexo ex ey ez ;
parameters a_y_1 a_y_2 b_y_1 b_y_2 b_x_1 b_x_2 d_y; // VAR parameters
parameters beta e_c_m c_z_1 c_z_2; // PAC equation parameters
a_y_1 = .2;
a_y_2 = .3;
b_y_1 = .1;
b_y_2 = .4;
b_x_1 = -.1;
b_x_2 = -.2;
d_y = .5;
beta = .9;
e_c_m = .1;
c_z_1 = .7;
c_z_2 = -.3;
var_model(model_name=toto, eqtags=['eq:x', 'eq:y']);
pac_model(auxiliary_model_name=toto, discount=beta, model_name=pacman);
pac_target_info(pacman);
target v;
auxname_target_nonstationary vns;
component y;
auxname pv_y_;
kind ll;
component x;
growth diff(x(-1));
auxname pv_dx_;
kind dd;
end;
model;
[name='eq:y']
y = a_y_1*y(-1) + a_y_2*diff(x(-1)) + b_y_1*y(-2) + b_y_2*diff(x(-2)) + ey ;
[name='eq:x']
diff(x) = b_x_1*y(-2) + b_x_2*diff(x(-1)) + ex ;
[name='eq:v']
v = x + d_y*y ; // Composite target, no residuals here only variables defined in the auxiliary VAR model.
[name='zpac']
diff(z) = e_c_m*(pac_target_nonstationary(pacman)-z(-1)) + c_z_1*diff(z(-1)) + c_z_2*diff(z(-2)) + pac_expectation(pacman) + ez;
end;
shocks;
var ex = .10;
var ey = .15;
var ez = .05;
end;
// Initialize the PAC model (build the Companion VAR representation for the auxiliary model).
pac.initialize('pacman');
// Update the parameters of the PAC expectation model (h0 and h1 vectors).
pac.update.expectation('pacman');
/*
**
** Simulate artificial dataset
**
*/
// Set initial conditions to zero.
initialconditions = dseries(zeros(10, M_.endo_nbr+M_.exo_nbr), 2000Q1, vertcat(M_.endo_names,M_.exo_names));
// Simulate the model for 5000 periods
TrueData = simul_backward_model(initialconditions, 5000);
/*
**
** Estimate PAC equation (using the artificial data)
**
*/
// Provide initial conditions for the estimated parameters
clear eparams
eparams.e_c_m = .9;
eparams.c_z_1 = .5;
eparams.c_z_2 = .2;
edata = TrueData; // Set the dataset used for estimation
edata.ez = dseries(NaN, 2000Q1); // Remove residuals for the PAC equation from the database.
pac.estimate.nls('zpac', eparams, edata, 2005Q1:2005Q1+4000, 'fmincon'); // Should produce a table with the estimates (close to the calibration given in lines 21-23)