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
26 results
Show changes
Commits on Source (377)
Showing
with 1880 additions and 516 deletions
......@@ -8,6 +8,12 @@
# 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
......@@ -19,9 +25,12 @@ 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
variables:
GIT_SUBMODULE_STRATEGY: recursive
TERM: linux
MATLAB_VERSION: R2024a
MATLAB_VERSION: R2024b
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'
......@@ -107,7 +107,7 @@ pkg_macOS_x86_64:
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/x86_64
- ln -s ~/tarballs macOS/deps/
- make -C macOS build-x86_64
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
......@@ -127,7 +127,7 @@ pkg_macOS_arm64:
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/arm64
- ln -s ~/tarballs macOS/deps/
- make -C macOS build-arm64
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
......@@ -145,8 +145,6 @@ pkg_macOS_arm64:
test_matlab:
stage: test
script:
# Workaround for R2024a, that prevents lockups apparently linked to the ServiceHost daemon
- rm -rf ~/.MathWorks && ln -s /dev/null ~/.MathWorks
- meson test -C build-matlab --no-rebuild --num-processes $(($(nproc) * 3 / 4))
artifacts:
paths:
......@@ -186,6 +184,17 @@ test_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
# don’t want those jobs to start before the “test” and “pkg” stages have
# succeeded. Hence we stick to the “dependencies” keyword.
......
Announcement for Dynare 6.3 (on 2025-02-19)
===========================================
We are pleased to announce the release of Dynare 6.3.
This maintenance release fixes various bugs.
The Windows, macOS, MATLAB online and source packages are available for
download at [the Dynare website](https://www.dynare.org/download/).
This release is compatible with MATLAB versions ranging from 9.5 (R2018b) to
24.2 (R2024b), and with GNU Octave versions ranging from 7.1.0 to 9.4.0 (NB:
the Windows package requires version 9.4.0 specifically).
Here is a list of the problems identified in version 6.2 and that have been
fixed in version 6.3:
* OccBin with option `smoother_inversion_filter` would crash the MCMC
estimation if the `filtered_variables` or `filter_step_ahead` options were
used
* OccBin with option `smoother_inversion_filter` would use the PKF if
`mh_replic>0`
* OccBin with option `smoothed_state_uncertainty` would crash Dynare if the
MCMC smoother was run after the classical one
* OccBin's smoother would crash when encountering an internal error due to the
output of the linear smoother not having been computed
* Calling `model_info` with `differentiate_forward_vars` would crash
* The `identification` command would compute the asymptotic Hessian via
simulation instead of via moments as intended
* The `identification` command would crash during prior sampling if the initial
draw did not solve the model
* The `gsa_sample_file` was broken
* Optimization algorithm `mode_compute=5` (`newrat`) would crash with
`analytic_derivation`
* The `discretionary_policy` command would crash if the model was purely
forward-looking
* The `dsample` command would crash
* The `conditional_forecast_paths` block did not accept vector inputs
* For MCMC chains with fewer than 6000 draws, the default number of `sub_draws`
used to compute posterior moments was incorrect
* Bi-annual dates (e.g. `2024S1` or `2024H1`) were not accepted within Dynare
statements
* Plotting `dseries` did not correctly show dates on the x-axis
Announcement for Dynare 6.2 (on 2024-09-25)
===========================================
We are pleased to announce the release of Dynare 6.2.
This maintenance release fixes various bugs.
The Windows, macOS, MATLAB online and source packages are available for
download at [the Dynare website](https://www.dynare.org/download/).
This release is compatible with MATLAB versions ranging from 9.5 (R2018b) to
24.2 (R2024b), and with GNU Octave versions ranging from 7.1.0 to 9.2.0 (NB:
the Windows package requires version 9.2.0 specifically).
Here is a list of the problems identified in version 6.1 and that have been
fixed in version 6.2:
* The mixed complementarity problem (MCP) solver could fail or give wrong
results in some cases where there were multiple complementarity conditions
* The `qmc_sequence` MEX file from the macOS package would fail to load
* OccBin forecasts would crash in case of shocks with zero variance
* OccBin smoother would crash if simulation did not converge
* Computation of posterior moments could crash in large models
* The auxiliary particle filter and the Liu & West online filter
(`mode_compute=11`) required the Statistics Toolbox
* The auxiliary particle filter and the Liu & West online filter
(`mode_compute=11`) would not work with the `discretionary_policy` command
* The `discretionary_policy` command would crash if there were fewer than two
exogenous variables
* Using the `forecast` command with a model solved at `order>1` without
`varexo_det` would return forecasts based on a first order approximation
instead of providing an error message
* Using the `forecast` command with a model solved at `order=2` with
`varexo_det` and `pruning` would return forecasts without `pruning` instead
of providing an error message
* Using the `forecast` command with a model solved at `order=3` would crash
* SMC methods could return wrong posterior results if the Parallel Toolbox was
installed
* The Herbst-Schorfheide SMC sampler would crash at `order>1`
* Annualized shock decomposition would not output results if desired vintage
date did not coincide to an end-of-the-year Q4 period
* Using `rand_multivariate_student` as the proposal density in the
`tailored_random_block_metropolis_hastings` posterior sampler would return
wrong results
* The `onlyclearglobals` of the `dynare` command was not working as intended
* The `det_cond_forecast` command would crash with plans including only
expected shocks
* Estimation could crash in some rare cases when computing the 2nd order
moments of prior or posterior distribution
* Successive calls of the Herbst-Schorfheide SMC sampler could crash due to
some stale files being left on disk
* The shock decomposition plot could be wrong in the presence of leads/lags on
exogenous variables, or when the steady state is squeezed
Announcement for Dynare 6.1 (on 2024-05-02)
===========================================
We are pleased to announce the release of Dynare 6.1.
This maintenance release fixes various bugs.
The Windows, macOS, MATLAB online and source packages are already available for
download at [the Dynare website](https://www.dynare.org/download/).
This release is compatible with MATLAB versions ranging from 9.5 (R2018b) to
24.1 (R2024a), and with GNU Octave versions ranging from 7.1.0 to 9.1.0 (NB:
the Windows package requires version 9.1.0 specifically).
Here is a list of the problems identified in version 6.0 and that have been
fixed in version 6.1:
* Identification: simulated moments were triggered instead of theoretical ones
* Variance decompositions would crash with measurement errors when zero
variance shocks were present
* The handling of Lagrange multipliers in the display of problems with the
Jacobian was wrong
* The option `auxname` was missing in the documentation of the `pac_model`
command
* PAC equation estimation/simulation was crashing in the case of composite
target
* The PAC equation estimation would crash if the PAC target was a transformed
variable
* The `perfect_foresight_with_expectation_errors_solver` command could return
incorrect results when used in conjunction with
`homotopy_linearization_fallback` or
`homotopy_marginal_linearization_fallback` options
* For scalar values, the description of the `horizon` option of the
`var_expectation_model` command was incorrect
* The steady state computation with the `bytecode` option in a Ramsey model
was broken
* OccBin: the piecewise Kalman filter would crash in case of a periodic
solution
* The `heteroskedastic_filter` option of the `estimation` command would cause a
crash if there was only one shock
* The `method_of_moments` command would crash during the J-test for just and
underidentified models
* User-defined `warning` settings were internally overwritten with the
`method_of_moments` command or the piecewise Kalman filter
* The SMC sampler would crash if any of the `bayesian_irf`, `moments_varendo`,
or `smoother` options of the `estimation` command had been specified
* The `bvar_irf` command would ignore the `SquareRoot` option and instead
employ a Cholesky decomposition
* The univariate Kalman filter erroneously treated observations with negative
prediction variances due to numerical issues as missing values instead of
discarding the parameter draw
Moreover, a new `homotopy_exclude_varexo` option to the
`perfect_foresight_solver` command has been added, to exclude some exogenous
variables from the homotopy procedure (*i.e.* to keep them at their value
corresponding to 100% of the shock during all homotopy iterations).
Announcement for Dynare 6.0 (on 2024-02-02)
===========================================
......
......@@ -54,6 +54,7 @@ a 32-bit Octave.
1. [**General Instructions**](#general-instructions)
1. [**Debian or Ubuntu**](#debian-or-ubuntu)
1. [**Fedora, CentOS or RHEL**](#fedora-centos-or-rhel)
1. [**Arch Linux**](#arch-linux)
1. [**Windows**](#windows)
1. [**macOS**](#macos)
1. [**Docker**](#docker)
......@@ -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):
```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`.
Or for Octave:
```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`.
......@@ -183,6 +184,7 @@ All the prerequisites are packaged:
- `texlive-fonts-extra` (for ccicons)
- `texlive-science` (for amstex)
- `lmodern` (for macroprocessor PDF)
- `cm-super` (for BVAR à la Sims and GSA PDFs)
- `python3-sphinx`
- `tex-gyre`
- `latexmk`
......@@ -191,7 +193,7 @@ All the prerequisites are packaged:
You can install them all at once with:
```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.
......@@ -242,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/
mkdir -p /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
tar xf slicot_5.0+20101122.orig.tar.gz
cd slicot-5.0+20101122
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
mkdir -p /home/$USER/dynare/slicot/lib
# 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
# 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
# compile x13as from source and put it into /usr/bin/
mkdir -p /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
tar xf 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-b61.tar.gz
sed -i "s|-static| |" makefile.gf # this removes '-static' in the makefile.gf
make -f makefile.gf FFLAGS="-O2 -std=legacy" PROGRAM=x13as
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):
```sh
cd /home/$USER/dynare
git clone --recurse-submodules https://git.dynare.org/dynare/dynare.git 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
```
......@@ -290,6 +293,43 @@ bison --version # bison (GNU Bison) 3.6.4
```
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
- Install [MSYS2](http://www.msys2.org)
......@@ -307,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
```sh
wget https://deb.debian.org/debian/pool/main/s/slicot/slicot_5.0+20101122.orig.tar.gz
tar xf slicot_5.0+20101122.orig.tar.gz
cd slicot-5.0+20101122
make FORTRAN=gfortran OPTS="-O2 -fno-underscoring -fdefault-integer-8" LOADER=gfortran lib
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 ..
......@@ -322,7 +362,7 @@ cd dynare
```
- Configure Dynare from the source directory:
```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
the MSYS2 notation and not put spaces in the MATLAB path, so you probably want
......@@ -440,13 +480,13 @@ export DYNAREDIR=$HOME/dynare
```sh
mkdir -p $DYNAREDIR/slicot/lib
cd $DYNAREDIR/slicot
curl -O https://deb.debian.org/debian/pool/main/s/slicot/slicot_5.0+20101122.orig.tar.gz
tar xf slicot_5.0+20101122.orig.tar.gz
cd slicot-5.0+20101122
make -j$(sysctl -n hw.ncpu) FORTRAN=$BREWDIR/bin/gfortran OPTS="-O2" LOADER=gfortran lib
curl -O 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 -j$(sysctl -n hw.ncpu) FORTRAN=$BREWDIR/bin/gfortran OPTS="-O2" LOADER=gfortran lib
cp slicot.a $DYNAREDIR/slicot/lib/libslicot_pic.a
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
```
......@@ -454,10 +494,10 @@ cp slicot.a $DYNAREDIR/slicot/lib/libslicot64_pic.a
```sh
mkdir -p $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
tar xf 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-b61.tar.gz
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
cd $DYNAREDIR
x13as
......@@ -480,7 +520,7 @@ If you want a certain version (e.g. 5.x) , then add `--single-branch --branch 5.
```sh
export BUILDDIR=build-matlab
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.
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`.
......
......@@ -14,6 +14,7 @@ Bibliography
* 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.
* 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.
* 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.
......@@ -64,7 +65,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.
* 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.
* 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.
* 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.
......
# -*- coding: utf-8 -*-
# Copyright © 2018-2024 Dynare Team
# Copyright © 2018-2025 Dynare Team
#
# This file is part of Dynare.
#
......@@ -34,7 +34,7 @@ html_static_path = ['_static']
master_doc = 'index'
project = u'Dynare'
copyright = u'1996–2024 Dynare Team'
copyright = u'1996–2025 Dynare Team'
author = u'Dynare Team'
add_function_parentheses = False
......
......@@ -79,3 +79,10 @@ description, please refer to the comments inside the files themselves.
File demonstrating how to conduct optimal policy experiments in a
simple New Keynesian model under commitment (Ramsey) with a user-defined
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
......@@ -26,7 +26,7 @@ The following people used to be members of the team:
* Ferhat Mihoubi
* George Perendia
Copyright © 1996-2024, 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.
......
......@@ -8,14 +8,14 @@ Software requirements
=====================
Packaged versions of Dynare are available for Windows (10 and 11), several
GNU/Linux distributions (Debian, Ubuntu, Linux Mint, Arch Linux), macOS (13
Ventura), and FreeBSD. Dynare should work on other systems, but some
GNU/Linux distributions (Debian, Ubuntu, Linux Mint, Arch Linux), macOS (15
“Sequoia”), and FreeBSD. Dynare should work on other systems, but some
compilation steps are necessary in that case.
In order to run Dynare, you need one of the following:
* MATLAB, any version ranging from 9.5 (R2018b) to 24.1 (R2024a);
* GNU Octave, any version ranging from 7.1.0 to 9.1.0, with the ``statistics`` package
* MATLAB, any version ranging from 9.5 (R2018b) to 24.2 (R2024b);
* 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
requires a more specific version of Octave, as indicated on the download
page.
......@@ -23,8 +23,17 @@ In order to run Dynare, you need one of the following:
The following optional extensions are also useful to benefit from
extra features, but are in no way required:
* If under MATLAB: the Optimization Toolbox, the Statistics Toolbox,
the Control System Toolbox;
* If under MATLAB: the
* 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``)
* Parallel Computing Toolbox (to speed up the ``dime`` sampler)
* If under Octave, the following `Octave-Forge`_ packages: ``optim``, ``io``,
``control``.
......@@ -91,6 +100,18 @@ Debian, Ubuntu and Linux Mint).
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
^^^^^^^^^^^
......@@ -100,15 +121,6 @@ and follow the instructions.
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*.
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)
and GCC via Homebrew_ (see :ref:`prerequisites-macos`).
......@@ -133,6 +145,8 @@ once)::
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
----------
......@@ -325,3 +339,8 @@ Dynare unusable.
.. _Dynare wiki: https://git.dynare.org/Dynare/dynare/wikis
.. _Octave-Forge: https://octave.sourceforge.io/
.. _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
......@@ -125,23 +125,20 @@ by the ``dynare`` command.
.. option:: noclearall
By default, ``dynare`` will issue a ``clear all`` command to
MATLAB (<R2015b) or Octave, thereby deleting all workspace
variables and functions; this option instructs ``dynare`` not
to clear the workspace. Note that starting with MATLAB 2015b
``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.
By default, ``dynare`` deletes all the global variables and the
functions using persistent variables, in order to benefit from the JIT
(just-in-time) compilation. This option instructs ``dynare`` not to
clear those.
.. option:: onlyclearglobals
By default, ``dynare`` will issue a ``clear all`` command to
MATLAB versions before 2015b and to Octave, thereby deleting
all workspace variables; this option instructs ``dynare`` to
clear only the global variables (i.e. ``M_, options_, oo_,
estim_params_, bayestopt_``, and ``dataset_``), leaving the
other variables in the workspace.
By default, ``dynare`` deletes all the global variables and the
functions using persistent variables, in order to benefit from the JIT
(just-in-time) compilation. This option instructs ``dynare`` to clear
only its own global variables (*i.e.* ``M_, options_, oo_,
estim_params_, bayestopt_``, ``dataset_``, ``dataset_info`` and
``estimation_info``), leaving the other variables in the workspace, and
not clearing functions using persistent variables.
.. option:: debug
......@@ -160,7 +157,7 @@ by the ``dynare`` command.
Instructs ``dynare`` to save the intermediary file which is obtained
after macro processing (see :ref:`macro-proc-lang`); the saved output
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.
.. option:: onlymacro
......
This diff is collapsed.
This diff is collapsed.
......@@ -97,7 +97,7 @@ class DynObject(ObjectDescription):
self.state_machine.reporter.warning(
'duplicate object description of %s, ' % fullname +
'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)
indextext = self.get_index_text(fullname,name_obj)
......@@ -242,7 +242,7 @@ class DynSimpleObject(ObjectDescription):
self.state_machine.reporter.warning(
'duplicate object description of %s, ' % fullname +
'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
indextext = self.get_index_text(fullname,name_obj)
......
......@@ -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
% 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
NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
......
/*
* This file presents a baseline RBC model with government spending shocks where the persistence of the
* government spending shock is estimated via impulse response function (IRF) matching.
*
* Notes:
* - The empirical IRFs were estimated using the Blanchard/Perotti (2002) approach, see
* https://github.com/JohannesPfeifer/DSGE_mod/blob/master/RBC_IRF_matching/get_empirical_IRFs.m
* - They are given in the csv file rbc_irf_matching_data.csv, the first two columns contain
* the empirical IRFs of G and Y, while the third and fourth column contain the corresponding
* variances of the IRFs from a bootstrap approach.
* Importantly: this mod file does not show how to get the empirical IRFs from a SVAR model,
* but takes these as "data".
* - Of course the RBC model is not capable of generating the consumption increase
* after a government spending shock. For that reason, this mod-file only targets the IRFs for G and Y.
* - The weighting matrix uses a diagonal matrix with the inverse of the pointwise IRF variances on the main diagonal.
* - The empirical IRFs and model IRFs use an impulse size of 1 percent. Thus, there is no uncertainty about the
* initial impact. The IRF matching therefore only targets the G-response starting in the second period.
* - Note that for the current model, the number of IRFs exceeds the number of VAR parameters. Therefore,
* the distribution of the estimator will be non-standard, see Guerron-Quintana/Inoue/Kilian (2016),
* http://dx.doi.org/10.1016/j.jeconom.2016.09.009
* - The mod-file also shows how to estimate an AR(2)-process by working with the roots of the autoregressive
* process instead of the coefficients. This allows for easily restricting the process to the stability region and
* would allow specifying e.g. a beta prior for both roots as was done in Born/Peter/Pfeifer (2013), Fiscal news
* and macroeconomic volatility, https://doi.org/10.1016/j.jedc.2013.06.011
*
* Please note that the following copyright notice only applies to this Dynare
* implementation of the model.
*/
/*
* Copyright (C) 2016-17 Johannes Pfeifer,
* Copyright (C) 2024 Dynare Team
*
* This file is part of Dynare.
*
* Dynare is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Dynare is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
*/
%----------------------------------------------------------------
% define variables
%----------------------------------------------------------------
@#define IRF_periods=80
var y ${y}$ (long_name='output')
c ${c}$ (long_name='consumption')
k ${k}$ (long_name='capital')
l ${l}$ (long_name='hours')
z ${z}$ (long_name='TFP')
ghat ${\hat g}$ (long_name='government spending')
r ${r}$ (long_name='annualized interest rate')
w ${w}$ (long_name='real wage')
invest ${i}$ (long_name='investment')
log_y ${\log(y)}$ (long_name='log output')
log_k ${\log(k)}$ (long_name='log capital stock')
log_c ${\log(c)}$ (long_name='log consumption')
log_l ${\log(l)}$ (long_name='log labor')
log_w ${\log(w)}$ (long_name='log real wage')
log_invest ${\log(i)}$ (long_name='log investment')
;
varexo eps_z ${\varepsilon_z}$ (long_name='TFP shock')
eps_g ${\varepsilon_g}$ (long_name='government spending shock')
;
%----------------------------------------------------------------
% define parameters
%----------------------------------------------------------------
parameters
beta ${\beta}$ (long_name='discount factor')
psi ${\psi}$ (long_name='labor disutility parameter')
sigma ${\sigma}$ (long_name='risk aversion')
delta ${\delta}$ (long_name='depreciation rate')
alpha ${\alpha}$ (long_name='capital share')
rhoz ${\rho_z}$ (long_name='persistence TFP shock')
root_g_1 ${\rho_g}$ (long_name='first root of AR(2) G process')
root_g_2 ${\rho_g}$ (long_name='second root of AR(2) G process')
gammax ${\gamma_x}$ (long_name='composite growth rate')
gshare ${\frac{G}{Y}}$ (long_name='government spending share')
n ${n}$ (long_name='population growth')
x ${x}$ (long_name='technology growth (per capita output growth)')
i_y ${\frac{I}{Y}}$ (long_name='investment-output ratio')
k_y ${\frac{K}{Y}}$ (long_name='capital-output ratio')
g_ss ${\bar G}$ (long_name='government spending in steady state')
l_ss ${\bar L}$ (long_name='labor in steady state')
;
%----------------------------------------------------------------
% model equations
%----------------------------------------------------------------
model;
# rho_g_1= (root_g_1+root_g_2);
# rho_g_2= - root_g_1*root_g_2;
[name='Euler equation']
c^(-sigma)=beta/gammax*c(+1)^(-sigma)*
(alpha*exp(z(+1))*(k/l(+1))^(alpha-1)+(1-delta));
[name='Labor FOC']
psi*c^sigma*1/(1-l)=w;
[name='Law of motion capital']
gammax*k=(1-delta)*k(-1)+invest;
[name='resource constraint']
y=invest+c+g_ss*exp(ghat);
[name='production function']
y=exp(z)*k(-1)^alpha*l^(1-alpha);
[name='real wage/firm FOC labor']
w=(1-alpha)*y/l;
[name='annualized real interst rate/firm FOC capital']
r=4*alpha*y/k(-1);
[name='exogenous TFP process']
z=rhoz*z(-1)+eps_z;
[name='government spending process']
ghat=rho_g_1*ghat(-1)+rho_g_2*ghat(-2)+eps_g;
[name='Definition log output']
log_y = log(y);
[name='Definition log capital']
log_k = log(k);
[name='Definition log consumption']
log_c = log(c);
[name='Definition log hours']
log_l = log(l);
[name='Definition log wage']
log_w = log(w);
[name='Definition log investment']
log_invest = log(invest);
end;
%----------------------------------------------------------------
% set steady state values
%---------------------------------------------------------------
steady_state_model;
gammax = (1+n)*(1+x);
delta = i_y/k_y-x-n-n*x;
beta = (1+x)*(1+n)/(alpha/k_y+(1-delta));
l = l_ss;
k = ((1/beta*(1+n)*(1+x)-(1-delta))/alpha)^(1/(alpha-1))*l;
invest = (x+n+delta+n*x)*k;
y = k^alpha*l^(1-alpha);
g = gshare*y;
g_ss = g;
c = (1-gshare)*k^(alpha)*l^(1-alpha)-invest;
psi = (1-alpha)*(k/l)^alpha*(1-l)/c^sigma;
w = (1-alpha)*y/l;
r = 4*alpha*y/k;
log_y = log(y);
log_k = log(k);
log_c = log(c);
log_l = log(l);
log_w = log(w);
log_invest = log(invest);
z = 0;
ghat =0;
end;
%----------------------------------------------------------------
% calibration
%----------------------------------------------------------------
sigma = 1;
alpha = 0.33;
i_y = 0.25;
k_y = 10.4;
x = 0.0055;
n = 0.0027;
rhoz = 0.97;
root_g_1 = 0.9602;
root_g_2 = 0;
gshare = 0.2038;
l_ss = 1/3;
shocks;
var eps_g = 1;
end;
steady;
check;
varobs ghat log_y y; // you need to specify observables
%----------------------------------------------------------------
% IRF matching example 1:
% - different ways to MANUALLY enter values and weights
% - Maximum likelihood estimation
%----------------------------------------------------------------
estimated_params;
root_g_1 , 0.90 , 0, 1;
root_g_2 , 0.10 , 0, 1;
end;
xx = [1.007,1.117,1.092];
ww = [51,52];
matched_irfs;
var log_y ; varexo eps_g ; periods 1, 2 ; values 0.20, 0.17 ; weights 360, 140 ;
var ghat ; varexo eps_g ; periods 2 3:5 ; values 1.01, (xx) ; weights 50, 20 ;
var y ; varexo eps_g ; periods 10:11 ; values (log(1.05)) ; weights (ww) ;
end;
method_of_moments(mom_method = irf_matching, mode_compute = 5, additional_optimizer_steps=[4]);
%----------------------------------------------------------------
% IRF matching example 2
% - use all IRFs given in MATLAB objects
% - use Bayesian Slice sampler
%----------------------------------------------------------------
estimated_params(overwrite);
root_g_1 , 0.50 , 0, 1, beta_pdf , 0.50 , 0.20;
root_g_2 , 0.10 , 0, 1, beta_pdf , 0.50 , 0.20;
end;
% get data
irfs_data = importdata('rbc_irf_matching_data.csv');
irfs_ghat_eps_g = irfs_data.data(2:80,1); % start in t=2 due to identification restrictions in SVAR
irfs_log_y_eps_g = irfs_data.data(1:80,2);
weights_ghat_eps_g = 1./irfs_data.data(2:80,3);
weights_log_y_eps_g = 1./irfs_data.data(1:80,4);
matched_irfs(overwrite);
var ghat ; varexo eps_g; periods 2:80; values (irfs_ghat_eps_g); weights (weights_ghat_eps_g);
var log_y; varexo eps_g; periods 1:80; values (irfs_log_y_eps_g); weights (weights_log_y_eps_g);
end;
method_of_moments(mom_method = irf_matching
,order = 1
,mh_nblocks = 2, mh_replic = 50
,posterior_sampling_method = 'slice'
,plot_priors = 1
);
%----------------------------------------------------------------
% IRF matching example 3:
% - use anonymous function to access IRFs more flexibly
% - showcase how to use irf_matching_file
% - find posterior mode
%----------------------------------------------------------------
% get data
irfs_data = importdata('rbc_irf_matching_data.csv');
% use anonymous function (or MATLAB function) to have more flexibility, but inputs can only be numerical
% we also take 100 just for illustration that you can do any required transformation in an irf_matching_file
irfs_vals = @(j) 100.*(irfs_data.data(2:80,j));
irfs_weights = @(j) 1./(irfs_data.data(2:80,j));
matched_irfs(overwrite);
var ghat ; varexo eps_g; periods 2:80; values (irfs_vals(1)); weights (irfs_weights(3));
var log_y; varexo eps_g; periods 2:80; values (irfs_vals(2)); weights (irfs_weights(4));
end;
% we use the irf_matching_file to transform variable y to log(y) so the model
% variable aligns with the variable from the given empirical SVAR
method_of_moments(mom_method = irf_matching
,irf_matching_file = rbc_irf_matching_transformations
,mh_replic = 0,plot_priors = 0
);
\ No newline at end of file
G,Y,var_G,var_Y
1,0.208070478344545,1.12054105855257e-33,0.0027602236508546
1.01463693816715,0.166450236530301,0.00583152879723266,0.00679133276154495
1.00764238152471,0.230433660500946,0.0111184998994349,0.00952654639548326
1.11696510115769,0.215252336067127,0.0164663222282161,0.0113464752654877
1.09223998892147,0.222958847463141,0.0216966728235886,0.013533420700953
1.03736643322521,0.243972174559692,0.0257004687001329,0.0151053406229588
1.01711112212948,0.261016995864984,0.0303544421773506,0.0162405771811019
0.967577038730636,0.269060130173636,0.0339076793971577,0.0171352445593892
0.912649802559854,0.278584624341349,0.03620212016322,0.0179592573395723
0.867058516612021,0.283001682449059,0.038151205713992,0.0187783728830758
0.820597806619289,0.283598412003388,0.0396511019185971,0.0194594651103199
0.77563492323912,0.281760898055785,0.0403347277351183,0.0198713886600475
0.735846344956036,0.277110769410598,0.0407036832985301,0.0198800923047385
0.698850036380633,0.269931336693529,0.0407917065478011,0.0194569744071588
0.664596916513962,0.261143278620547,0.0405012612908696,0.0186271529903141
0.633528960929983,0.251064751428521,0.0400022455114944,0.0174559567202935
0.604912703413876,0.240132445806634,0.0393594337883548,0.0160603819816583
0.578360605178466,0.228823340604282,0.0385445703756185,0.0145721875285327
0.55371549942988,0.217458827167635,0.0376075435183867,0.0130962012473614
0.530621264922238,0.206298301306342,0.0365729915386994,0.0117094186557471
0.508813730835084,0.195562831928213,0.0354403165776896,0.010461528435305
0.488125279535286,0.185390333897221,0.0342268285355491,0.00937102041748079
0.468386758403429,0.175863201796663,0.0329491563166573,0.00843340667968603
0.449471041462416,0.167022878990409,0.0316223984500399,0.00763260719022832
0.431296406103216,0.158870322365946,0.0302644814355948,0.00694575471751527
0.413799596231625,0.151377829877172,0.0288934660918837,0.00634988691182681
0.396937751823371,0.144499570770831,0.0275270293690654,0.00582564616104379
0.380685985677042,0.13817717429653,0.0261806418593218,0.00535836547483349
0.365028340579903,0.132346351995696,0.0248665732796567,0.00493799567463183
0.349954881191496,0.126942318129237,0.0235951459469029,0.0045584177486503
0.335459383987806,0.121903145354258,0.022373467574597,0.00421578980579863
0.321536118675061,0.117172332783573,0.021205727363848,0.00390754150917342
0.308178316488601,0.112700463782387,0.0200943664605458,0.00363147379277453
0.295377351869768,0.108445858384018,0.019040123479836,0.00338513596160304
0.283122066100135,0.104374632848495,0.0180423053448312,0.00316565728079348
0.271398650164465,0.100460305211796,0.0170995738403303,0.0029698495549103
0.260190863606074,0.0966830386847356,0.0162100638803249,0.00279435029276752
0.249480370591311,0.0930286987898092,0.0153715252985084,0.00263589300567087
0.239247213436084,0.0894878338463341,0.0145815957210218,0.002491545439791
0.229470346306504,0.0860546497623421,0.0138378615720872,0.00235884935269597
0.220128148976686,0.0827260491927552,0.0131378639605267,0.00223588384965084
0.211198902955524,0.0795007779016462,0.0124791808709379,0.00212125323555392
0.20266120682353,0.0763786992809964,0.0118594333328108,0.0020139945677632
0.194494311443246,0.0733602078340912,0.0112762767066973,0.00191345670528973
0.186678374172779,0.0704457804639186,0.0107274179119509,0.0018191767154505
0.179194635081175,0.0676356552603192,0.0102106211287206,0.00173077210770515
0.172025520775263,0.064929622999291,0.00972370794405955,0.0016478667536602
0.165154686254735,0.0623269135604257,0.00926457432688479,0.00157005669764952
0.158567006362608,0.0598261581740075,0.00883120737460965,0.00149690646906453
0.152248528236286,0.0574254089705774,0.00842170119327602,0.00142796690804853
0.146186396016794,0.0551221987689224,0.00803427530290723,0.0013628024472437
0.140368757967879,0.0529136261066764,0.00766728912012237,0.00130101642649392
0.134784664597338,0.0507964530245216,0.00731924890008266,0.00124226770384004
0.129423964825334,0.0487672057100314,0.00698880917814805,0.00118627695274624
0.124277205618631,0.046822270602385,0.00667476765058639,0.00113282353216918
0.119335538941298,0.0449579808540134,0.0063760543634253,0.0010817364372413
0.11459063850232,0.0431706900378893,0.00609171803409054,0.00103288330782315
0.110034627608638,0.0414568316344016,0.00582091131964085,0.000986160390158817
0.105660018476945,0.0398129641266707,0.00556287623442419,0.000941484872060258
0.101459662633845,0.0382358024894679,0.00531693108962639,0.000898789756847698
0.0974267115198392,0.0367222375053657,0.00508245926485931,0.000858020371449084
0.0935545860830807,0.0352693447261226,0.00485889955647229,0.000819131356725285
0.0898369539782651,0.0338743850644921,0.00464573784815541,0.00078208329876107
0.0862677129419094,0.0325347989994978,0.00444249975285543,0.000746838714885712
0.0828409789666302,0.0312481962526895,0.00424874389794858,0.000713357679487274
0.0795510780159448,0.0300123425850257,0.00406405581698042,0.000681593780987298
0.076392540182423,0.0288251451088667,0.00388804253930626,0.000651491166504331
0.0733600953745436,0.0276846372357925,0.00372032800246882,0.000622983230006533
0.070448669804769,0.0265889641106603,0.00356054943074244,0.000595993138422716
0.0676533827305797,0.0255363691313685,0.0034083547518209,0.00057043599416774
0.064969543062731,0.024525181932661,0.00326340099829315,0.00054622212266834
0.0623926455954874,0.0235538080267355,0.00312535355830137,0.000523260827093126
0.0599183667294525,0.0226207201454146,0.00299388608378455,0.000501463968548093
0.0575425596484649,0.0217244512173301,0.00286868083997892,0.000480748874949654
0.055261248979131,0.0208635888360229,0.00274942930127684,0.000461040295246497
0.0530706250072852,0.0200367710268393,0.00263583284298659,0.000442271333040507
0.0509670375530574,0.0192426830970757,0.00252760342283966,0.000424383467067322
0.0489469896186406,0.0184800553498327,0.00242446418777184,0.000407325873359123
0.0470071309236527,0.0177476614525368,0.0023261499716701,0.000391054302991331
0.0451442514353558,0.0170443172715253,0.00223240766511842,0.000375529754828271
function [modelIrf, error_indicator] = rbc_irf_matching_transformations(modelIrf, M_, options_mom_, ys_)
% -------------------------------------------------------------------------
% This file manipulates model IRFs to be consistent with empirical IRFS
% -------------------------------------------------------------------------
% INPUTS
% - modelIrf: [options_mom_.irf by M_.endo_nbr by M_.exo_nbr]
% array of IRFs for all model variables and all shocks
% - M_: [structure] Dynare model structure
% - options_mom_: [structure] Dynare options structure
% - ys_: [double] steady state values of all endogenous variables
% -------------------------------------------------------------------------
% OUTPUTS
% - modelIrf: [options_mom_.irf by M_.endo_nbr by M_.exo_nbr]
% modified array of IRFs for all model variables and all shocks
% - error_indicator: [boolean] indicator of success (0) or failure (1)
% -------------------------------------------------------------------------
% This function is called by
% - mom.run
% -------------------------------------------------------------------------
% Copyright © 2024 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
% initialize error indicator
error_indicator = 0;
% get indices of variables
idx_ghat = find(ismember(M_.endo_names,'ghat'));
idx_log_y = find(ismember(M_.endo_names,'log_y'));
idx_eps_g = find(ismember(M_.exo_names,'eps_g'));
% manipulate the model IRFs to match the empirical IRFs (e.g. cumsum, common scaling, trends, ratios, etc.)
modelIrf(:,idx_ghat,idx_eps_g) = 100.*modelIrf(:,idx_ghat,idx_eps_g);
modelIrf(:,idx_log_y,idx_eps_g) = 100.*modelIrf(:,idx_log_y,idx_eps_g);
end
\ No newline at end of file
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Dynare
Upstream-Contact: Dynare Team, whose members in 2024 are:
Upstream-Contact: Dynare Team, whose members in 2025 are:
- Stéphane Adjemian <stephane.adjemian@univ-lemans.fr>
- Michel Juillard <michel.juillard@mjui.fr>
- Frédéric Karamé <frederic.karame@univ-lemans.fr>
......@@ -23,7 +23,7 @@ Upstream-Contact: Dynare Team, whose members in 2024 are:
Source: https://www.dynare.org
Files: *
Copyright: 1996-2024 Dynare Team
Copyright: 1996-2025 Dynare Team
License: GPL-3+
Files: matlab/+occbin/IVF_core.m
......@@ -89,15 +89,15 @@ License: public-domain-aim
Files: matlab/optimization/bfgsi1.m matlab/optimization/csolve.m matlab/optimization/csminit1.m matlab/optimization/numgrad2.m
matlab/optimization/numgrad3.m matlab/optimization/numgrad3_.m matlab/optimization/numgrad5.m
matlab/optimization/numgrad5_.m matlab/optimization/csminwel1.m matlab/+bvar/density.m
matlab/+bvar/toolbox.m matlab/partial_information/PI_gensys.m matlab/partial_information/qzswitch.m
matlab/partial_information/qzdiv.m
matlab/+bvar/toolbox.m matlab/partial_information/PI_gensys.m matlab/partial_information/PI_qzswitch.m
matlab/partial_information/PI_qzdiv.m
Copyright: 1993-2009 Christopher Sims
2006-2023 Dynare Team
2006-2024 Dynare Team
License: GPL-3+
Files: matlab/optimization/cmaes.m
Copyright: 2001-2012 Nikolaus Hansen
2012-2017 Dynare Team
2012-2023 Dynare Team
License: GPL-3+
Files: matlab/optimization/solvopt.m
......@@ -118,6 +118,10 @@ Copyright: 2011 Lawrence J. Christiano, Mathias Trabandt and Karl Walentin
2013-2017 Dynare Team
License: GPL-3+
Files: matlab/estimation/smc/logsumexp.m
Copyright: 2020 Nicholas J. Higham
License: BSD-2-clause
Files: matlab/one_sided_hp_filter.m
Copyright: 2010-2015 Alexander Meyer-Gohde
2015-2017 Dynare Team
......@@ -169,7 +173,7 @@ Comment: The author gave authorization to redistribute
Files: matlab/+gsa/Morris_Measure_Groups.m
matlab/+gsa/Sampling_Function_2.m
Copyright: 2005 European Commission
2012-2013 Dynare Team
2012-2023 Dynare Team
License: GPL-3+
Comment: Written by Jessica Cariboni and Francesca Campolongo
Joint Research Centre, The European Commission,
......@@ -216,14 +220,14 @@ License: GPL-3+
Files: matlab/missing/stats/quantile.m
Copyright: 2014-2016 Christopher Hummersone
2016-2017 Dynare Team
2016-2023 Dynare Team
License: GPL-3+
Files: matlab/missing/stats/corr.m
Copyright: 1993-1996 Kurt Hornik
1996-2015 John W. Eaton
2013-2015 Julien Bect
2016-2017 Dynare Team
2016-2023 Dynare Team
License: GPL-3+
Files: matlab/lmmcp/catstruct.m
......@@ -256,7 +260,7 @@ Copyright: 2000-2022 Frank Schorfheide
License: CC-BY-SA-4.0
Files: doc/*.rst doc/*.tex doc/*.svg doc/*.pdf doc/*.bib
Copyright: 1996-2022 Dynare Team
Copyright: 1996-2025 Dynare Team
License: GFDL-NIV-1.3+
Files: doc/dr.tex doc/dr.bib
......@@ -274,14 +278,14 @@ License: GPL-3+
Files: scripts/dynare.el
Copyright: 2010 Yannick Kalantzis
2019-2023 Dynare Team
2019-2025 Dynare Team
License: GPL-3+
Files: mex/sources/gensylv/gensylv.cc
mex/sources/libkorder/kord/* mex/sources/libkorder/sylv/*
mex/sources/libkorder/tl/* mex/sources/libkorder/utils/*
Copyright: 2004-2011 Ondra Kamenik
2019-2023 Dynare Team
2019-2025 Dynare Team
License: GPL-3+
Files: mex/sources/sobol/sobol.f08
......@@ -290,11 +294,11 @@ Copyright: 2004-2009 John Burkardt
License: LGPL-3+
Files: preprocessor/doc/macroprocessor/*
Copyright: 2008-2021 Dynare Team
Copyright: 2008-2024 Dynare Team
License: CC-BY-SA-4.0
Files: preprocessor/doc/preprocessor/*
Copyright: 2007-2019 Dynare Team
Copyright: 2007-2023 Dynare Team
License: CC-BY-SA-4.0
Files: contrib/ms-sbvar/utilities_dw/*
......
......@@ -34,11 +34,16 @@ if [[ "$PKG_ARCH" == arm64 ]]; then
MATLAB_ARCH=maca64
else
BREWDIR=/usr/local
# Remove /opt/homebrew/bin from PATH, so it does not intervene with the x86_64 compilations
# Remove /opt/homebrew/bin from PATH, so it does not interfere with the x86_64 compilations
path_remove PATH /opt/homebrew/bin
MATLAB_ARCH=maci64
fi
MATLAB_PATH=/Applications/"$PKG_ARCH"/MATLAB_R2024a.app
MATLAB_PATH=/Applications/"$PKG_ARCH"/MATLAB_R2024b.app
# Workaround for bug in Xcode 15.3 which does not include m4
# See https://github.com/Homebrew/homebrew-core/issues/165388
# and https://trac.macports.org/ticket/69639
path_prepend PATH "$BREWDIR"/opt/m4/bin
# Append texbin to PATH to access latexmk and friends
path_prepend PATH /Library/TeX/texbin
......@@ -65,18 +70,18 @@ ln -s "$BREWDIR"/opt/gcc/lib/gcc/"$GCC_VERSION"/libquadmath.a "$QUADMATH_DIR"
cd "$ROOTDIR"
# NB: the addition of -Wl,-ld_classic is a workaround for https://github.com/mesonbuild/meson/issues/12282 (see also the native file)
common_meson_opts=(-Dbuild_for=matlab -Dbuildtype=release -Dprefer_static=true -Dfortran_args="[ '-B', '$LIB64/Slicot/' ]" \
common_meson_opts=(-Dbuild_for=matlab --buildtype=release --prefer-static -Dfortran_args="[ '-B', '$LIB64/Slicot/' ]" \
-Dc_link_args="[ '-Wl,-ld_classic', '-L$QUADMATH_DIR' ]" -Dcpp_link_args="[ '-Wl,-ld_classic', '-L$QUADMATH_DIR' ]" -Dfortran_link_args="[ '-Wl,-ld_classic', '-L$QUADMATH_DIR' ]" \
--native-file macOS/homebrew-native-$PKG_ARCH.ini)
# Build for MATLAB ⩾ R2018b (x86_64) and MATLAB ⩾ R2023b (arm64)
arch -"$PKG_ARCH" meson setup "${common_meson_opts[@]}" -Dmatlab_path="$MATLAB_PATH" build-matlab --wipe
arch -"$PKG_ARCH" meson compile -v -C build-matlab
arch -"$PKG_ARCH" meson setup "${common_meson_opts[@]}" -Dmatlab_path="$MATLAB_PATH" build-macOS-matlab --wipe
arch -"$PKG_ARCH" meson compile -v -C build-macOS-matlab
# If not in CI, build the docs
if [[ -z $CI ]]; then
arch -"$PKG_ARCH" meson compile -v -C build-matlab doc
ln -s build-matlab build-doc
arch -"$PKG_ARCH" meson compile -v -C build-macOS-matlab doc
ln -s build-macOS-matlab build-doc
fi
##
......@@ -85,7 +90,7 @@ fi
# Determine Dynare version if not passed by an environment variable as in the CI
if [[ -z $VERSION ]]; then
cd build-matlab
cd build-macOS-matlab
VERSION=$(meson introspect --projectinfo | sed -En 's/^.*"version": "([^"]*)".*$/\1/p')
cd ..
fi
......@@ -117,9 +122,9 @@ mkdir -p \
"$PKGFILES"/scripts \
"$PKGFILES"/contrib/ms-sbvar/TZcode
if [[ "$PKG_ARCH" == x86_64 ]]; then
mkdir -p "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-9.5-24.1
mkdir -p "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-9.5-24.2
else
mkdir -p "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-23.2-24.1
mkdir -p "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-23.2-24.2
fi
cp -p "$ROOTDIR"/NEWS.md "$PKGFILES"
......@@ -127,20 +132,20 @@ cp -p "$ROOTDIR"/COPYING "$PKGFILES"
cp -p "$ROOTDIR"/license.txt "$PKGFILES"
cp -pr "$ROOTDIR"/matlab "$PKGFILES"
cp -p "$ROOTDIR"/build-matlab/dynare_version.m "$PKGFILES"/matlab
cp -p "$ROOTDIR"/build-macOS-matlab/dynare_version.m "$PKGFILES"/matlab
cp -pr "$ROOTDIR"/examples "$PKGFILES"
cp -p "$ROOTDIR"/build-matlab/preprocessor/src/dynare-preprocessor "$PKGFILES"/preprocessor
cp -p "$ROOTDIR"/build-macOS-matlab/preprocessor/src/dynare-preprocessor "$PKGFILES"/preprocessor
# Create backward-compatibility symlink
mkdir -p "$PKGFILES"/matlab/preprocessor64
ln -sf ../../preprocessor/dynare-preprocessor "$PKGFILES"/matlab/preprocessor64/dynare_m
if [[ "$PKG_ARCH" == x86_64 ]]; then
cp -L "$ROOTDIR"/build-matlab/*.mex"$MATLAB_ARCH" "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-9.5-24.1
cp -L "$ROOTDIR"/build-macOS-matlab/*.mex"$MATLAB_ARCH" "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-9.5-24.2
else
cp -L "$ROOTDIR"/build-matlab/*.mex"$MATLAB_ARCH" "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-23.2-24.1
cp -L "$ROOTDIR"/build-macOS-matlab/*.mex"$MATLAB_ARCH" "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-23.2-24.2
fi
cp -p "$ROOTDIR"/scripts/dynare.el "$PKGFILES"/scripts
......
SLICOT_VERSION = 5.9
X13AS_VERSION = 1-1-b60
X13AS_VERSION = 1-1-b61