Skip to content
Snippets Groups Projects

Compare revisions

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

Source

Select target project
No results found
Select Git revision
  • 4.3
  • 4.4
  • 4.5
  • 4.6
  • 5.x
  • 6.x
  • asm
  • aux_func
  • benchmark-ec
  • clang+openmp
  • covariance-quadratic-approximation
  • dates-and-dseries-improvements
  • declare_vars_in_model_block
  • dmm
  • dprior
  • dragonfly
  • dynamic-striated
  • dynare_minreal
  • eigen
  • ep-sparse
  • error_msg_undeclared_model_vars
  • estim_params
  • exceptions
  • exo_steady_state
  • filter_initial_state
  • gpm-optimal-policy
  • julia
  • kalman_mex
  • master
  • mex-GetPowerDeriv
  • mr#2134
  • new-samplers
  • newton-quadratic-equation-solver
  • nlf-fixes
  • nlf-fixes-r
  • nls-fixes
  • nonlinear-filter-fixes
  • occbin
  • pac-mce-with-composite-target
  • parfor
  • penalty
  • rebase-1
  • remove-persistent-variables
  • remove-priordens
  • reset-seed-in-unit-tests
  • rmExtraExo
  • sep
  • sep-fixes
  • separateM_
  • silicon
  • silicon-new-samplers
  • slice
  • sphinx-doc-experimental
  • static_aux_vars
  • time-varying-information-set
  • use-dprior
  • various_fixes
  • 3.062
  • 3.063
  • 4.0.0
  • 4.0.1
  • 4.0.2
  • 4.0.3
  • 4.0.4
  • 4.1-alpha1
  • 4.1-alpha2
  • 4.1.0
  • 4.1.1
  • 4.1.2
  • 4.1.3
  • 4.2.0
  • 4.2.1
  • 4.2.2
  • 4.2.3
  • 4.2.4
  • 4.2.5
  • 4.3.0
  • 4.3.1
  • 4.3.2
  • 4.3.3
  • 4.4-beta1
  • 4.4.0
  • 4.4.1
  • 4.4.2
  • 4.4.3
  • 4.5.0
  • 4.5.1
  • 4.5.2
  • 4.5.3
  • 4.5.4
  • 4.5.5
  • 4.5.6
  • 4.5.7
  • 4.6-beta1
  • 4.6.0
  • 4.6.0-rc1
  • 4.6.0-rc2
  • 4.6.1
  • 4.6.2
  • 4.6.3
  • 4.6.4
  • 4.7-beta1
  • 4.7-beta2
  • 4.7-beta3
  • 5.0
  • 5.0-rc1
  • 5.1
  • 5.2
  • 5.3
  • 5.4
  • 5.5
111 results

Target

Select target project
  • giovanma/dynare
  • giorgiomas/dynare
  • Vermandel/dynare
  • Dynare/dynare
  • normann/dynare
  • MichelJuillard/dynare
  • wmutschl/dynare
  • FerhatMihoubi/dynare
  • sebastien/dynare
  • lnsongxf/dynare
  • rattoma/dynare
  • CIMERS/dynare
  • FredericKarame/dynare
  • SumuduK/dynare
  • MinjeJeon/dynare
  • camilomrch/dynare
  • DoraK/dynare
  • avtishin/dynare
  • selma/dynare
  • claudio_olguin/dynare
  • jeffjiang07/dynare
  • EthanSystem/dynare
  • stepan-a/dynare
  • wjgatt/dynare
  • JohannesPfeifer/dynare
  • gboehl/dynare
  • chskcau/dynare-doc-fixes
27 results
Select Git revision
  • 4.3
  • 4.4
  • 4.5
  • 4.6
  • 5.x
  • 6.x
  • asm
  • aux_func
  • clang+openmp
  • dates-and-dseries-improvements
  • declare_vars_in_model_block
  • dmm
  • dragonfly
  • dynare_minreal
  • eigen
  • error_msg_undeclared_model_vars
  • estim_params
  • exo_steady_state
  • gpm-optimal-policy
  • julia
  • madysson
  • master
  • mex-GetPowerDeriv
  • penalty
  • separateM_
  • slice
  • sphinx-doc-experimental
  • static_aux_vars
  • time-varying-information-set
  • various_fixes
  • 3.062
  • 3.063
  • 4.0.0
  • 4.0.1
  • 4.0.2
  • 4.0.3
  • 4.0.4
  • 4.1-alpha1
  • 4.1-alpha2
  • 4.1.0
  • 4.1.1
  • 4.1.2
  • 4.1.3
  • 4.2.0
  • 4.2.1
  • 4.2.2
  • 4.2.3
  • 4.2.4
  • 4.2.5
  • 4.3.0
  • 4.3.1
  • 4.3.2
  • 4.3.3
  • 4.4-beta1
  • 4.4.0
  • 4.4.1
  • 4.4.2
  • 4.4.3
  • 4.5.0
  • 4.5.1
  • 4.5.2
  • 4.5.3
  • 4.5.4
  • 4.5.5
  • 4.5.6
  • 4.5.7
  • 4.6-beta1
  • 4.6.0
  • 4.6.0-rc1
  • 4.6.0-rc2
  • 4.6.1
  • 4.6.2
  • 4.6.3
  • 4.6.4
  • 4.7-beta1
  • 4.7-beta2
  • 4.7-beta3
  • 5.0
  • 5.0-rc1
  • 5.1
  • 5.2
  • 5.3
  • 5.4
  • 5.5
  • 6-beta1
  • 6-beta2
  • 6.0
  • 6.1
  • 6.2
  • 6.3
  • 6.4
91 results
Show changes
Commits on Source (356)
Showing
with 2902 additions and 1508 deletions
variables:
GIT_SUBMODULE_STRATEGY: recursive
TERM: linux
MATLAB_VERSION: R2021a
OLD_MATLAB_VERSION: R2009b
OCTAVE_VERSION: 6.2.0
# The next stanza creates the version number used for the source tarball and the
# binary packages. Here are the following possible cases:
# - if VERSION was already set (when manually running a pipeline), use it
# - if we are in the official Dynare repository:
# + if on a tag: use the tag
# + if on master: use 4.6-unstable-$TIMESTAMP-$COMMIT
# + on another branch: use $BRANCH-$TIMESTAMP-$COMMIT
# + otherwise: use $BRANCH-$TIMESTAMP-$COMMIT
# - if in a personal repository: use $USER-$TIMESTAMP-$COMMIT
#
# Also sets the path and version of the default MATLAB installation.
before_script:
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ -n $CI_COMMIT_TAG ]] && export VERSION=$CI_COMMIT_TAG'
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && [[ $CI_COMMIT_REF_NAME == master ]] && export VERSION=4.6-unstable-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA'
- '[[ -z $VERSION ]] && [[ $CI_PROJECT_NAMESPACE == Dynare ]] && export VERSION=$CI_COMMIT_REF_NAME-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA'
- '[[ -z $VERSION ]] && export VERSION=$CI_PROJECT_NAMESPACE-$(date +%F-%H%M)-$CI_COMMIT_SHORT_SHA'
- 'export MATLAB_PATH=$(dirname $(dirname $(readlink -f $(which matlab))))'
- 'export MATLAB_VERSION=$(echo version | matlab -nodesktop -nodisplay -nosplash 2>/dev/null | sed -En "/ans\ =/!d;n;n;s/^[^0-9]*([0-9]+\.[0-9]+).*$/\1/;p")'
stages:
- build
- test_and_pkg
- test
- pkg
- deploy
build_binaries:
stage: build
script:
- autoreconf -si
- ./configure --with-matlab=$MATLAB_PATH MATLAB_VERSION=$MATLAB_VERSION PACKAGE_VERSION=$VERSION PACKAGE_STRING="dynare $VERSION"
- ./configure --with-matlab=/usr/local/MATLAB/$MATLAB_VERSION --with-octave=/usr/local/octave/$OCTAVE_VERSION MATLAB_VERSION=$MATLAB_VERSION PACKAGE_VERSION=$VERSION PACKAGE_STRING="dynare $VERSION"
- make -j $(nproc) LN_S="cp -p"
artifacts:
paths:
......@@ -42,13 +40,11 @@ build_binaries:
- dynare++/src/*_tab.cc
- dynare++/src/*_tab.hh
- dynare++/src/*_ll.cc
- dynare++/*/*.o
- dynare++/*/*.a
- dynare++/*/*/*.o
- dynare++/*/*/*.a
- dynare++/**/*.o
- dynare++/**/*.a
- dynare++/integ/src/quadrature-points
- dynare++/src/dynare++
expire_in: 1 week
expire_in: 3 days
build_doc:
stage: build
......@@ -59,27 +55,27 @@ build_doc:
artifacts:
paths:
- doc/manual/build/
- doc/*.pdf
- doc/*/*.pdf
- doc/**/*.pdf
- dynare++/doc/*.pdf
- preprocessor/doc/*/*.pdf
expire_in: 1 week
expire_in: 3 days
pkg_source:
stage: test_and_pkg
stage: pkg
script:
- rm doc/manual/source/_static/mathjax && sed -i "/^mathjax_path *=/d" doc/manual/source/conf.py
- 'for f in configure.ac preprocessor/configure.ac mex/build/matlab/configure.ac mex/build/octave/configure.ac; do sed -i "s/^AC_INIT(\[\(.*\)\],\s*\[\(.*\)\])/AC_INIT([\1], [$VERSION])/" $f; done'
- autoreconf -si
- ./configure --with-matlab=$MATLAB_PATH MATLAB_VERSION=$MATLAB_VERSION
- ./configure --with-matlab=/usr/local/MATLAB/$MATLAB_VERSION --with-octave=/usr/local/octave/$OCTAVE_VERSION MATLAB_VERSION=$MATLAB_VERSION
- make dist
artifacts:
paths:
- dynare-*.tar.xz
expire_in: 1 week
dependencies: []
expire_in: 3 days
needs: []
pkg_windows:
stage: test_and_pkg
stage: pkg
script:
- ln -s ~/tarballs windows/deps/
- make -C windows
......@@ -98,12 +94,11 @@ pkg_windows:
- windows/exe/*
- windows/7z/*
- windows/zip/*
expire_in: 1 week
dependencies:
- build_doc
expire_in: 3 days
needs: [ "build_doc" ]
pkg_macOS:
stage: test_and_pkg
stage: pkg
script:
- ln -s ~/tarballs macOS/deps/
- make -C macOS
......@@ -117,70 +112,55 @@ pkg_macOS:
artifacts:
paths:
- macOS/pkg/*
expire_in: 1 week
dependencies:
- build_doc
expire_in: 3 days
needs: [ "build_doc" ]
.test_matlab_template:
stage: test_and_pkg
stage: test
artifacts:
paths:
- tests/*.m.log
- tests/*.m.trs
- tests/*/*.m.log
- tests/*/*.m.trs
- tests/*/*.jnl
- tests/*/*/*.m.log
- tests/*/*/*.m.trs
- tests/*/*/*.jnl
- tests/**/*.m.log
- tests/**/*.m.trs
- tests/**/*.jnl
- tests/run_test_matlab_output.txt
when: always
dependencies:
- build_binaries
needs: [ "build_binaries" ]
test_matlab:
extends: .test_matlab_template
script:
- autoreconf -si
- ./configure --disable-octave --with-matlab=$MATLAB_PATH MATLAB_VERSION=$MATLAB_VERSION
- ./configure --disable-octave --with-matlab=/usr/local/MATLAB/$MATLAB_VERSION MATLAB_VERSION=$MATLAB_VERSION
- make -j $(($(nproc) * 3 / 4)) -C tests check-matlab
test_old_matlab:
extends: .test_matlab_template
script:
- autoreconf -si
- ./configure --disable-octave --with-matlab=/usr/local/MATLAB/R2009b MATLAB_VERSION=R2009b
- ./configure --disable-octave --with-matlab=/usr/local/MATLAB/$OLD_MATLAB_VERSION MATLAB_VERSION=$OLD_MATLAB_VERSION
- make -C mex/build/matlab clean
- make -j $(nproc) -C mex/build/matlab
- make -j $(($(nproc) * 3 / 4)) -C tests check-matlab
when: manual
test_octave:
stage: test_and_pkg
stage: test
variables:
OPENBLAS_NUM_THREADS: 1
script:
- autoreconf -si
- ./configure --disable-matlab
- ./configure --disable-matlab --with-octave=/usr/local/octave/$OCTAVE_VERSION
- make -j $(nproc) -C tests check-octave
artifacts:
paths:
- tests/*.o.log
- tests/*.o.trs
- tests/*/*.o.log
- tests/*/*.o.trs
- tests/*/*.jnl
- tests/*/*/*.o.log
- tests/*/*/*.o.trs
- tests/*/*/*.jnl
- tests/**/*.o.log
- tests/**/*.o.trs
- tests/**/*.jnl
- tests/run_test_octave_output.txt
when: always
dependencies:
- build_binaries
when: manual
needs: [ "build_binaries" ]
test_dynare++:
stage: test_and_pkg
stage: test
script:
- autoreconf -si
- ./configure --disable-matlab --disable-octave
......@@ -189,8 +169,7 @@ test_dynare++:
- touch dynare++/*/*.a dynare++/*/*/*.a
- touch dynare++/integ/src/quadrature-points dynare++/src/dynare++
- make -C dynare++ check
dependencies:
- build_binaries
needs: [ "build_binaries" ]
artifacts:
paths:
- dynare++/kord/out.txt
......@@ -199,10 +178,16 @@ test_dynare++:
- dynare++/tests/*.mat
- dynare++/tests/*.dump
deploy_manual_unstable:
# For the 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.
deploy_manual_stable:
stage: deploy
only:
- master@Dynare/dynare
rules:
- if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_TAG =~ /^4\.6\.[0-9]+$/'
when: on_success
- when: never
tags:
- restricted
dependencies:
......@@ -210,12 +195,15 @@ deploy_manual_unstable:
script:
- rm -rf doc/manual/build/html/_static/mathjax
- ln -s /usr/share/javascript/mathjax doc/manual/build/html/_static/mathjax
- rsync --recursive --links --delete doc/manual/build/html/ /srv/www.dynare.org/manual-unstable/
- rsync --recursive --links --delete doc/manual/build/html/ /srv/www.dynare.org/manual/
- cp doc/manual/build/latex/dynare-manual.pdf /srv/www.dynare.org/manual.pdf
deploy_snapshot_unstable:
deploy_release_stable:
stage: deploy
only:
- master@Dynare/dynare
rules:
- if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_TAG =~ /^4\.6\.[0-9]+$/'
when: on_success
- when: never
tags:
- restricted
dependencies:
......@@ -223,11 +211,31 @@ deploy_snapshot_unstable:
- pkg_windows
- pkg_macOS
script:
- f=(windows/exe/*) && osslsigncode sign -pkcs12 ~/dynare-object-signing.p12 -n Dynare -i https://www.dynare.org -in ${f[0]} -out ${f[0]}.signed && mv ${f[0]}.signed ${f[0]}
- cp *.tar.xz /srv/www.dynare.org/snapshot/source/ && ln -sf *.tar.xz /srv/www.dynare.org/snapshot/source/dynare-latest-src.tar.xz
- f=(windows/exe/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows/dynare-latest-win.exe
- f=(windows/7z/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows-7z/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows-7z/dynare-latest-win.7z
- f=(windows/zip/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/windows-zip/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/windows-zip/dynare-latest-win.zip
- f=(macOS/pkg/*) && cp ${f[0]} /srv/www.dynare.org/snapshot/macos/ && ln -sf ${f[0]##*/} /srv/www.dynare.org/snapshot/macos/dynare-latest-macos.pkg
- ~/update-snapshot-list.sh
- f=(windows/exe/*) && osslsigncode sign -pkcs12 ~/cepremap-comodo-sectigo-code-signing.p12 -n Dynare -i https://www.dynare.org -t http://timestamp.comodoca.com -in ${f[0]} -out ${f[0]}.signed && mv ${f[0]}.signed ${f[0]}
- cp *.tar.xz /srv/www.dynare.org/release/source/
- cp windows/exe/* /srv/www.dynare.org/release/windows/
- cp windows/7z/* /srv/www.dynare.org/release/windows-7z/
- cp windows/zip/* /srv/www.dynare.org/release/windows-zip/
- cp macOS/pkg/* /srv/www.dynare.org/release/macos/
- ~/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
deploy_beta_stable:
stage: deploy
rules:
- if: '$CI_PROJECT_NAMESPACE == "Dynare" && $CI_COMMIT_TAG =~ /^4\.6(\.[0-9]+)?-(beta|rc)[0-9]+$/'
when: on_success
- when: never
tags:
- restricted
dependencies:
- pkg_source
- pkg_windows
- pkg_macOS
script:
- f=(windows/exe/*) && osslsigncode sign -pkcs12 ~/dynare-object-signing.p12 -n Dynare -i https://www.dynare.org -t http://timestamp.digicert.com -in ${f[0]} -out ${f[0]}.signed && mv ${f[0]}.signed ${f[0]}
- cp *.tar.xz /srv/www.dynare.org/beta/source/
- cp windows/exe/* /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/* /srv/www.dynare.org/beta/macos/
......@@ -16,7 +16,7 @@ ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = \
matlab \
contrib \
NEWS \
NEWS.md \
license.txt \
README.md \
COPYING \
......@@ -34,9 +34,10 @@ all-local: preprocessor/src/dynare_m$(EXEEXT)
ARCH="32"; \
fi; \
mkdir -p $(abs_srcdir)/matlab/preprocessor$$ARCH && \
$(LN_S) -f $(abs_builddir)/preprocessor/src/dynare_m$(EXEEXT) $(abs_srcdir)/matlab/preprocessor$$ARCH && \
mkdir -p $(abs_srcdir)/julia/preprocessor$$ARCH && \
$(LN_S) -f $(abs_builddir)/preprocessor/src/dynare_m$(EXEEXT) $(abs_srcdir)/julia/preprocessor$$ARCH
$(LN_S) -f $(abs_builddir)/preprocessor/src/dynare_m$(EXEEXT) $(abs_srcdir)/matlab/preprocessor$$ARCH
clean-local:
rm -rf $(abs_srcdir)/matlab/preprocessor32 $(abs_srcdir)/matlab/preprocessor64
dist-hook:
rm -rf `find $(distdir)/matlab $(distdir)/examples -name *~`
......
Announcement for Dynare 4.6.4 (on 2021-03-18)
=============================================
We are pleased to announce the release of Dynare 4.6.4.
This maintenance release fixes various bugs.
The Windows, macOS and source packages are already available for download at
[the Dynare website](https://www.dynare.org/download/).
All users are strongly encouraged to upgrade.
This release is compatible with MATLAB versions ranging from 7.9 (R2009b) to
9.10 (R2021a), and with GNU Octave version 6.2.0 (under Windows).
Here is a list of the problems identified in version 4.6.3 and that have been
fixed in version 4.6.4:
* Passing multiple shock values through a MATLAB/Octave vector in a `mshocks`
block would not work
* The `mode_compute=12` option was broken
* The `use_mh_covariance_matrix` option was ignored
* The `load_mh_file` option together with `mh_replic=0` would not allow
computing `moments_varendo` for a different list of variables
* The `forecast` option was ignored when using `mode_compute=0` without a
mode-file to execute the smoother
* The `discretionary_policy` command would crash in the presence of news shocks
* The `ramsey_constraints` block would crash if the constraints contained
defined `parameters`
* Identification would display a wrong error message if a unit root was present
and `diffuse_filter` had been set
* Particle filter estimation would crash if the initial state covariance became
singular for a draw
* Particle filter estimation would crash if `k_order_solver` option was
specified with `options_.particle.pruning`
* The initial state covariance in particle filter estimation could be `NaN`
when using `nonlinear_filter_initialization=2` despite
`options_.particles.pruning=1`
* Output of `smoother` results when using particle filters would be based on
`order=1`
* Output of `moments_varendo` results when using particle filters would be
based on `order=1`
* When decreasing the `order` in `.mod` files, `oo_.dr` could contain stale
results from higher orders
* Estimation results using the particle filter at `order=3` would be incorrect
if the restricted state space differed from the unrestricted one
* The `mode_compute=102` option (SOLVEOPT) could return with `Inf` instead of
the last feasible value
* Using `analytic_derivation` for Bayesian estimation would result in wrong
results when the multivariate Kalman filter entered the steady state stage
* Using `analytic_derivation` for maximum likelihood estimation would result in
a crash
* When using the Bayesian smoother with `filtered_vars`, the field for
`Filtered_Variables_X_step_ahead` used the length of vector instead of the
actual steps in `filter_step_ahead`
* `mode_compute=1,3` crashed when `analytic_derivation` was specified
* `mode_compute=1,3,102` did only allow for post-MATLAB 2016a option names
* The `cova_compute=0` option was not working with user-defined
`MCMC_jumping_covariance`
* The `mode_compute=1` option was not working with `analytic_derivation`
* Not all commands were honouring the `M_.dname` folder when saving
* LaTeX output of the simulated variance decomposition for observables with
measurement error could have a wrong variable label
Announcement for Dynare 4.6.3 (on 2020-11-23)
=============================================
We are pleased to announce the release of Dynare 4.6.3.
This maintenance release fixes various bugs.
The Windows, macOS and source packages are already available for download at
[the Dynare website](https://www.dynare.org/download/).
All users are strongly encouraged to upgrade.
This release is compatible with MATLAB versions ranging from 7.9 (R2009b) to
9.9 (R2020b), and with GNU Octave versions 5.2.0 (under Windows) and 4.4.1
(under macOS).
Here is a list of the problems identified in version 4.6.2 and that have been
fixed in version 4.6.3:
* Using an unknown symbol in `irf_shocks` option of `stoch_simul` would lead to
a crash of the preprocessor
* `identification` would crash for purely forward-looking models
* The `endogenous_prior` option did not properly handle missing observations
* The auxiliary particle filter with pruning and resampling would crash
* Initialization of the state variance for particle filters was buggy
* An `@#else` clause after an `@#ifndef` was not correctly interpreted
* An `@#elseif` clause after an `@#ifdef` or an `@#ifndef` was not correctly
interpreted
* Perfect foresight simulations of models with a single equation would crash
when using either the `lmmcp` option or the `linear_approximation`
* Inequality constraints on endogenous variables (when using the `lmmcp`
option) were not enforced on purely backward or purely forward models
* Perfect foresight simulations with `bytecode` and `block` options could crash
if there was a purely forward variable whose value in all periods could be
evaluated backward (typically a process of the form `y=a*y(+1)+e`)
* `extended_path` was broken with `bytecode`
* Under Windows, with Octave, the k-order perturbation and MS-SBVAR MEX files
could not be loaded
* On Fedora (and possibly other GNU/Linux distributions), compilation from
source would fail against Octave 5
Announcement for Dynare 4.6.2 (on 2020-09-07)
=============================================
We are pleased to announce the release of Dynare 4.6.2.
This maintenance release fixes various bugs.
The Windows, macOS and source packages are already available for download at
[the Dynare website](https://www.dynare.org/download/).
All users are strongly encouraged to upgrade.
This release is compatible with MATLAB versions ranging from 7.9 (R2009b) to
9.8 (R2020a), and with GNU Octave versions 5.2.0 (under Windows) and 4.4.1
(under macOS).
*Note for Windows users:* upon launching the Dynare installer, you may get a
warning emitted by Windows Defender SmartScreen, saying that this is an
unrecognized app and that it was prevented from starting. You can safely ignore
this warning, as long as you can verify on the next screen that CEPREMAP is the
editor of the software. This security warning is due to the fact that we had to
renew our code signing certificate (which had expired), and it takes some time
to rebuild our reputation as a software editor using the new certificate.
Here is a list of the problems identified in version 4.6.1 and that have been
fixed in version 4.6.2:
* Perfect foresight simulations of purely backward models could deliver an
incorrect result if some exogenous variable appeared with a lag of 2 or more
(and neither `block` nor `bytecode` option was used)
* Perfect foresight simulations of linear models could deliver an incorrect
result if the following four conditions were met:
+ the model was actually declared as linear through the `linear` option
+ there was an exogenous variable with a lead or a lag
+ `stack_solve_algo` was equal to 0 (the default) or 7
+ neither `block` nor `bytecode` option was used
* In stochastic simulations, for variables that actually do not leave the
steady state, reported simulated moments could be spurious (due to division
by zero)
* Displayed variance decompositions would only take into account measurement
errors if measurement errors were present for all observed variables
* The posterior variance decompositions with measurement errors computed with
`moments_varendo` were incorrect
* `moments_varendo` would not update `oo_.PosteriorTheoreticalMoments` if it
was already present, from *e.g.* an earlier run of `estimation`
* Identification would in some cases compute wrong Jacobian of moments
* Identification would display incorrect results if parameter dependence was
implemented via a steady state file
* `generate_trace_plots` would crash when measurement errors were present
* `estimation` would crash for correlated measurement errors
* Parallel execution/testing could crash instead of aborting with a proper
error message
* Under macOS, Dynare would incorrectly claim that it is compiled for Octave
5.2.0 (it is actually compiled for Octave 4.4.1)
* Using external functions in a model local variable would crash the
preprocessor
* Tolerance criteria for steady state computations were inconsistently set
* `stoch_simul` with its default `order=2` would crash with a message about
`hessian_eq_zero` not existing if an explicit `order=1` was present somewhere
else in the `.mod` file
* Model local variables were not written to the `modfile.json` JSON file
* Model local variables names would have two spurious underscores at their
point of definition in the `dynamic.json` and `static.json` files (but only
in the definition, not when they were used, which is inconsistent)
* The `solve_algo=9` option was not accessible. The `solve_algo=10` and
`solve_algo=11` options were not accessible with `block` (without `bytecode`)
* Under certain circumstances, `extended_path` would crash when used in
conjunction with the `block` option
* `extended_path` was not working with the `bytecode` option
* `shock_decomposition` was not accepting the options of `estimation` related
to smoothing
* `conditional_forecast` would display a warning even if the simulation was
successful
* The `prior_trunc` option of `identification` was not working
* The `rand_multivariate_student` value of the `proposal_distribution` option
was not working when used with the
`tailored_random_block_metropolis_hastings` posterior sampling method
* Perfect foresight simulations of backward models would crash if convergence
failed with complex-valued residuals
* The diffuse Kalman smoother would crash if `Finf` became singular
Announcement for Dynare 4.6.1 (on 2020-03-13)
=============================================
We are pleased to announce the release of Dynare 4.6.1.
This maintenance release fixes various bugs.
The Windows, macOS and source packages are already available for download at
[the Dynare website](https://www.dynare.org/download/).
All users are strongly encouraged to upgrade.
This release is compatible with MATLAB versions ranging from 7.9 (R2009b) to
9.7 (R2019b), and with GNU Octave versions 5.2.0 (under Windows) and 4.4.1
(under macOS).
Here is a list of the problems identified in version 4.6.0 and that have been
fixed in version 4.6.1:
* Installation on macOS would fail if the GCC compiler was supposed to be
installed and `www.google.com` was not reachable or blocked
* Dynare++ was missing the `dynare_simul.m` file
* The parameter vector `M_.params` would not be correctly updated after calls
to `stoch_simul` and `discretionary_policy` if parameters had been modified
in a steady state file
* The `stoch_simul` command with both the `nograph` and `TeX` options would
crash
* The `stoch_simul` command with the `noprint` option would crash
* The `prior moments` command would crash if the used parameter vector
triggered an error code
* In case of problem, the `discretionary_policy` command would crash instead of
aborting with a proper error code
* Computing of prior/posterior statistics would not work in parallel
* Closing of parallel estimation on GNU/Linux could crash
* The `histval` command would not work in combination with the
`predetermined_variables` command
* Ramsey optimal policy with multiple instruments would crash if a steady state
file returned complex values, instead of providing an error message
* The `model_diagnostics` command would not correctly update the parameter
vector if the latter was set in a steady state file
* The `model_diagnostics` command would ignore the `nocheck` steady state flag
Announcement for Dynare 4.6.0 (on 2020-02-20)
=============================================
We are pleased to announce the release of Dynare 4.6.0.
This major release adds new features and fixes various bugs.
The Windows, macOS and source packages are already available for download at
[the Dynare website](https://www.dynare.org/download/).
All users are strongly encouraged to upgrade.
This release is compatible with MATLAB versions ranging from 7.9 (R2009b) to
9.7 (R2019b), and with GNU Octave versions 5.2.0 (under Windows) and 4.4.1
(under macOS).
Major user-visible changes
--------------------------
- Stochastic simulations
- The perturbation method is now available at an arbitrary approximation
order. In other words, the `order` option of `stoch_simul` accepts an
arbitrary positive integer (of course, up to some model-specific
computational limit).
- New option `filtered_theoretical_moments_grid` of `stoch_simul`, that
supersedes `hp_ngrid`.
- Estimation
- Nonlinear estimation is now also available at an arbitrary approximation
order. In other words, the `order` option of `estimation` accepts an
arbitrary positive integer (of course, up to some model-specific
computational limit).
- Various improvements to particle filters.
- It is now possible to estimate models under optimal policy (see below).
- Variance decomposition of observables now accounts for measurement error.
- New option `mh_tune_jscale` of `estimation` command for tuning the scale
parameter of the proposal distribution of the Random Walk Metropolis
Hastings.
- Added debugging info when parameters take a `NaN` or `Inf` value.
- Option `mode_compute=1` is now available under Octave.
- Perfect foresight and extended path
- A significant speed improvement should be noted on large models (when
neither `bytecode` nor `block` option is used). The stacked problem is
now constructed using a dedicated machine-compiled library that greatly
speeds up the process (in particular, the time spent in that step can
become negligible when the `use_dll` option is used).
- New options `print` and `noprint` of `perfect_foresight_solver` command.
- Option `stack_solve_algo=2` is now available under Octave.
- Steady state
- Option `solve_algo=7` is now available under Octave.
- Optimal policy
- The `ramsey_policy` command is now deprecated. It is superseded by
successive calls to `ramsey_model`, `stoch_simul`, and
`evaluate_planner_objective` (in this order).
- It is now possible to estimate a model under optimal policy (either
Ramsey or discretionary) by running the `estimation` command after either
`ramsey_model` or `discretionary_policy`. It is however not yet possible
to estimate parameters that appear in the discount factor of the social
planner.
- Discretionary policy returns a more informative error message when the
objective has nonzero derivatives with respect to some variables.
- Identification
- Added minimal system identification check of *Komunjer and Ng (2011)*.
- Added spectrum identification check of *Qu and Tkachenko (2012)*.
- Identification is now also available for approximation orders 2 and 3
with either analytical or numerical parameter derivatives. The relevant
moments and spectrum are computed from the pruned state space system
as in *Mutschler (2015)*.
- All tests (moments, spectrum, minimal system, strength) can be turned
off.
- More numerical options can be changed by the user.
- Improved printing and storage (same folder) of results.
- Sensitivity analysis
- New `diffuse_filter` option to the `dynare_sensitivity` command.
- Arbitrary expressions can now be passed for the interval boundaries in
`irf_calibration` and `moment_calibration`. ⚠ This breaks the
previous syntax, requiring that the lower/upper bounds be separated by
commas.
- Forecasting and smoothing
- In `conditional_forecast_paths`, it is no longer required that all
constrained paths be of the same length. There may now be a different
number of controlled variables at each period. In that case, the order of
declaration of endogenous controlled variables and of `controlled_varexo`
matters: if the second endogenous variable is controlled for less periods
than the first one, the second `controlled_varexo` isn't set for the last
periods.
- New option `parameter_set` to the `calib_smoother` command.
- ⚠ The results of `conditional_forecast` command is now saved in
`oo_` (used to be in a file)
- Shock decomposition
- Added `fast_realtime` option to real time shock decomposition (deactivated
by default, runs the smoother only twice: once for the last in-sample and
once for the last out-of-sample data point).
- New `diff`, `flip`, `max_nrows`, `plot_init_date` and `plot_end_date`
options to `plot_shock_decomposition`.
- New `initial_decomposition_decomposition` command, for computing and
plotting the decomposition of the effect of smoothed initial conditions of
state variables.
- New `squeeze_shock_decomposition` command, for removing decompositions of
variables that are not of interest.
- New `with_epilogue` option (common to `shock_decomposition`,
`realtime_shock_decomposition` and `initial_condition_decomposition`).
- New `init2shocks` block to attribute initial conditions to shocks.
- Macro processor
- New object types: real (supersedes integers), boolean (distinct from
integers), tuple, user-defined function.
- New operators: various mathematical functions, set operations on arrays
(union, intersection, difference, cartesian power and product), type
checking and conversion.
- Added support for comprehensions (*e.g.* the set containing the squares of
all even numbers between 1 and 5 can be constructed with `[ i^2 for i in
1:5 when mod(i,2) == 0]`).
- User-defined functions can be declared using the `@#define` operator (*e.g.*
`@#define f(x) = 2*x^2+3*x+5`).
- `@#elseif`-clauses are now supported in conditional statements.
- `@#for` loops can iterate over several variables at the same time (*e.g.*
`@#for (i,j) in X`, where `X` is an array containing tuples of size 2).
- Added the possibility to exclude some elements when iterating over `@#for`
loops (*e.g.* `@#for i in 1:5 when mod(i,2) == 0` iterates over all even
numbers between 1 and 5).
- A `defined()` function allows testing whether macro variables have been
defined.
- Empty arrays (with the `[]` syntax) are now possible.
- Arrays of arrays are now supported.
- New macro directives `@#echomacrovars` and `@#echomacrovars(save)` for
displaying or saving the values of all macro-variables.
- Inline comments are now supported.
- ⚠ All division operations are now done with doubles (as opposed to
integers). To achieve the old functionality, use the new `floor` operator.
- ⚠ Colon syntax used to require braces around it to create an array
(*e.g.* `[1:3]` would create `[1,2,3]`). Now this is not necessary (`1:3`
creates `[1,2,3]` while `[1:3]` would create `[[1,2,3]]`).
- ⚠ Previously, printing a boolean would print `1` or `0`. Now, it
prints `true` or `false`. To achieve the old functionality, you must cast
it to a real, *e.g.* `@{(real)(1!=0)}`.
- LaTeX output
- New command `write_latex_steady_state_model`.
- New option `planner_discount_latex_name` of `ramsey_model` and
`discretionary_policy`.
- New command `model_local_variable` command for assigning a LaTeX name to
model-local variables.
- The `write_latex_static_model` and `write_latex_original_model` commands
now support the `write_equation_tags` option.
- Compilation of the model (`use_dll` option) made easier and faster
- Under Windows, it is no longer necessary to manually install the
compiler, since the latter is now shipped by the Dynare installer.
- Under macOS, the Dynare installer now automatically downloads and
installs the compiler.
- It is no longer necessary to configure MATLAB to let it know where the
compiler is, since the compilation is now done by the preprocessor.
- The compilation phase is now faster on large models (this has been
achieved by disabling a few time-consuming and not-so-useful optimization
passes otherwise done by the compiler).
- New `compilation_setup` block for specifying a custom compiler or custom
compilation flags.
- Model, variables and parameters declaration
- New syntax to declare model variables and parameters on-the-fly in the
`model` block. To do this, simply follow the symbol name with a vertical
line (`|`, pipe character) and either an `e`, an `x`, or a `p`. For
example, to declare a parameter named `alpha` in the model block, you
could write `alpha|p` directly in an equation where it appears.
Similarly, to declare an endogenous variable `c` in the model block you
could write `c|e`.
- New syntax to declare model variable and parameters on-the-fly in
equation tags. In the tag, simply state the type of variable to be
declared (`endogenous`, `exogenous`, or `parameter` followed by an equal
sign and the variable name in single quotes. Hence, to declare a variable
`c` as endogenous in an equation tag, you can type `[endogenous='c']`.
- New `epilogue` block for computing output variables of interest that may
not be necessarily defined in the model (*e.g.* various kinds of
real/nominal shares or relative prices, or annualized variables out of a
quarterly model).
- Command-line options
- Added the possibility to declare Dynare command-line options in the `.mod`
file.
- New option `nopreprocessoroutput` to disable printing of messages from
the preprocessor.
- It is now possible to assign an arbitrary macro-expression to a
macro-variable defined on the command-line, using the `-D` syntax.
- New option `linemacro` to revert to the old format of the
macro-processed file (see below).
- Preprocessor outputs and inputs
- Added JSON output to the preprocessor. A representation of the model file
and the whole content of the `.mod` file is saved in `.json` files.
These JSON files can be easily parsed from any language (C++, Fortran,
Python, Julia, MATLAB, Octave…). This new feature opens the possibility to
develop alternative back-ends for the Dynare language.
- ⚠ Most files generated by the preprocessor are now grouped under
two subdirectories. Assuming your file is `FILENAME.mod`, then M-files
and MEX-files will be under `+FILENAME/`, while other output (JSON,
LaTeX, source code for the MEX files) will be under `FILENAME/`.
- The macro-generated output is now more readable (no more line numbers and
empty lines). The old behaviour can be restored using the `linemacro`
option (see above).
- Ability to call the preprocessor by passing the `.mod` file as a string
argument from the macOS or GNU/Linux command line.
- dseries classes
- New functionalities and efficiency improvements.
- Complete rewrite using the new `classdef` syntax and exploiting in place
modifications when possible.
- Integration of the `dates` classes within `dseries`.
- Reporting classes
- Automatically create titlepage with page numbers/page titles.
- Allow for the removal of headers and footers from a given page.
- Allow user to set page number.
- Split up report output. Create new files for the preamble, the body of
the report, and each individual page of the report.
- The classes have been converted to the new `classdef` syntax.
- Misc
- External functions can be located in MATLAB/Octave namespaces.
- Improvements to the balanced growth path test that is performed after
Dynare has detrended the model (given the trends on variables declared by
the user): the default tolerance has been raised, and a different value
can be set with new option `balanced_growth_test_tol` to the `model`
block; as a consequence, failing the test is now an error again.
- New collection of MATLAB/Octave utilities to retrieve and alter objects:
`get_irf`, `get_mean`, `get_shock_stderr_by_name`, `get_smooth`,
`get_update`, `set_shock_stderr_value`.
- ⚠ Previously, when some MEX files were missing, Dynare would
automatically fall back to slower M-file functional alternative; this is
no longer the case. It is however still possible to manually add these
alternatives in the MATLAB/Octave path (they are located under
`matlab/missing/mex`; this only applies to the `mjdgges`, `gensylv`,
`A_times_B_kronecker_C`, `sparse_hessian_times_B_kronecker_C` and
`local_state_space_iteration_2` DLLs).
Since there are a few backward-incompatible changes in this release, users may
want to have a look at the [upgrade
guide](https://git.dynare.org/Dynare/dynare/-/wikis/BreakingFeaturesIn4.6) to
adapt their existing codes.
Bugs that were present in 4.5.7 and that are fixed in 4.6.0
-----------------------------------------------------------
* Estimation: the check for stochastic singularity erroneously would only take
estimated measurement error into account.
* Estimation: if the Hessian at the mode was not positive definite, the Laplace
approximation returned a complex number, but only displayed the real-valued
part.
* Conditional Forecasting: using one period only would result in a crash.
* First-order approximation was not working with purely forward-looking models.
* The preprocessor would not allow for inline comments including macro
statements.
* Using the `STEADY_STATE()` operator on exogenous variables would lead to
crashes in stochastic simulations.
* `moment_calibration`: for autocorrelation functions, the x-axis labeling had
the wrong order.
* `plot_identification`: placement of white dots indicating infinite values was
incorrect
* Automatic detrending would sometime refuse to detrend model despite the user
having given correct trends.
* Using `use_dll` + `fast` options would not always recompile the model when
the equations were changed.
* Under certain circumstances, the combination of `bytecode` and
`stack_solve_algo=1` options could lead to crashes or wrong results.
References
----------
- Komunjer, I. and S. Ng (2011), “[Dynamic Identification of Dynamic
Stochastic General Equilibrium
Models](https://www.onlinelibrary.wiley.com/doi/abs/10.3982/ECTA8916),”
*Econometrica*, 79(6), 1995–2032
- Qu, Z. and D. Tkachenko (2012), “[Identification and frequency domain
quasi‐maximum likelihood estimation of linearized dynamic stochastic
general equilibrium
models](https://onlinelibrary.wiley.com/doi/abs/10.3982/QE126),”
*Quantitative Economics*, 3(1), 95–132
- Mutschler, W. (2015), “[Identification of DSGE models—The effect of
higher-order approximation and
pruning](https://www.sciencedirect.com/science/article/pii/S0165188915000731),”
*Journal of Economic Dynamics and Control*, 56, 34–54
Announcement for Dynare 4.5.7 (on 2019-02-06)
=============================================
......@@ -5,9 +609,7 @@ We are pleased to announce the release of Dynare 4.5.7.
This is a bugfix release.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
The Windows packages are already available for download at: <http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu LTS) should follow soon.
......@@ -41,7 +643,7 @@ fixed in version 4.5.7:
display LaTeX names.
- Parameter updating via steady state files did not correctly work in
case of using [static]/[dynamic] equation tags.
case of using `[static]`/`[dynamic]` equation tags.
- Memory leaks in `k_order_pert` (used by higher order stochastic
simulations) could lead to crashes.
......@@ -63,7 +665,7 @@ fixed in version 4.5.7:
- The model was not correctly specified when `identification` was run
without another stochastic command in the `.mod` file
(e.g. `estimation`, `stoch_simul`, etc.).
(*e.g.* `estimation`, `stoch_simul`, etc.).
- Realtime annualized shock decompositions added the wrong steady state
value.
......@@ -83,8 +685,7 @@ We are pleased to announce the release of Dynare 4.5.6.
This is a bugfix release.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu LTS) should follow soon.
......@@ -129,8 +730,7 @@ We are pleased to announce the release of Dynare 4.5.5.
This is a bugfix release.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu LTS) should follow soon.
......@@ -169,8 +769,7 @@ We are pleased to announce the release of Dynare 4.5.4.
This is a bugfix release.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu LTS) should follow soon.
......@@ -210,7 +809,7 @@ fixed in version 4.5.4:
- The `plot_shock_decomposition` command ignored various user-defined options like `fig_name`,
`use_shock_groups` or `interactive` and instead used the default options.
- Nested `@#ifdef` and `@#ifndef` statements don't work in the macroprocessor.
- Nested `@#ifdef` and `@#ifndef` statements dont work in the macroprocessor.
......@@ -223,8 +822,7 @@ This is a bugfix release. It comes less than 24 hours after the previous release
because version 4.5.2 was affected by a critical bug for MATLAB older than R2016b.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu LTS) should follow soon.
......@@ -235,7 +833,7 @@ Here is a list of the problems identified in version 4.5.2 and that have been
fixed in version 4.5.3:
- `isfile` routine was failing with matlab older than R2016b. This bug did not
- `isfile` routine was failing with MATLAB older than R2016b. This bug did not
affect Octave.
......@@ -248,8 +846,7 @@ We are pleased to announce the release of Dynare 4.5.2.
This is a bugfix release.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu LTS) should follow soon.
......@@ -327,8 +924,7 @@ We are pleased to announce the release of Dynare 4.5.1.
This is a bugfix release.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu LTS) should follow soon.
......@@ -371,8 +967,7 @@ We are pleased to announce the release of Dynare 4.5.0.
This major release adds new features and fixes various bugs.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and Debian/Ubuntu packages should follow soon.
......@@ -387,7 +982,7 @@ Here is the list of major user-visible changes:
- Ramsey policy
+ Added command `ramsey_model` that builds the expanded model with
FOC conditions for the planner's problem but doesn't perform any
FOC conditions for the planners problem but doesnt perform any
computation. Usefull to compute Ramsey policy in a perfect
foresight model,
......@@ -473,7 +1068,7 @@ Here is the list of major user-visible changes:
`consider_only_observed`, `posterior_max_subsample_draws`,
`mh_conf_sig`, `diffuse_kalman_tol`, `dirname`, `nodecomposition`
+ `load_mh_file` and `mh_recover` now try to load chain's proposal density,
+ `load_mh_file` and `mh_recover` now try to load chains proposal density,
+ New option `load_results_after_load_mh` that allows loading some
posterior results from a previous run if no new MCMC draws are
......@@ -519,11 +1114,11 @@ Here is the list of major user-visible changes:
pair allows loading the `_mh_scale.mat`-file storing the tuned
scale factor from a previous run of `mode_compute=6`,
+ New option `raftery_lewis_diagnostics` that computes Raftery/Lewis
(1992) convergence diagnostics,
+ New option `raftery_lewis_diagnostics` that computes *Raftery and Lewis
(1992)* convergence diagnostics,
+ New option `fast_kalman_filter` that provides fast Kalman filter
using Chandrasekhar recursions as described in Ed Herbst (2015),
using Chandrasekhar recursions as described in *Ed Herbst (2015)*,
+ The `dsge_var` option now saves results at the posterior mode into
`oo_.dsge_var`,
......@@ -631,7 +1226,7 @@ Here is the list of major user-visible changes:
+ New command `realtime_shock_decomposition` that for each period `T= [presample,...,nobs]`
allows computing the:
* realtime historical shock decomposition `Y(t|T)`, i.e. without observing data in `[T+1,...,nobs]`
* realtime historical shock decomposition `Y(t|T)`, *i.e.* without observing data in `[T+1,...,nobs]`
* forecast shock decomposition `Y(T+k|T)`
......@@ -684,12 +1279,12 @@ Here is the list of major user-visible changes:
- Optimization algorithms
+ `mode_compute=2` Uses the simulated annealing as described by
Corana et al. (1987),
*Corana et al. (1987)*,
+ `mode_compute=101` Uses SOLVEOPT as described by Kuntsevich and
Kappel (1997),
+ `mode_compute=101` Uses SOLVEOPT as described by *Kuntsevich and
Kappel (1997)*,
+ `mode_compute=102` Uses `simulannealbnd` from MATLAB's Global
+ `mode_compute=102` Uses `simulannealbnd` from MATLABs Global
Optimization Toolbox (if available),
+ New option `silent_optimizer` to shut off output from mode
......@@ -724,7 +1319,7 @@ Here is the list of major user-visible changes:
+ Introduces new path management to avoid conflicts with other
toolboxes,
+ Full compatibility with MATLAB 2014b's new graphic interface,
+ Full compatibility with MATLAB 2014bs new graphic interface,
+ When using `model(linear)`, Dynare automatically checks
whether the model is truly linear,
......@@ -750,7 +1345,7 @@ Here is the list of major user-visible changes:
* Bugs and problems identified in version 4.4.3 and that have been fixed in version 4.5.0:
Bugs and problems identified in version 4.4.3 and that have been fixed in version 4.5.0:
- BVAR models
......@@ -882,7 +1477,7 @@ Here is the list of major user-visible changes:
+ Option `kalman_algo=3` was broken with non-diagonal measurement error,
+ When using the diffuse Kalman filter with missing observations, an additive
factor log(2*pi) was missing in the last iteration step,
factor log(2π) was missing in the last iteration step,
+ Passing of the `MaxFunEvals` and `InitialSimplexSize` options to
`mode_compute=8` was broken,
......@@ -930,7 +1525,7 @@ Here is the list of major user-visible changes:
initialization of the MCMC erroneously crashed,
+ If the number of dropped draws via `mh_drop` coincided with the number of
draws in a `_mh'-file`, `oo_.posterior.metropolis.mean` and
draws in a `_mh`-file, `oo_.posterior.metropolis.mean` and
`oo_.posterior.metropolis.Variance` were NaN.
......@@ -1113,7 +1708,7 @@ Here is the list of major user-visible changes:
error code, but not an conformable-sized steady state vector.
- Due to a bug in `mjdgges.mex` unstable parameter draws with
eigenvalues up to 1+1e-6 could be accepted as stable for the
eigenvalues up to 1+10⁻⁶ could be accepted as stable for the
purpose of the Blanchard-Kahn conditions, even if `qz_criterium<1`.
- The `use_dll` option on Octave for Windows required to pass a
......@@ -1163,8 +1758,7 @@ We are pleased to announce the release of Dynare 4.4.3.
This is a bugfix release.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu LTS) should follow soon.
......@@ -1177,11 +1771,11 @@ fixed in version 4.4.3:
- When loading a dataset in XLS, XLSX or CSV format, the first
observation was discarded.
- Reading data in an Excel-file with only one variable wasz leading
- Reading data in an Excel-file with only one variable was leading
to a crash.
- When using the k_order_perturbation option (which is implicit at
3rd order) without the use_dll option, crashes or unexpected
- When using the `k_order_perturbation` option (which is implicit at
3rd order) without the `use_dll` option, crashes or unexpected
behavior could happen if some 2nd or 3rd derivative evaluates to
zero (while not being symbolically zero)
......@@ -1189,7 +1783,7 @@ fixed in version 4.4.3:
wrong results.
- For Ramsey policy, the equation numbers associated with the
Lagrange multipliers stored in M_.aux_vars were erroneously one too
Lagrange multipliers stored in `M_.aux_vars` were erroneously one too
low
- When updating deep parameters in the steady state file, the changes
......@@ -1200,26 +1794,26 @@ fixed in version 4.4.3:
results were returned (if second order derivates of the external
functions were needed).
- The confidence level for computations in estimation, conf_sig could
not be changed and was fixed at 0.9. The new option mh_conf_sig is
- The confidence level for computations in estimation, `conf_sig` could
not be changed and was fixed at 0.9. The new option `mh_conf_sig` is
now used to set this interval
- Conditional forecasts with non-diagonal covariance matrix used an
incorrect decomposition of the covariance matrix. A Cholesky
factorization is used.
- Option geweke_interval was not effective, Dynare always defaulted
- Option `geweke_interval` was not effective, Dynare always defaulted
to the standard value.
- The mode_file option lacked backward compatibility with older
- The `mode_file` option lacked backward compatibility with older
Dynare versions.
- Loading an mh_mode file with the mode_file option was broken.
- Loading an `mh_mode` file with the `mode_file` option was broken.
- Using identification with var_exo_det leaded to crashes (the
- Using `identification` with `var_exo_det` leaded to crashes (the
preprocessor now returns an error if they are used simultaneously)
- The identification command did not print results if the initial
- The `identification` command did not print results if the initial
parameter set was invalid and then crashed later on if the MC
sample is bigger than 1
......@@ -1228,8 +1822,8 @@ fixed in version 4.4.3:
- The use of external functions crashed the preprocessor when the
derivatives of the external function are explicitly called in the
model block. The preprocessor now forbids the use of external
functions derivates in the model block.
`model` block. The preprocessor now forbids the use of external
functions derivates in the `model` block.
- Using the block option when a variable does not appear in the
current period crashed Dynare instead of providing an error
......@@ -1244,8 +1838,7 @@ We are pleased to announce the release of Dynare 4.4.2.
This is a bugfix release.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu LTS) should follow soon.
......@@ -1255,20 +1848,20 @@ and with GNU Octave versions 3.6 to 3.8.
Here is a list of the problems identified in version 4.4.1 and that have been
fixed in version 4.4.2:
- Geweke convergence diagnostics was computed on the wrong sample if `mh_drop'
- Geweke convergence diagnostics was computed on the wrong sample if `mh_drop`
was not equal to the default of 0.5.
- The `loglinear' option of `stoch_simul' was displaying the steady state of
- The `loglinear` option of `stoch_simul` was displaying the steady state of
the original values, not the logged ones, and was producing incorrect
simulations and simulated moments. Theoretical moments were unaffected.
- The `optim' option of `estimation (for setting options to `mode_compute')
- The `optim` option of `estimation` (for setting options to `mode_compute`)
was only working with at least MATLAB 8.1 (R2013a) or Octave 3.8.
- For unit root models, theoretical HP filtered moments were sometimes
erroneously displayed as NaN.
- Specifying an endogenous variable twice after the `estimation' command would
- Specifying an endogenous variable twice after the `estimation` command would
lead to a crash in the computation of moments.
- Deterministic simulations were crashing on some models with more than one
......@@ -1278,9 +1871,9 @@ fixed in version 4.4.2:
working correctly (during the homotopy steps the perfect foresight model
solver was called instead of the stochastic perfect foresight model solver).
- MCMC convergence diagnostics were not computed if `mh_replic' was less than
- MCMC convergence diagnostics were not computed if `mh_replic` was less than
2000; the test now relies on the total number of iterations (this only makes
a difference if option `load_mh_file' is used).
a difference if option `load_mh_file` is used).
Announcement for Dynare 4.4.1 (on 2014-01-17)
......@@ -1292,8 +1885,7 @@ This release contains a few changes to the user interface and fixes various
bugs. It also adds compatibility with Octave 3.8.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu) should follow soon.
......@@ -1307,16 +1899,16 @@ with GNU Octave versions 3.6 to 3.8.
- The syntax introduced in 4.4.0 for conditional forecast in a deterministic
setup was removed, and replaced by a new one that is better suited to the
task. More precisely, such deterministic forecasts are no longer done using
the `conditional_forecast' command. The latter is replaced by a group of
commands: `init_plan', `basic_plan' and `flip_plan'. See the reference
the `conditional_forecast` command. The latter is replaced by a group of
commands: `init_plan`, `basic_plan` and `flip_plan`. See the reference
manual for more details.
- Changes to the reporting module: option `annualAverages' to `addTable' has
been removed (use option `tableDataRhs' to `addSeries' instead); option
`vlineAfter' to `addTable' now also accepts a cell array.
- Changes to the reporting module: option `annualAverages` to `addTable` has
been removed (use option `tableDataRhs` to `addSeries` instead); option
`vlineAfter` to `addTable` now also accepts a cell array.
- Changes to the date and time series classes: implement broadcasting for
operations (+,-,* and /) between `dseries' class and scalar or vectors; add
operations (`+`,`-`,`*` and `/`) between `dseries` class and scalar or vectors; add
the possibility of selecting an observation within a time series using a
formatted string containing a date.
......@@ -1338,8 +1930,7 @@ We are pleased to announce the release of Dynare 4.4.0.
This major release adds new features and fixes various bugs.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and Debian/Ubuntu packages should follow soon.
......@@ -1354,56 +1945,56 @@ Here is the list of major user-visible changes:
* New major algorithms:
- Extended path at order 1 and above, also known as “stochastic extended
path”. This method is triggered by setting the `order' option of the
`extended_path' command to a value greater than 0. Dynare will then use a
path”. This method is triggered by setting the `order` option of the
`extended_path` command to a value greater than 0. Dynare will then use a
Gaussian quadrature to take into account the effects of future uncertainty.
The time series for the endogenous variables are generated by assuming that
the agents believe that there will no more shocks after period t+order.
- Alternative algorithms for computing decision rules of a stochastic model,
based on the cycle reduction and logarithmic reduction algorithms. These
methods are respectively triggered by giving `dr = cycle_reduction' or 'dr
= logarithmic_reduction' as an option to the `stoch_simul' command.
methods are respectively triggered by giving `dr = cycle_reduction` or `dr
= logarithmic_reduction` as an option to the `stoch_simul` command.
- Pruning now works with 3rd order approximation, along the lines of
Andreasen, Fernández-Villaverde and Rubio-Ramírez (2013).
*Andreasen, Fernández-Villaverde and Rubio-Ramirez (2013)*.
- Computation of conditional forecast using an extended path method. This is
triggered by the new option `simulation_type = deterministic' in the
`conditional_forecast' command. In this case, the `expectation' command in
the `conditional_forecast_paths' block has to be used to indicate the nature
triggered by the new option `simulation_type = deterministic` in the
`conditional_forecast` command. In this case, the `expectation` command in
the `conditional_forecast_paths` block has to be used to indicate the nature
of expectations (whether shocks are a surprise or are perfectly
anticipated).
- Endogenous priors as in Christiano, Trabandt and Walentin (2011). Those are
triggered by the new option `endogenous_prior' of the `estimation' command.
triggered by the new option `endogenous_prior` of the `estimation` command.
* Other algorithmic improvements:
- New command `model_diagnostics' to perform various sanity checks on the
- New command `model_diagnostics` to perform various sanity checks on the
model. Note: in the past, some users may have used a preliminary MATLAB
function implementing this; the new command has the same syntax, except that
you shouldn't pass any argument to it.
you shouldnt pass any argument to it.
- Terminal conditions of perfect foresight simulations can now be specified in
growth rates. More specifically, the new option `differentiate_forward_vars'
of the `model' block will create auxiliary forward looking variables
growth rates. More specifically, the new option `differentiate_forward_vars`
of the `model` block will create auxiliary forward looking variables
expressed in first differences or growth rates of the actual forward looking
variables defined in the model. These new variables have obvious zero
terminal conditions whatever the simulation context and this in many cases
helps convergence of simulations.
- Convergence diagnostics for single chain MCMC à la Geweke (1992, 1999).
- Convergence diagnostics for single chain MCMC à la *Geweke (1992, 1999)*.
- New optimizer for the posterior mode (triggered by `mode_compute=10'): it
- New optimizer for the posterior mode (triggered by `mode_compute=10`): it
uses the simpsa algorithm, based on the combination of the non-linear
simplex and simulated annealing algorithms and proposed by Cardoso, Salcedo
and Feyo de Azevedo (1996).
simplex and simulated annealing algorithms and proposed by *Cardoso, Salcedo
and Feyo de Azevedo (1996)*.
- The automatic detrending engine has been extended to work on models written
in logs. The corresponding trend variable type is `log_trend_var', and the
corresponding deflator type is `log_deflator'.
in logs. The corresponding trend variable type is `log_trend_var`, and the
corresponding deflator type is `log_deflator`.
* New features in the user interface:
......@@ -1417,82 +2008,82 @@ Here is the list of major user-visible changes:
- Datafiles in CSV format can now be used for estimation.
- New macro processor `length' operator, returns the length of an array.
- New macro processor `length` operator, returns the length of an array.
- New option `all_values_required' of `initval' and `endval' blocks: enforces
- New option `all_values_required` of `initval` and `endval` blocks: enforces
initialization of all endogenous and exogenous variables within the block.
- Option `ar' can now be given to the `estimation' command.
- Option `ar` can now be given to the `estimation` command.
- New options `nograph', `nointeractive' and `nowarn' to the `dynare' command,
- New options `nograph`, `nointeractive` and `nowarn` to the `dynare` command,
for a better control of what is displayed.
- New option `nostrict' to the `dynare' command, for allowing Dynare to
- New option `nostrict` to the `dynare` command, for allowing Dynare to
continue processing when there are more endogenous variables than equations
or when an undeclared symbol is assigned in `initval' or `endval'.
or when an undeclared symbol is assigned in `initval` or `endval`.
- The information on MCMC acceptance rates, seeds, last log posterior
likelihood, and last parameter draw are now saved on the disk and can
be displayed with `internals --display-mh-history' or loaded into the
workspace with `internals --load-mh-history'.
be displayed with `internals --display-mh-history` or loaded into the
workspace with `internals --load-mh-history`.
- New options `mode_check_neighbourhood_size', `mode_check_symmetric_plots'
and `mode_check_number_of_points', for a better control of the diagnostic
- New options `mode_check_neighbourhood_size`, `mode_check_symmetric_plots`
and `mode_check_number_of_points`, for a better control of the diagnostic
plots.
- New option `parallel_local_files' of `model' block, for transferring extra
- New option `parallel_local_files` of `model` block, for transferring extra
files during parallel computations.
- New option `clock' of `set_dynare_seed', for setting a different seed at
- New option `clock` of `set_dynare_seed`, for setting a different seed at
each run.
- New option `qz_zero_threshold' of the `check', `stoch_simul' and
`estimation' commands, for a better control of the situation where a
- New option `qz_zero_threshold` of the `check`, `stoch_simul` and
`estimation` commands, for a better control of the situation where a
generalized eigenvalue is close to 0/0.
- New `verbatim' block for inclusion of text that should pass through the
preprocessor and be placed as is in the `modfile.m' file.
- New `verbatim` block for inclusion of text that should pass through the
preprocessor and be placed as is in the `modfile.m` file.
- New option `mcmc_jumping_covariance' of the `estimation' command, for a
- New option `mcmc_jumping_covariance` of the `estimation` command, for a
better control of the covariance matrix used for the proposal density of the
MCMC sampler.
- New option `use_calibration' of the `estimated_params_init', for using the
- New option `use_calibration` of the `estimated_params_init`, for using the
calibration of deep parameters and the elements of the covariance matrix
specified in the `shocks' block as starting values for the estimation.
specified in the `shocks` block as starting values for the estimation.
- New option `save_draws' of the `ms_simulation' command.
- New option `save_draws` of the `ms_simulation` command.
- New option `irf_plot_threshold' of the `stoch_simul' and `estimation'
- New option `irf_plot_threshold` of the `stoch_simul` and `estimation`
commands, for a better control of the display of IRFs which are almost nil.
- New option `long_name' for endogenous, exogenous and parameter declarations,
- New option `long_name` for endogenous, exogenous and parameter declarations,
which can be used to declare a long name for variables. That long name can
be programmatically retrieved in `M_.endo_names_long'.
be programmatically retrieved in `M_.endo_names_long`.
* Miscellaneous changes
- The deciles of some posterior moments were erroneously saved in a field
`Distribution' under `oo_'. This field is now called `deciles', for
`Distribution` under `oo_`. This field is now called `deciles`, for
consistency with other posterior moments and with the manual. Similarly, the
fields `Mean', `Median', `HPDsup', `HPDinf', and `Variance' are now
fields `Mean`, `Median`, `HPDsup`, `HPDinf`, and `Variance` are now
consistently capitalized.
- The console mode now implies the `nodisplay' option.
- The console mode now implies the `nodisplay` option.
* Bugs and problems identified in version 4.3.3 and that have been fixed in
version 4.4.0:
- In an `endval' block, auxiliary variables were not given the right value.
- In an `endval` block, auxiliary variables were not given the right value.
This would not result in wrong results, but could prevent convergence of
the steady state computation.
- Deterministic simulations with `stack_solve_algo=0' (the default value) were
- Deterministic simulations with `stack_solve_algo=0` (the default value) were
crashing if some exogenous had a lag strictly greater than 1.
- When using the `mode_file' option, the initial estimation checks were not
- When using the `mode_file` option, the initial estimation checks were not
performed for the loaded mode, but for the original starting values. Thus,
potential prior violations by the mode only appeared during estimation,
leading to potentially cryptic crashes and error messages.
......@@ -1504,10 +2095,10 @@ Here is the list of major user-visible changes:
- In the presence of calibrated covariances, estimation did not enforce
positive definiteness of the covariance matrix.
- Estimation using the `diffuse_filter' option together with the univariate
- Estimation using the `diffuse_filter` option together with the univariate
Kalman filter and a diagonal measurement error matrix was broken.
- A purely backward model with `k_order_solver' was leading to crashes of
- A purely backward model with `k_order_solver` was leading to crashes of
MATLAB/Octave.
- Non-linear estimation was not skipping the specified presample when
......@@ -1519,28 +2110,28 @@ Here is the list of major user-visible changes:
- Simulated moments with constant variables was leading to crashes when
displaying autocorrelations.
- The `osr' command was sometimes crashing with cryptic error messages because
- The `osr` command was sometimes crashing with cryptic error messages because
of some unaccounted error codes returned from a deeper routine.
- The check for stochastic singularity during initial estimation checks was
broken.
- Recursive estimation starting with the pathological case of `nobs=1' was
- Recursive estimation starting with the pathological case of `nobs=1` was
crashing.
- Conditional variance decomposition within or after estimation was crashing
when at least one shock had been calibrated to zero variance.
- The `estimated_params_init' and `estimated_params_bounds' blocks were broken
- The `estimated_params_init` and `estimated_params_bounds` blocks were broken
for correlations.
- The `filter_step_ahead' option was not producing any output in Bayesian
- The `filter_step_ahead` option was not producing any output in Bayesian
estimation.
- Deterministic simulations were sometimes erroneously indicating convergence
although the residuals were actually NaN or Inf.
- Supplying a user function in the `mode_compute' option was leading to
- Supplying a user function in the `mode_compute` option was leading to
a crash.
- Deterministic simulation of models without any exogenous variable was
......@@ -1548,34 +2139,34 @@ Here is the list of major user-visible changes:
- The MS-SBVAR code was not updating files between runs on Windows. This means
that if a MOD file was updated between runs in the same folder and a
`file_tag' was not changed, then the results would not change.
`file_tag` was not changed, then the results would not change.
- The `ramsey_policy' command was not putting in `oo_.planner_objective_value'
- The `ramsey_policy` command was not putting in `oo_.planner_objective_value`
the value of the planner objective at the optimum.
* References:
- Andreasen, Martin M., Jesús Fernández-Villaverde, and Juan Rubio-Ramírez
- Andreasen, Martin M., Jesús Fernández-Villaverde, and Juan Rubio-Ramirez
(2013): “The Pruned State-Space System for Non-Linear DSGE Models: Theory
and Empirical Applications,” NBER Working Paper, 18983
and Empirical Applications,” *NBER Working Paper*, 18983
- Cardoso, Margarida F., R. L. Salcedo and S. Feyo de Azevedo (1996): “The
simplex simulated annealing approach to continuous non-linear optimization,”
Computers chem. Engng, 20(9), 1065-1080
*Computers chem. Engng*, 20(9), 1065-1080
- Christiano, Lawrence J., Mathias Trabandt and Karl Walentin (2011):
“Introducing financial frictions and unemployment into a small open economy
model,” Journal of Economic Dynamics and Control, 35(12), 1999-2041
model,” *Journal of Economic Dynamics and Control*, 35(12), 1999-2041
- Geweke, John (1992): “Evaluating the accuracy of sampling-based approaches
to the calculation of posterior moments,” in J.O. Berger, J.M. Bernardo,
A.P. Dawid, and A.F.M. Smith (eds.) Proceedings of the Fourth Valencia
International Meeting on Bayesian Statistics, pp. 169-194, Oxford University
A.P. Dawid, and A.F.M. Smith (eds.) *Proceedings of the Fourth Valencia
International Meeting on Bayesian Statistics*, pp. 169-194, Oxford University
Press
- Geweke, John (1999): “Using simulation methods for Bayesian econometric
models: Inference, development and communication,” Econometric Reviews,
models: Inference, development and communication,” *Econometric Reviews*,
18(1), 1-73
......@@ -1587,8 +2178,7 @@ We are pleased to announce the release of Dynare 4.3.3.
This is a bugfix release.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu) should follow soon.
......@@ -1603,30 +2193,30 @@ fixed in version 4.3.3:
- Estimation with measurement errors was wrong if a correlation between two
measurement errors was calibrated
- Option `use_dll' was broken under Windows
- Option `use_dll` was broken under Windows
- Degenerate case of purely static models (no leads/no lags) were not
correctly handled
- Deterministic simulations over a single period were not correctly done
- The sensitivity call `dynare_sensitivity(identification=1,morris=2)' was
- The sensitivity call `dynare_sensitivity(identification=1,morris=2)` was
buggy when there are no shocks estimated
- Calls to `shock_decomposition' after using `selected_variables_only' option
- Calls to `shock_decomposition` after using `selected_variables_only` option
fail
- Sometimes, only the last open graph was saved, leading to missing and
duplicate EPS/PDF graphs
- Forecasting after maximum likelihood estimation when not forecasting at
least one observed variables (`var_obs') was leading to crashes
least one observed variables (`var_obs`) was leading to crashes
- Some functionalities were crashing with MATLAB 8.1/R2013a (bytecode,
MS-SBVAR)
- Sometimes only the first order autocorrelation of `moments_varendo' was
saved instead of all up to the value of `ar' option
- Sometimes only the first order autocorrelation of `moments_varendo` was
saved instead of all up to the value of `ar` option
Announcement for Dynare 4.3.2 (on 2013-01-18)
......@@ -1637,8 +2227,7 @@ We are pleased to announce the release of Dynare 4.3.2.
This is a bugfix release.
The Windows packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The Mac and GNU/Linux packages (for Debian and Ubuntu) should follow soon.
......@@ -1653,17 +2242,17 @@ fixed in version 4.3.2:
- Computation of posterior distribution of unconditional variance
decomposition was sometimes crashing (only for very large models)
- Estimation with `mode_compute=6' was sometimes crashing
- Estimation with `mode_compute=6` was sometimes crashing
- Derivative of erf() function was incorrect
- Derivative of `erf()` function was incorrect
- The `check' command was not setting `oo_.dr.eigval' unless `stoch_simul' was
- The `check` command was not setting `oo_.dr.eigval` unless `stoch_simul` was
also used
- Computation of conditional forecast when the constraint is only on
one period was buggy
- Estimation with `mode_compute=3' was crashing under Octave
- Estimation with `mode_compute=3` was crashing under Octave
Announcement for Dynare 4.3.1 (on 2012-10-10)
......@@ -1673,8 +2262,7 @@ We are pleased to announce the release of Dynare 4.3.1. This release adds a few
minor features and fixes various bugs.
The Windows and Mac packages are already available for download at:
http://www.dynare.org/download/dynare-stable
<http://www.dynare.org/download/dynare-stable>.
The GNU/Linux packages (for Debian and Ubuntu) should follow soon.
......@@ -1688,13 +2276,13 @@ Here is the list of the main user-visible changes:
* New features in the user interface:
- New `@#ifndef' directive in the macro-processor
- New `@#ifndef` directive in the macro-processor
- Possibility of simultaneously specifying several output formats in the
`graph_format' option
`graph_format` option
- Support for XLSX files in `datafile' option of `estimation' and in
`initval_file'
- Support for XLSX files in `datafile` option of `estimation` and in
`initval_file`
* Bugs and problems identified in version 4.3.0 and that have been fixed in
......@@ -1702,34 +2290,34 @@ Here is the list of the main user-visible changes:
- Shock decomposition was broken
- The welfare computation with `ramsey_policy' was buggy when used in
conjunction with `histval'
- The welfare computation with `ramsey_policy` was buggy when used in
conjunction with `histval`
- Estimation of models with both missing observations and measurement errors
was buggy
- The option `simul_replic' was broken
- The option `simul_replic` was broken
- The macro-processor directive `@#ifdef' was broken
- The macro-processor directive `@#ifdef` was broken
- Identification with `max_dim_cova_group > 1' was broken for specially
- Identification with `max_dim_cova_group > 1` was broken for specially
degenerate models (when parameter theta has pairwise collinearity of one
with multiple other parameters, i.e. when all couples (theta,b), (theta,c),
... (theta,d) have perfect collinearity in the Jacobian of the model)
with multiple other parameters, *i.e.* when all couples (θ,b), (θ,c),
… (θ,d) have perfect collinearity in the Jacobian of the model)
- The `parallel_test' option was broken
- The `parallel_test` option was broken
- Estimation with correlated shocks was broken when the correlations were
specified in terms of correlation and not in terms of co-variance
- The Windows package was broken with MATLAB 7.1 and 7.2
- When using `mode_compute=0' with a mode file generated using
`mode_compute=6', the value of option `mh_jscale' was not loaded
- When using `mode_compute=0` with a mode file generated using
`mode_compute=6`, the value of option `mh_jscale` was not loaded
- Using exogenous deterministic variables at 2nd order was causing a crash
- The option `no_create_init' for the `ms_estimation' command was broken
- The option `no_create_init` for the `ms_estimation` command was broken
- Loading of datafiles with explicit filename extensions was not working
......@@ -1744,8 +2332,7 @@ We are pleased to announce the release of Dynare 4.3.0. This major release adds
new features and fixes various bugs.
The Windows and Mac packages are already available for download at:
http://www.dynare.org/download/dynare-4.3
<http://www.dynare.org/download/dynare-4.3>.
The GNU/Linux packages should follow soon.
......@@ -1760,159 +2347,159 @@ Here is the list of the main user-visible changes:
* New major algorithms:
- Nonlinear estimation with a particle filter based on a second order
approximation of the model, as in Fernández-Villaverde and Rubio-Ramírez
(2005); this is triggered by setting `order=2' in the `estimation' command
approximation of the model, as in *Fernández-Villaverde and Rubio-Ramirez
(2005)*; this is triggered by setting `order=2` in the `estimation` command
- Extended path solution method as in Fair and Taylor (1983); see the
`extended_path' command
- Extended path solution method as in *Fair and Taylor (1983)*; see the
`extended_path` command
- Support for Markov-Switching Structural Bayesian VARs (MS-SBVAR) along the
lines of Sims, Waggoner and Zha (2008) (see the dedicated section in the
lines of *Sims, Waggoner and Zha (2008)* (see the dedicated section in the
reference manual)
- Optimal policy under discretion along the lines of Dennis (2007); see the
`discretionary_policy' command
- Optimal policy under discretion along the lines of *Dennis (2007)*; see the
`discretionary_policy` command
- Identification analysis along the lines of Iskrev (2010); see the
`identification' command
- Identification analysis along the lines of *Iskrev (2010)*; see the
`identification` command
- The Global Sensitivity Analysis toolbox (Ratto, 2008) is now part of the
- The Global Sensitivity Analysis toolbox (*Ratto, 2008*) is now part of the
official Dynare distribution
* Other algorithmic improvements:
- Stochastic simulation and estimation can benefit from block decomposition
(with the `block' option of `model'; only at 1st order)
(with the `block` option of `model`; only at 1st order)
- Possibility of running smoother and filter on a calibrated model; see the
`calib_smoother' command
`calib_smoother` command
- Possibility of doing conditional forecast on a calibrated model; see the
`parameter_set=calibration' option of the `conditional_forecast' command
`parameter_set=calibration` option of the `conditional_forecast` command
- The default algorithm for deterministic simulations has changed and is now
based on sparse matrices; the historical algorithm (Laffargue, Boucekkine
and Juillard) is still available under the `stack_solve_algo=6'option of the
`simul' command
based on sparse matrices; the historical algorithm (*Laffargue, Boucekkine
and Juillard*) is still available under the `stack_solve_algo=6` option of the
`simul` command
- Possibility of using an analytic gradient for the estimation; see the
`analytic_derivation' option of the `estimation' command
`analytic_derivation` option of the `estimation` command
- Implementation of the Nelder-Mead simplex based optimization routine for
computing the posterior mode; available under the `mode_compute=8' option of
the `estimation' command
computing the posterior mode; available under the `mode_compute=8` option of
the `estimation` command
- Implementation of the CMA Evolution Strategy algorithm for computing the
posterior mode; available under the `mode_compute=9' option of the
`estimation' command
posterior mode; available under the `mode_compute=9` option of the
`estimation` command
- New solvers for Lyapunov equations which can accelerate the estimation of
large models; see the `lyapunov' option of the `estimation' command
large models; see the `lyapunov` option of the `estimation` command
- New solvers for Sylvester equations which can accelerate the resolution of
large models with block decomposition; see the `sylvester' option of the
`stoch_simul' and `estimation' commands
large models with block decomposition; see the `sylvester` option of the
`stoch_simul` and `estimation` commands
- The `ramsey_policy' command now displays the planner objective value
function under Ramsey policy and stores it in `oo_.planner_objective_value'
- The `ramsey_policy` command now displays the planner objective value
function under Ramsey policy and stores it in `oo_.planner_objective_value`
- Theoretical autocovariances are now computed when the `block' option is
- Theoretical autocovariances are now computed when the `block` option is
present
- The `linear' option is now compatible with the `block' and `bytecode'
- The `linear` option is now compatible with the `block` and `bytecode`
options
- The `loglinear' option now works with purely backward or forward models at
- The `loglinear` option now works with purely backward or forward models at
first order
* New features in the user interface:
- New mathematical primitives allowed in model block: `abs()', `sign()'
- New mathematical primitives allowed in model block: `abs()`, `sign()`
- The behavior with respect to graphs has changed:
+ By default, Dynare now displays graphs and saves them to disk in EPS
format only
+ The format can be changed to PDF or FIG with the new `graph_format'
+ The format can be changed to PDF or FIG with the new `graph_format`
option
+ It is possible to save graphs to disk without displaying them with the
new `nodisplay' option
new `nodisplay` option
- New `nocheck' option to the `steady' command: tells not to check the steady
- New `nocheck` option to the `steady` command: tells not to check the steady
state and accept values given by the user (useful for models with unit
roots)
- A series of deterministic shocks can be passed as a pre-defined vector in
the `values' statement of a `shocks' block
the `values` statement of a `shocks` block
- New option `sub_draws' in the `estimation' command for controlling the
- New option `sub_draws` in the `estimation` command for controlling the
number of draws used in computing the posterior distributions of various
objects
- New macroprocessor command `@#ifdef' for testing if a macro-variable is
- New macroprocessor command `@#ifdef` for testing if a macro-variable is
defined
- New option `irf_shocks' of the `stoch_simul' command, to allow IRFs to be
- New option `irf_shocks` of the `stoch_simul` command, to allow IRFs to be
created only for certain exogenous variables
- In the parallel engine, possibility of assigning different weights to nodes
in the cluster and of creating clusters comprised of nodes with different
operating systems (see the relevant section in the reference manual)
- It is now possible to redefine a parameter in the `steady_state_model' block
- It is now possible to redefine a parameter in the `steady_state_model` block
(use with caution)
- New option `maxit' in the `simul' and `steady' commands to determine the
- New option `maxit` in the `simul` and `steady` commands to determine the
maximum number of iterations of the nonlinear solver
- New option `homotopy_force_continue' in the `steady' command to control the
- New option `homotopy_force_continue` in the `steady` command to control the
behavior when a homotopy fails
- Possibility of globally altering the defaults of options by providing a file
in the `GlobalInitFile' field of the configuration file (use with caution)
in the `GlobalInitFile` field of the configuration file (use with caution)
- New option `nolog' to the `dynare' command line to avoid creating a logfile
- New option `nolog` to the `dynare` command line to avoid creating a logfile
- New option `-D' to the `dynare' command line with for defining
- New option `-D` to the `dynare` command line with for defining
macro-variables
* Miscellaneous changes:
- The `use_dll' option of `model' now creates a MEX file for the static model
- The `use_dll` option of `model` now creates a MEX file for the static model
in addition to that for the dynamic model
- The `unit_root_vars' command is now obsolete; use the `diffuse_filter'
option of the `estimation' command instead
- The `unit_root_vars` command is now obsolete; use the `diffuse_filter`
option of the `estimation` command instead
- New option `--burn' to Dynare++ to discard initial simulation points
- New option `--burn` to Dynare++ to discard initial simulation points
- New top-level MATLAB/Octave command `internals' for internal documentation
- New top-level MATLAB/Octave command `internals` for internal documentation
and unitary tests
* Bugs and problems identified in version 4.2.5 and that have been fixed in
version 4.3.0:
- Backward models with the `loglinear' option were incorrectly handled
- Backward models with the `loglinear` option were incorrectly handled
- Solving for hyperparameters of inverse gamma priors was sometimes crashing
- The deterministic solver for purely forward models was broken
- When running `estimation' or `identification' on models with non-diagonal
- When running `estimation` or `identification` on models with non-diagonal
structural error covariance matrices, while not simultaneously estimating
the correlation between shocks (i.e. calibrating the correlation), the
the correlation between shocks (*i.e.* calibrating the correlation), the
off-diagonal elements were incorrectly handled or crashes were occuring
- When using the `prefilter' option, smoother plots were omitting the smoothed
- When using the `prefilter` option, smoother plots were omitting the smoothed
observables
- In the rare case of entering and expression x as x^(alpha-1) with x being 0
- In the rare case of entering and expression `x` as `x^(alpha-1)` with `x` being 0
in steady state and alpha being a parameter equal to 2, the Jacobian was
evaluating to 0 instead of 1
......@@ -1923,25 +2510,25 @@ Here is the list of the main user-visible changes:
* References:
- Dennis, Richard (2007): “Optimal Policy In Rational Expectations Models: New
Solution Algorithms,” Macroeconomic Dynamics, 11(1), 31–55
Solution Algorithms,” *Macroeconomic Dynamics*, 11(1), 31–55
- Fair, Ray and John Taylor (1983): “Solution and Maximum Likelihood
Estimation of Dynamic Nonlinear Rational Expectation Models,” Econometrica,
Estimation of Dynamic Nonlinear Rational Expectation Models,” *Econometrica*,
51, 1169–1185
- Fernández-Villaverde, Jesús and Juan Rubio-Ramírez (2005): “Estimating
Dynamic Equilibrium Economies: Linear versus Nonlinear Likelihood,” Journal
of Applied Econometrics, 20, 891–910
- Fernández-Villaverde, Jesús and Juan Rubio-Ramirez (2005): “Estimating
Dynamic Equilibrium Economies: Linear versus Nonlinear Likelihood,” *Journal
of Applied Econometrics*, 20, 891–910
- 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
- Ratto, Marco (2008): “Analysing DSGE models with global sensitivity
analysis'', Computational Economics, 31, 115–139
analysis,” *Computational Economics*, 31, 115–139
- Sims, Christopher A., Daniel F. Waggoner and Tao Zha (2008): “Methods for
inference in large multiple-equation Markov-switching models,” Journal of
Econometrics, 146, 255–274
inference in large multiple-equation Markov-switching models,” *Journal of
Econometrics*, 146, 255–274
......@@ -1963,8 +2550,7 @@ The new release is compatible with MATLAB versions ranging from 7.0 (R14) to
Note that GNU Octave users under Windows will have to upgrade to GNU Octave
version 3.6.1 (MinGW). The Octave installer can be downloaded at:
http://www.dynare.org/octave/Octave3.6.1_gcc4.6.2_20120303-setup.exe
<http://www.dynare.org/octave/Octave3.6.1_gcc4.6.2_20120303-setup.exe>.
Here is a non-exhaustive list of the problems identified in version 4.2.4 and
that have been fixed in version 4.2.5:
......@@ -1995,7 +2581,7 @@ This is a bugfix release. It comes only a few days after the previous release,
because version 4.2.3 was affected by a critical bug (see below).
The Windows package for the new release is already available for download at
the official Dynare website <http://www.dynare.org>. The Mac and Linux packages
the official [Dynare website](http://www.dynare.org). The Mac and Linux packages
should follow soon.
All users are strongly encouraged to upgrade, especially those who have
......@@ -2013,7 +2599,7 @@ fixed in version 4.2.4:
* Bayesian priors with inverse gamma distribution and very small variances
were giving incorrect results in some cases
* The `model_diagnostics' command was broken
* The `model_diagnostics` command was broken
Announcement for Dynare 4.2.3 (on 2011-11-30)
......@@ -2024,7 +2610,7 @@ We are pleased to announce the release of Dynare 4.2.3.
This is a bugfix release.
The Windows package is already available for download at the official
Dynare website <http://www.dynare.org>. The Mac and Linux packages
[Dynare website](http://www.dynare.org). The Mac and Linux packages
should follow soon.
All users are strongly encouraged to upgrade.
......@@ -2035,23 +2621,23 @@ to 7.13 (R2011b) and with GNU Octave versions ranging from 3.0 to 3.4.
Here is a non-exhaustive list of the problems identified in version 4.2.2 and
that have been fixed in version 4.2.3:
* `steady_state_model' was broken for lags higher than 2
* `steady_state_model` was broken for lags higher than 2
* `simult_.m' was not working correctly with `order=3' if `k_order_solver' had
* `simult_.m` was not working correctly with `order=3` if `k_order_solver` had
not been explicitly specified
* `stoch_simul' with `order=3' and without `periods' option was reporting
* `stoch_simul` with `order=3` and without `periods` option was reporting
dummy theoretical moments
* Under Octave, option `solve_algo=0' was causing crashes in `check' and
`stoch_simul'
* Under Octave, option `solve_algo=0` was causing crashes in `check` and
`stoch_simul`
* Identification module was broken
* The test for singularity in the model reporting eigenvalues close to 0/0 was
sometimes reporting false positives
* The `conditional_variance_decomposition' option was not working if one
* The `conditional_variance_decomposition` option was not working if one
period index was 0. Now, Dynare reports an error if the periods are not
strictly positive.
......@@ -2067,7 +2653,7 @@ We are pleased to announce the release of Dynare 4.2.2.
This is a bugfix release.
The Windows package is already available for download at the official
Dynare website <http://www.dynare.org>. The Mac and Linux packages
[Dynare website](http://www.dynare.org). The Mac and Linux packages
should follow soon.
All users are strongly encouraged to upgrade.
......@@ -2088,31 +2674,31 @@ been fixed in version 4.2.2:
slightly different in future releases (thanks to Marek Jarociński for
spotting this)
* The `conditional_forecast' command was buggy: it was always using the
posterior mode, whatever the value of the `parameter_set' option
* The `conditional_forecast` command was buggy: it was always using the
posterior mode, whatever the value of the `parameter_set` option
* `STEADY_STATE' was not working correctly with certain types of
* `STEADY_STATE` was not working correctly with certain types of
expressions (the priority of the addition and substraction operators
was incorrectly handled)
* With the `block' option of `model', the preprocessor was failing on
expressions of the form "a^b" (with no endogenous in "a" but an
endogenous in "b")
* With the `block` option of `model`, the preprocessor was failing on
expressions of the form `a^b` (with no endogenous in `a` but an
endogenous in `b`)
* Some native MATLAB statements were not correctly passed on to MATLAB
(e.g. x = { 'foo' 'bar' } )
(*e.g.* `x = { 'foo' 'bar' }` )
* `external_function' was crashing in some circumstances
* `external_function` was crashing in some circumstances
* The lambda parameter for HP filter was restricted to integer values
for no good reason
* The `load_mh_file' option of `estimation' was crashing under Octave
* The `load_mh_file` option of `estimation` was crashing under Octave
for Windows (MinGW version)
* Computation of steady state was failing on model contains auxiliary
variables created by leads or lags larger than 2 or by of the
`EXPECTATION' operator
`EXPECTATION` operator
* Compilation of MEX files for MATLAB was failing with GCC 4.6
......@@ -2128,7 +2714,7 @@ places, the structure has been improved, an index of functions and
variables has been added, the PDF/HTML rendering has been improved.
The Windows package is already available for download at the official
Dynare website [1]. The Mac and Linux packages should follow soon.
[Dynare website](http://www.dynare.org). The Mac and Linux packages should follow soon.
All users are strongly encouraged to upgrade.
......@@ -2137,20 +2723,20 @@ to 7.12 (R2011a) and with GNU Octave versions ranging from 3.0 to 3.4.
Here is a list of the main bugfixes since version 4.2.0:
* The `STEADY_STATE' operator has been fixed
* The `STEADY_STATE` operator has been fixed
* Problems with MATLAB 7.3 (R2006b) and older have been fixed
* The `partial_information' option of `stoch_simul' has been fixed
* The `partial_information` option of `stoch_simul` has been fixed
* Option `conditional_variance_decomposition' of `stoch_simul' and
`estimation' has been fixed
* Option `conditional_variance_decomposition` of `stoch_simul` and
`estimation` has been fixed
* Automatic detrending now works in conjunction with the `EXPECTATION'
* Automatic detrending now works in conjunction with the `EXPECTATION`
operator
* Percentage signs inside strings in MATLAB statements (like disp('%
This is not a comment %')) now work
* Percentage signs inside strings in MATLAB statements (like `disp('%
This is not a comment %')`) now work
* Beta prior with a very small standard deviation now work even if you
do not have the MATLAB Statistical toolbox
......@@ -2158,15 +2744,13 @@ Here is a list of the main bugfixes since version 4.2.0:
* External functions can now been used in assignment of model local
variables
* `identification' command has been fixed
* `identification` command has been fixed
* Option `cova_compute' of `estimation' command has been fixed
* Option `cova_compute` of `estimation` command has been fixed
* Random crashes with 3rd order approximation without `use_dll' option
* Random crashes with 3rd order approximation without `use_dll` option
have been eliminated
[1] http://www.dynare.org
Announcement for Dynare 4.2.0 (on 2011-02-15)
=============================================
......@@ -2188,38 +2772,44 @@ Here is the list of major user-visible changes:
* New solution algorithms:
- Pruning for second order simulations has been added, as described in Kim,
Kim, Schaumburg and Sims (2008) [1,2]
- Pruning for second order simulations has been added, as described in *Kim,
Kim, Schaumburg and Sims (2008)*. It is triggered by option `pruning` of
`stoch_simul` (only 2nd order, not available at 3rd order).
- Models under partial information can be solved, as in Pearlman, Currie and
Levine (1986) [3,4]
- Models under partial information can be solved, as in *Pearlman, Currie and
Levine (1986)*. See <http://www.dynare.org/DynareWiki/PartialInformation>.
- New nonlinear solvers for faster deterministic simulations and steady state
computation [5]
computation. See
<http://www.dynare.org/DynareWiki/FastDeterministicSimulationAndSteadyStateComputation>.
* Dynare can now use the power of multi-core computers or of a cluster of
computer using parallelization [6]
computer using parallelization. See
<http://www.dynare.org/DynareWiki/ParallelDynare>.
* New features in the user interface:
- A steady state file can now be automatically generated, provided that the
model can be solved analytically, and that the steady state as a function
of the parameters is declared with the new "steady_state_model" command [7]
of the parameters is declared with the new `steady_state_model` command.
See the entry for `steady_state_model` in the reference manual for more
details and an example.
- For non-stationary models, Dynare is now able of automatically removing
trends in all the equations: the user writes the equations in
non-stationary form and declares the deflator of each variable. Then Dynare
perform a check to determine if the proposed deflators are compatible with
balanced growth path, and, if yes, then it computes the detrended equations
[8]
balanced growth path, and, if yes, then it computes the detrended
equations. See <http://www.dynare.org/DynareWiki/RemovingTrends>.
- It is now possible to use arbitrary functions in the model block [9]
- It is now possible to use arbitrary functions in the model block. See
<http://www.dynare.org/DynareWiki/ExternalFunctions>.
* Other minor changes to the user interface:
- New primitives allowed in model block: normpdf(), erf()
- New primitives allowed in model block: `normpdf()`, `erf()`
- New syntax for DSGE-VAR [10]
- New syntax for DSGE-VAR. See <http://www.dynare.org/DynareWiki/DsgeVar>.
- Syntax of deterministic shocks has changed: after the values keyword,
arbitrary expressions must be enclosed within parentheses (but numeric
......@@ -2227,32 +2817,33 @@ Here is the list of major user-visible changes:
* Various improvements:
- Third order simulations now work without the "USE_DLL" option:
- Third order simulations now work without the `use_dll` option:
installing a C++ compiler is no longer necessary for 3rd order
- The HP filter works for empirical moments (previously it was only available
for theoretical moments)
- "ramsey_policy" now displays the planner objective value function under
Ramsey policy and stores it in "oo_.planner_objective_value"
- `ramsey_policy` now displays the planner objective value function under
Ramsey policy and stores it in `oo_.planner_objective_value`
- Estimation: if the "selected_variables_only" option is present, then the
- Estimation: if the `selected_variables_only` option is present, then the
smoother will only be run on variables listed just after the estimation
command
- Estimation: in the "shocks" block, it is now possible to calibrate
- Estimation: in the `shocks` block, it is now possible to calibrate
measurement errors on endogenous variables (using the same keywords than
for calibrating variance/covariance matrix of exogenous shocks)
- It is possibile to choose the parameter set for shock decomposition [11]
- It is possibile to choose the parameter set for shock decomposition. See
<http://www.dynare.org/DynareWiki/ShockDecomposition>.
- The diffuse filter now works under Octave
- New option "console" on the Dynare command-line: use it when running Dynare
- New option `console` on the Dynare command-line: use it when running Dynare
from the console, it will replace graphical waitbars by text waitbars for
long computations
- Steady option "solve_algo=0" (uses fsolve()) now works under Octave
- Steady option `solve_algo=0` (uses `fsolve()`) now works under Octave
* For Emacs users:
......@@ -2265,22 +2856,14 @@ Here is the list of major user-visible changes:
- Deterministic models: leads and lags of two or more on endogenous
variables are now substituted by auxiliary variables; exogenous variables
are left as is [12]
are left as is. See <http://www.dynare.org/DynareWiki/AuxiliaryVariables>.
* References:
[1] Kim, J., S. Kim, E. Schaumburg and C.A. Sims (2008), "Calculating and using
- Kim, J., S. Kim, E. Schaumburg and C.A. Sims (2008), Calculating and using
second-order accurate solutions of discrete time dynamic equilibrium
models", Journal of Economic Dynamics and Control, 32(11), 3397-3414
[2] It is triggered by option "pruning" of "stoch_simul" (only 2nd order, not
available at 3rd order)
[3] Pearlman J., D. Currie and P. Levine (1986), "Rational expectations models
with partial information", Economic Modelling, 3(2), 90-105
[4] http://www.dynare.org/DynareWiki/PartialInformation
[5] http://www.dynare.org/DynareWiki/FastDeterministicSimulationAndSteadyStateComputation
[6] http://www.dynare.org/DynareWiki/ParallelDynare
[7] See the entry for "steady_state_model" in the reference manual for more
details and an example
[8] http://www.dynare.org/DynareWiki/RemovingTrends
[9] http://www.dynare.org/DynareWiki/ExternalFunctions
[10] http://www.dynare.org/DynareWiki/DsgeVar
[11] http://www.dynare.org/DynareWiki/ShockDecomposition
[12] http://www.dynare.org/DynareWiki/AuxiliaryVariables
models,” *Journal of Economic Dynamics and Control*, 32(11), 3397-3414
- Pearlman J., D. Currie and P. Levine (1986), “Rational expectations models
with partial information,” *Economic Modelling*, 3(2), 90-105
......@@ -234,7 +234,7 @@ All the prerequisites are packaged:
- `texlive-fonts-extra` (for ccicons)
- `texlive-latex-recommended`
- `texlive-science` (for amstex)
- `texlive-generic-extra` (for Sphinx)
- `texlive-plain-generic`
- `lmodern` (for macroprocessor PDF)
- `python3-sphinx`
- `latexmk`
......@@ -243,7 +243,7 @@ All the prerequisites are packaged:
You can install them all at once with:
```
apt install build-essential gfortran liboctave-dev libboost-graph-dev libgsl-dev libmatio-dev libslicot-dev libslicot-pic libsuitesparse-dev flex bison autoconf automake texlive texlive-publishers texlive-latex-extra texlive-fonts-extra texlive-latex-recommended texlive-science texlive-generic-extra lmodern python3-sphinx latexmk libjs-mathjax doxygen
apt install build-essential gfortran liboctave-dev libboost-graph-dev libgsl-dev libmatio-dev libslicot-dev libslicot-pic libsuitesparse-dev flex bison autoconf automake texlive texlive-publishers texlive-latex-extra texlive-fonts-extra texlive-latex-recommended texlive-science texlive-plain-generic lmodern python3-sphinx latexmk libjs-mathjax doxygen
```
## Windows
......@@ -262,30 +262,32 @@ pacman -Syu
```
pacman -S git autoconf automake-wrapper bison flex make tar texinfo mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-boost mingw-w64-x86_64-gsl mingw-w64-x86_64-matio mingw-w64-x86_64-openblas
```
- **(Optional)** compile and install SLICOT, needed for the `kalman_steady_state`
MEX file
- Compile and install SLICOT, needed for the `kalman_steady_state` MEX file
```
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 slicot.a
make 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 ..
```
- Clone and prepare the Dynare sources:
- Prepare the Dynare sources, either by unpacking the source tarball, or with:
```
git clone --recurse-submodules https://git.dynare.org/Dynare/dynare.git
cd dynare
autoreconf -si
```
- Configure Dynare:
- Configure Dynare from the source directory:
```
./configure --with-slicot=/usr/local --with-matlab=<…> MATLAB_VERSION=<…> --disable-octave
./configure --with-slicot=/usr/local --with-matlab=<…> MATLAB_VERSION=<…> --disable-octave --disable-doc
```
where the path and version of MATLAB are specified. Note that you should use
the MSYS2 notation and not put spaces in the MATLAB path, so you probably want
to use something like `/c/Progra~1/MATLAB/…`.
to use something like `/c/Progra~1/MATLAB/…`. Alternatively, if your filesystem
does not have short filenames (8dot3), then you can run `mkdir -p
/usr/local/MATLAB && mount c:/Program\ Files/MATLAB /usr/local/MATLAB`, and
then pass `/usr/local/MATLAB/…` as MATLAB path to the configure script.
- Compile:
```
make
......@@ -346,5 +348,5 @@ folder where you want Dynare installed.
- `make -j`
- **(Optional)** To then build mex files for Octave, run
- `cd mex/build/octave`
- `CC=gcc-9 CXX=g++-9 ./configure --with-matio=/usr/local --with-gsl=/usr/local --with-slicot=/usr/local LDFLAGS=-L/usr/local/lib`
- `CC=gcc-9 CXX=g++-9 ./configure --with-matio=/usr/local --with-gsl=/usr/local --with-slicot=/usr/local LDFLAGS=-L/usr/local/lib LEX=/usr/local/opt/flex/bin/flex YACC=/usr/local/opt/bison/bin/bison`
- `make -j`
......@@ -18,7 +18,7 @@ dnl You should have received a copy of the GNU General Public License
dnl along with Dynare. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ([2.62])
AC_INIT([dynare], [4.6-unstable])
AC_INIT([dynare], [4.6.5])
AC_CONFIG_SRCDIR([preprocessor/src/DynareMain.cc])
AM_INIT_AUTOMAKE([1.11 -Wall -Wno-portability foreign no-dist-gzip dist-xz tar-pax])
......@@ -130,8 +130,8 @@ fi
# Check for Octave
if test "$enable_octave" = yes; then
AC_CONFIG_SUBDIRS([mex/build/octave])
AC_CHECK_PROG([OCTAVE], [octave], [octave], [no])
test "$OCTAVE" = no && AC_MSG_ERROR([Octave cannot be found. If you want to compile Dynare without Octave support, pass the --disable-octave flag.])
AX_OCTAVE
test "$ax_enable_octave" != yes && AC_MSG_ERROR([Octave cannot be found. If you want to compile Dynare without Octave support, pass the --disable-octave flag.])
fi
# Construct final output message
......
......@@ -26,7 +26,7 @@
}}
\author{S\'ebastien Villemot\thanks{Paris School of Economics and
CEPREMAP.} \and Johannes Pfeifer\thanks{University of Cologne. E-mail: \href{mailto:jpfeifer@uni-koeln.de}{\texttt{jpfeifer@uni-koeln.de}}.}}
CEPREMAP.} \and Johannes Pfeifer\thanks{Universität der Bundeswehr München. E-mail: \href{mailto:johannes.pfeifer@unibw.de}{\texttt{johannes.pfeifer@unibw.de}}.}}
\date{First version: September 2007 \hspace{1cm} This version: May 2017}
\maketitle
......@@ -507,9 +507,11 @@ The command will actually compute the marginal density for several models: first
The syntax for computing (out-of-sample) forecasts is:
\medskip
\texttt{bvar\_forecast(}\textit{options\_list}\texttt{) }\textit{max\_number\_of\_lags}\texttt{;}
\texttt{bvar\_forecast(}\textit{options\_list}\texttt{) }\textit{number\_of\_lags}\texttt{;}
\medskip
In contrast to the \texttt{bvar\_density}, you need to specify the actual lag length used, not the maximum lag length. Typically, the actual lag length should be based on the results from the \texttt{bvar\_density} command.
The options are those describe above, plus a few ones:
\begin{itemize}
\item \texttt{forecast}: the number of periods over which to compute forecasts after the end of the sample (no default)
......
......@@ -16,3 +16,4 @@ build/latex/dynare-manual.pdf: $(SRC) source/conf.py
clean-local:
rm -rf build
rm -rf utils/__pycache__
......@@ -44,6 +44,7 @@ Bibliography
* Kim, Jinill and Sunghyun Kim (2003): “Spurious welfare reversals in international business cycle models,” *Journal of International Economics*, 60, 471–500.
* Kanzow, Christian and Stefania Petra (2004): “On a semismooth least squares formulation of complementarity problems with gap reduction,” *Optimization Methods and Software*, 19, 507–525.
* Kim, Jinill, Sunghyun Kim, Ernst Schaumburg, and Christopher A. Sims (2008): “Calculating and using second-order accurate solutions of discrete time dynamic equilibrium models,” *Journal of Economic Dynamics and Control*, 32(11), 3397–3414.
* Komunjer, Ivana and Ng, Serena (2011): ”Dynamic identification of dynamic stochastic general equilibrium models”, *Econometrica*, 79, 1995–2032.
* Koop, Gary (2003), *Bayesian Econometrics*, John Wiley & Sons.
* Koopman, S. J. and J. Durbin (2000): “Fast Filtering and Smoothing for Multivariate State Space Models,” *Journal of Time Series Analysis*, 21(3), 281–296.
* 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.
......@@ -52,13 +53,16 @@ Bibliography
* 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.
* Lubik, Thomas and Frank Schorfheide (2007): “Do Central Banks Respond to Exchange Rate Movements? A Structural Investigation,” *Journal of Monetary Economics*, 54(4), 1069–1087.
* 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.
* Pearlman, Joseph, David Currie, and Paul Levine (1986): “Rational expectations models with partial information,” *Economic Modelling*, 3(2), 90–105.
* Planas, Christophe, Marco Ratto and Alessandro Rossi (2015): “Slice sampling in Bayesian estimation of DSGE models”.
* Pfeifer, Johannes (2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”.
* Pfeifer, Johannes (2014): “An Introduction to Graphs in Dynare”.
* Qu, Zhongjun and Tkachenko, Denis (2012): “Identification and frequency domain quasi-maximum likelihood estimation of linearized dynamic stochastic general equilibrium models“, *Quantitative Economics*, 3, 95–132.
* Rabanal, Pau and Juan Rubio-Ramirez (2003): “Comparing New Keynesian Models of the Business Cycle: A Bayesian Approach,” Federal Reserve of Atlanta, *Working Paper Series*, 2003-30.
* Raftery, Adrian E. and Steven Lewis (1992): “How many iterations in the Gibbs sampler?,” in *Bayesian Statistics, Vol. 4*, ed. J.O. Berger, J.M. Bernardo, A.P. * Dawid, and A.F.M. Smith, Clarendon Press: Oxford, pp. 763-773.
* Ratto, Marco (2008): “Analysing DSGE models with global sensitivity analysis”, *Computational Economics*, 31, 115–139.
* Ratto, Marco and Iskrev, Nikolay (2011): “Identification Analysis of DSGE Models with DYNARE.“, *MONFISPOL* 225149.
* Schorfheide, Frank (2000): “Loss Function-based evaluation of DSGE models,” *Journal of Applied Econometrics*, 15(6), 645–670.
* Schmitt-Grohé, Stephanie and Martin Uríbe (2004): “Solving Dynamic General Equilibrium Models Using a Second-Order Approximation to the Policy Function,” *Journal of Economic Dynamics and Control*, 28(4), 755–775.
* Schnabel, Robert B. and Elizabeth Eskow (1990): “A new modified Cholesky algorithm,” *SIAM Journal of Scientific and Statistical Computing*, 11, 1136–1158.
......@@ -68,6 +72,3 @@ Bibliography
* Stock, James H. and Mark W. Watson (1999). “Forecasting Inflation,”, *Journal of Monetary Economics*, 44(2), 293–335.
* Uhlig, Harald (2001): “A Toolkit for Analysing Nonlinear Dynamic Stochastic Models Easily,” in *Computational Methods for the Study of Dynamic Economies*, Eds. Ramon Marimon and Andrew Scott, Oxford University Press, 30–61.
* Villemot, Sébastien (2011): “Solving rational expectations models at first order: what Dynare does,” *Dynare Working Papers*, 2, CEPREMAP.
# -*- coding: utf-8 -*-
# Copyright (C) 2018-2019 Dynare Team
# Copyright (C) 2018-2020 Dynare Team
#
# This file is part of Dynare.
#
......@@ -36,7 +36,7 @@ mathjax_path = 'mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
master_doc = 'index'
project = u'Dynare'
copyright = u'2019, Dynare Team'
copyright = u'2020, Dynare Team'
author = u'Dynare Team'
add_function_parentheses = False
......@@ -77,6 +77,7 @@ latex_elements = {
warningBorderColor={RGB}{255,50,50},OuterLinkColor={RGB}{34,139,34}, \
InnerLinkColor={RGB}{51,51,255},TitleColor={RGB}{51,51,255}',
'papersize': 'a4paper',
'preamble': r'\DeclareUnicodeCharacter{200B}{}', # Part of the workaround for #1707
}
latex_documents = [
......
......@@ -167,24 +167,26 @@ Dynare misc commands
A ``1*Nblck`` array of doubles. Current acceptance ratios.
.. matcomm:: prior [options[, ...]];
.. matcomm:: prior [OPTIONS[, ...]];
Prints various informations about the prior distribution depending
on the options. If no options are provided, the command returns
the list of available options. Following options are available:
Prints information about the prior distribution given the provided
options. If no options are provided, the command returns the list of
available options.
``table``
*Options*
.. option:: table
Prints a table describing the marginal prior distributions
(mean, mode, std., lower and upper bounds, HPD interval).
``moments``
.. option:: moments
Computes and displays first and second order moments of the
endogenous variables at the prior mode (considering the
linearized version of the model).
``moments(distribution)``
.. option:: moments(distribution)
Computes and displays the prior mean and prior standard
deviation of the first and second moments of the endogenous
......@@ -193,7 +195,7 @@ Dynare misc commands
stored in the ``prior`` subfolder in a
``_endogenous_variables_prior_draws.mat`` file.
``optimize``
.. option:: optimize
Optimizes the prior density (starting from a random initial
guess). The parameters such that the steady state does not
......@@ -203,7 +205,7 @@ Dynare misc commands
defined over such regions, the optimization algorithm may fail
to converge to the true solution (the prior mode).
``simulate``
.. option:: simulate
Computes the effective prior mass using a Monte-Carlo. Ideally
the effective prior mass should be equal to 1, otherwise
......@@ -215,6 +217,6 @@ Dynare misc commands
:math:`p_A\neq p_B \leq 1` so that the prior mass of the
compared models are identical.
``plot``
.. option:: plot
Plots the marginal prior density.
......@@ -56,3 +56,9 @@ description, please refer to the comments inside the files themselves.
Baseline New Keynesian Model estimated in *Fernández-Villaverde
(2010)*. It demonstrates how to use an explicit steady state file
to update parameters and call a numerical solver.
``Ramsey_Example.mod``
File demonstrating how to conduct optimal policy experiments in a
simple New Keynesian model either under commitment (Ramsey) or using
optimal simple rules (OSR)
\ No newline at end of file
......@@ -4,15 +4,14 @@ The Dynare Reference Manual, version |version|
Currently the development team of Dynare is composed of:
* Stéphane Adjemian (Université du Maine, Gains)
* Houtan Bastani (CEPREMAP)
* Houtan Bastani
* Michel Juillard (Banque de France)
* Sumudu Kankanamge (Toulouse School of Economics)
* Frédéric Karamé (Université du Maine, Gains and CEPREMAP)
* Dóra Kocsis (CEPREMAP)
* Junior Maih (Norges Bank)
* Ferhat Mihoubi (Université Paris-Est Créteil, Érudite and CEPREMAP)
* Ferhat Mihoubi (Université Paris-Est Créteil, Érudite)
* Willi Mutschler (University of Münster)
* Johannes Pfeifer (University of Cologne)
* Johannes Pfeifer (Universität der Bundeswehr München)
* Marco Ratto (European Commission, Joint Research Centre - JRC)
* Sébastien Villemot (CEPREMAP)
......@@ -22,10 +21,11 @@ The following people used to be members of the team:
* Alejandro Buesa
* Fabrice Collard
* Assia Ezzeroug
* Dóra Kocsis
* Stéphane Lhuissier
* George Perendia
Copyright © 1996-2019, Dynare Team.
Copyright © 1996-2020, 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.
......
......@@ -7,7 +7,7 @@ Installation and configuration
Software requirements
=====================
Packaged versions of Dynare are available for Windows 7/8/10, several GNU/Linux
Packaged versions of Dynare are available for Windows (7, 8.1, 10), several GNU/Linux
distributions (Debian, Ubuntu, Linux Mint, Arch Linux) and macOS
10.11 or later. Dynare should work on other systems, but some compilation steps
are necessary in that case.
......@@ -15,7 +15,10 @@ are necessary in that case.
In order to run Dynare, you need one of the following:
* MATLAB version 7.9 (R2009b) or above;
* Octave version 4.2.1 or above, with the statistics package from `Octave-Forge`_.
* GNU Octave version 4.2.1 or above, with the statistics package from
`Octave-Forge`_. Note however that the Dynare installers for Windows and
macOS require a more specific version of Octave, as indicated on the download
page.
The following optional extensions are also useful to benefit from
extra features, but are in no way required:
......
......@@ -55,7 +55,7 @@ manual. Part of Dynare is programmed in C++, while the rest is written
using the `MATLAB`_ programming language. The latter implies that
commercially-available MATLAB software is required in order to run
Dynare. However, as an alternative to MATLAB, Dynare is also able to
run on top of `Octave`_ (basically a free clone of MATLAB): this
run on top of `GNU Octave`_ (basically a free clone of MATLAB): this
possibility is particularly interesting for students or institutions
who cannot afford, or do not want to pay for, MATLAB and are willing
to bear the concomitant performance loss.
......@@ -95,8 +95,8 @@ You should cite Dynare if you use it in your research. The
recommended way todo this is to cite the present manual, as:
Stéphane Adjemian, Houtan Bastani, Michel Juillard, Frédéric
Karamé, Junior Maih, Ferhat Mihoubi, George Perendia, Johannes Pfeifer, Marco
Ratto and Sébastien Villemot (2011), “Dynare: Reference Manual,
Karamé, Junior Maih, Ferhat Mihoubi, Willi Mutschler, George Perendia, Johannes Pfeifer,
Marco Ratto and Sébastien Villemot (2011), “Dynare: Reference Manual,
Version 4,” *Dynare Working Papers*, 1, CEPREMAP
For convenience, you can copy and paste the following into your BibTeX file:
......@@ -106,8 +106,8 @@ For convenience, you can copy and paste the following into your BibTeX file:
@TechReport{Adjemianetal2011,
author = {Adjemian, St\'ephane and Bastani, Houtan and
Juillard, Michel and Karam\'e, Fr\'ederic and
Maih, Junior and Mihoubi, Ferhat and
Perendia, George and Pfeifer, Johannes and
Maih, Junior and Mihoubi, Ferhat and Mutschler, Willi
and Perendia, George and Pfeifer, Johannes and
Ratto, Marco and Villemot, S\'ebastien},
title = {Dynare: Reference Manual Version 4},
year = {2011},
......@@ -122,7 +122,7 @@ https://www.dynare.org.
.. _MATLAB: https://www.mathworks.com/products/matlab/
.. _Octave: https://www.octave.org/
.. _GNU Octave: https://www.octave.org/
.. _CEPREMAP: https://www.cepremap.fr/
.. _web forum: https://forum.dynare.org/
.. _official Dynare website: https://www.dynare.org/
......
......@@ -104,6 +104,23 @@ by the ``dynare`` command.
Octave, it also means that the ``.mod`` file cannot be named
``test.mod`` or ``example.mod``.
.. _quote-note:
.. note::
Note on Quotes
When passing command line options that contains a space (or, under
Octave, a double quote), you must surround the entire option (keyword
and argument) with single quotes, as in the following example.
*Example*
Call Dynare with options containing spaces
.. code-block:: matlab
>> dynare <<modfile.mod>> '-DA=[ i in [1,2,3] when i > 1 ]' 'conffile=C:\User\My Documents\config.txt'
*Options*
.. option:: noclearall
......@@ -140,10 +157,11 @@ by the ``dynare`` command.
.. option:: savemacro[=FILENAME]
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``
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>`
for info on passing a ``FILENAME`` argument containing spaces.
.. option:: onlymacro
......@@ -152,19 +170,12 @@ by the ``dynare`` command.
debugging purposes or for using the macro processor
independently of the rest of Dynare toolbox.
.. option:: nolinemacro
.. option:: linemacro
Instructs the macro preprocessor to omit line numbering
information in the intermediary ``.mod`` file created after
the macro processing step. Useful in conjunction with
:opt:`savemacro <savemacro[=FILENAME]>` when one wants that to reuse the intermediary
``.mod`` file, without having it cluttered by line numbering
directives.
.. option:: noemptylinemacro
Passing this option removes all empty from the macro expanded
mod file created when the :opt:`savemacro <savemacro[=FILENAME]>` option is used.
Instructs the macro preprocessor include ``@#line`` directives
specifying the line on which macro directives were encountered and
expanded from. Only useful in conjunction with :opt:`savemacro
<savemacro[=FILENAME]>`.
.. option:: onlymodel
......@@ -214,7 +225,8 @@ by the ``dynare`` command.
.. option:: json = parse|check|transform|compute
Causes the preprocessor to output a version of the ``.mod`` file in
JSON format. When the JSON output is created depends on the value
JSON format to ``<<M_.dname>>/model/json/``.
When the JSON output is created depends on the value
passed. These values represent various steps of processing in the
preprocessor.
......@@ -242,7 +254,8 @@ by the ``dynare`` command.
.. option:: jsonstdout
Instead of writing output requested by ``json`` to files,
write to standard out.
write to standard out, i.e. to the MATLAB/Octave command window
(and the log-file).
.. option:: onlyjson
......@@ -273,6 +286,7 @@ by the ``dynare`` command.
computations.
.. option:: nograph
:noindex:
Activate the ``nograph`` option (see :opt:`nograph`), so that
Dynare will not produce any graph.
......@@ -305,9 +319,10 @@ by the ``dynare`` command.
.. option:: matlabroot=<<path>>
The path to the MATLAB installation for use with
:opt:`use_dll`. Dynare is able to set this automatically,
so you should not need to set it yourself.
The path to the MATLAB installation for use with :opt:`use_dll`. Dynare
is able to set this automatically, so you should not need to set it
yourself. See the :ref:`note on quotes<quote-note>` for info on
passing a ``<<path>>`` argument containing spaces.
.. option:: parallel[=CLUSTER_NAME]
......@@ -320,9 +335,11 @@ by the ``dynare`` command.
.. option:: conffile=FILENAME
Specifies the location of the configuration file if it differs
from the default. See :ref:`conf-file`, for more information
about the configuration file and its default location.
Specifies the location of the configuration file if it differs from the
default. See :ref:`conf-file`, for more information about the
configuration file and its default location. See the :ref:`note on
quotes<quote-note>` for info on passing a ``FILENAME`` argument
containing spaces.
.. option:: parallel_slave_open_mode
......@@ -338,18 +355,30 @@ by the ``dynare`` command.
.. option:: -DMACRO_VARIABLE=MACRO_EXPRESSION
Defines a macro-variable from the command line (the same
effect as using the Macro directive ``@#define`` in a model
file, see :ref:`macro-proc-lang`).
Defines a macro-variable from the command line (the same effect as
using the Macro directive ``@#define`` in a model file, see
:ref:`macro-proc-lang`). See the :ref:`note on quotes<quote-note>` for
info on passing a ``MACRO_EXPRESSION`` argument containing spaces. Note
that an expression passed on the command line can reference variables
defined before it.
*Example*
Call dynare with command line defines
.. code-block:: matlab
>> dynare <<modfile.mod>> -DA=true '-DB="A string with space"' -DC=[1,2,3] '-DD=[ i in C when i > 1 ]'
.. option:: -I<<path>>
Defines a path to search for files to be included by the
macro processor (using the ``@#include`` command). Multiple
``-I`` flags can be passed on the command line. The paths will
be searched in the order that the ``-I`` flags are passed and
the first matching file will be used. The flags passed here
take priority over those passed to ``@#includepath``.
Defines a path to search for files to be included by the macro
processor (using the ``@#include`` command). Multiple ``-I`` flags can
be passed on the command line. The paths will be searched in the order
that the ``-I`` flags are passed and the first matching file will be
used. The flags passed here take priority over those passed to
``@#includepath``. See the :ref:`note on quotes<quote-note>` for info
on passing a ``<<path>>`` argument containing spaces.
.. option:: nostrict
......@@ -397,13 +426,14 @@ by the ``dynare`` command.
after the name of the ``.mod`` file. They can alternatively be
defined in the first line of the ``.mod`` file, this avoids typing
them on the command line each time a ``.mod`` file is to be
run. This line must be a Dynare comment (ie must begin with //)
and the options must be comma separated between ``--+`` options:
run. This line must be a Dynare one-line comment (i.e. must begin with ``//``)
and the options must be whitespace separated between ``--+ options:``
and ``+--``. Note that any text after the ``+--`` will be
discarded. As in the command line, if an option admits a value the
equal symbol must not be surrounded by spaces. For instance ``json
= compute`` is not correct, and should be written
``json=compute``.
``json=compute``. The ``nopathchange`` option cannot be specified in
this way, it must be passed on the command-line.
*Output*
......
......@@ -740,7 +740,9 @@ required for external functions used in an EXPRESSION outside of a
provided as the only output of the M-/MEX file given as the
option argument. If NAME is not provided, this tells Dynare
that the M-/MEX file specified by the argument passed to NAME
returns the Jacobian as its second output argument.
returns the Jacobian as its second output argument. When this option is
not provided, Dynare will use finite difference approximations for
computing the derivatives of the function, whenever needed.
.. option:: second_deriv_provided [= NAME]
......@@ -750,7 +752,9 @@ required for external functions used in an EXPRESSION outside of a
that the M-/MEX file specified by the argument passed to NAME
returns the Hessian as its third output argument. NB: This
option can only be used if the ``first_deriv_provided`` option
is used in the same ``external_function`` command.
is used in the same ``external_function`` command. When this option is
not provided, Dynare will use finite difference approximations for
computing the Hessian derivatives of the function, whenever needed.
*Example*
......@@ -815,6 +819,19 @@ The parameter names are stored in ``M_.param_names``:
Cell array containing the names of the model parameters.
.. matcomm:: get_param_by_name ('PARAMETER_NAME');
Given the name of a parameter, returns its calibrated value as it is
stored in ``M_.params``.
.. matcomm:: set_param_value ('PARAMETER_NAME', MATLAB_EXPRESSION);
Sets the calibrated value of a parameter to the provided expression.
This does essentially the same as the parameter initialization syntax
described above, except that it accepts arbitrary MATLAB/Octave expressions,
and that it works from MATLAB/Octave scripts.
.. _model-decl:
Model declaration
......@@ -908,9 +925,8 @@ The model is declared inside a ``model`` block:
libraries (DLL) containing the model equations and
derivatives, instead of writing those in M-files. You need a
working compilation environment, i.e. a working ``mex``
command (see :ref:`compil-install` for more details). On
MATLAB for Windows, you will need to also pass the compiler
name at the command line. Using this option can result in
command (see :ref:`compil-install` for more details).
Using this option can result in
faster simulations or estimations, at the expense of some
initial compilation time. [#f2]_
......@@ -1487,7 +1503,9 @@ in this case ``initval`` is used to specify the terminal conditions.
steady;
simul(periods=200);
perfect_foresight_setup(periods=200);
perfect_foresight_solver;
In this example, the problem is finding the optimal path for
consumption and capital for the periods :math:`t=1` to
......@@ -1527,7 +1545,9 @@ in this case ``initval`` is used to specify the terminal conditions.
x = 1.1;
end;
simul(periods=200);
perfect_foresight_setup(periods=200);
perfect_foresight_solver;
In this example, there is no `steady` command, hence the
conditions are exactly those specified in the `initval` and `endval` blocks.
......@@ -1709,7 +1729,7 @@ in this case ``initval`` is used to specify the terminal conditions.
objective function of the planner is computed. Note that the
initial values of the Lagrange multipliers associated with
the planner’s problem cannot be set (see
:ref:`planner_objective_value <plan-obj>`).
:comm:`evaluate_planner_objective`).
*Options*
......@@ -2029,6 +2049,17 @@ blocks.
is strongly discouraged**. You should use a
``shocks`` block instead.
.. matcomm:: get_shock_stderr_by_name ('EXOGENOUS_NAME');
|br| Given the name of an exogenous variable, returns its standard
deviation, as set by a previous ``shocks`` block.
.. matcomm:: set_shock_stderr_value ('EXOGENOUS_NAME', MATLAB_EXPRESSION);
|br| Sets the standard deviation of an exgonous variable. This does
essentially the same as setting the standard error via a ``shocks`` block,
except that it accepts arbitrary MATLAB/Octave expressions, and that it
works from MATLAB/Octave scripts.
Other general declarations
==========================
......@@ -2268,6 +2299,11 @@ After computation, the steady state is available in the following variable:
ordered in the order of declaration used in the ``var`` command (which
is also the order used in ``M_.endo_names``).
.. matcomm:: get_mean ('ENDOGENOUS_NAME' [, 'ENDOGENOUS_NAME']... );
Returns the steady of state of the given endogenous variable(s), as it is
stored in ``oo_.steady_state``. Note that, if the steady state has not yet
been computed with ``steady``, it will first try to compute it.
.. block:: homotopy_setup ;
......@@ -2504,7 +2540,7 @@ Getting information about the model
===================================
.. command:: check ;
check (solve_algo = INTEGER);
check (OPTIONS...);
|br| Computes the eigenvalues of the model linearized around the
values specified by the last ``initval``, ``endval`` or ``steady``
......@@ -2922,7 +2958,7 @@ speed-up on large models.
Solves the linearized version of the perfect foresight
model. The model must be stationary. Only available with option
``stack_solve_algo==0``.
``stack_solve_algo==0`` or ``stack_solve_algo==7``.
*Output*
......@@ -3069,13 +3105,6 @@ Computing the stochastic solution
moments. This option is only available with simulated
moments. Default: no filter.
.. option:: hp_ngrid = INTEGER
Number of points in the grid for the discrete Inverse Fast
Fourier Transform used in the HP filter computation. It may be
necessary to increase it for highly autocorrelated
processes. Default: ``512``.
.. option:: bandpass_filter
Uses a bandpass filter with the default passband before
......@@ -3091,6 +3120,14 @@ Computing the stochastic solution
e.g. :math:`6` to :math:`32` quarters if the model frequency is
quarterly. Default: ``[6,32]``.
.. option:: filtered_theoretical_moments_grid = INTEGER
When computing filtered theoretical moments (with either option
``hp_filter`` or option ``bandpass_filter``), this option governs the
number of points in the grid for the discrete Inverse Fast Fourier
Transform. It may be necessary to increase it for highly autocorrelated
processes. Default: ``512``.
.. option:: irf = INTEGER
Number of periods on which to compute the IRFs. Setting
......@@ -3417,6 +3454,10 @@ Computing the stochastic solution
stored in ´´oo_.SpectralDensity´´, defined below. Default: do
not request spectral density estimates.
.. option:: hp_ngrid = INTEGER
Deprecated option. It has the same effect as
:opt:`filtered_theoretical_moments_grid <filtered_theoretical_moments_grid = INTEGER>`.
*Output*
......@@ -3635,6 +3676,11 @@ Computing the stochastic solution
For example, ``oo_.irfs.gnp_ea`` contains the effect on ``gnp`` of
a one-standard deviation shock on ``ea``.
.. matcomm:: get_irf ('EXOGENOUS_NAME' [, 'ENDOGENOUS_NAME']... );
|br| Given the name of an exogenous variables, returns the IRFs for the
requested endogenous variable(s), as they are stored in ``oo_.irfs``.
The approximated solution of a model takes the form of a set of
decision rules or transition equations expressing the current value of
the endogenous variables of the model as function of the previous
......@@ -3686,7 +3732,9 @@ which is described below.
the endogenous variables are generated by assuming that the
agents believe that there will no more shocks after period
:math:`t+S`. This is an experimental feature and can be quite
slow. Default: ``0``.
slow. A non-zero value is not compatible with either the
``bytecode`` or the ``block`` option of the ``model`` block.
Default: ``0``.
.. option:: hybrid
......@@ -3922,6 +3970,20 @@ The coefficients of the decision rules are stored as follows:
unfolded :math:`G_3` matrix, they must be multiplied by 3 when
computing the decision rules.
Higher-order approximation
--------------------------
Higher-order approximations are simply a generalization of what is done at
order 3.
The steady state is stored in ``oo_.dr.ys`` and the constant correction is
stored in ``oo_.dr.g_0``. The coefficient for orders 1, 2, 3, 4… are
respectively stored in ``oo_.dr.g_0``, ``oo_.dr.g_1``, ``oo_.dr.g_2``,
``oo_.dr.g_3``, ``oo_.dr.g_4``… The columns of those matrices correspond to
multidimensional indices of state variables, in such a way that symmetric
elements are never repeated (for more details, see the description of
``oo_.dr.g_3`` in the third-order case).
.. _estim:
......@@ -4764,7 +4826,8 @@ block decomposition of the model (see :opt:`block`).
state variables and estimated jointly with the
original state variables of the model using a
nonlinear filter. The algorithm implemented in Dynare
is described in *Liu and West (2001)*.
is described in *Liu and West (2001)*, and works with
``k`` order local approximations of the model.
``12``
......@@ -4835,10 +4898,8 @@ block decomposition of the model (see :opt:`block`).
the computed mode for each estimated parameter in turn. This is
helpful to diagnose problems with the optimizer. Note that for
``order>1`` the likelihood function resulting from the particle
filter is not differentiable anymore due to random chatter
introduced by selecting different particles for different
parameter values. For this reason, the ``mode_check`` plot may
look wiggly.
filter is not differentiable anymore due to the resampling
step. For this reason, the ``mode_check`` plot may look wiggly.
.. option:: mode_check_neighbourhood_size = DOUBLE
......@@ -5379,6 +5440,8 @@ block decomposition of the model (see :opt:`block`).
Available options are:
.. _prop_distrib:
``'proposal_distribution'``
Specifies the statistical distribution used for the
......@@ -5477,6 +5540,11 @@ block decomposition of the model (see :opt:`block`).
``'tailored_random_block_metropolis_hastings'``
``'proposal_distribution'``
Specifies the statistical distribution used for the
proposal density. See :ref:`proposal_distribution <prop_distrib>`.
``new_block_probability = DOUBLE``
Specifies the probability of the next parameter
......@@ -5750,12 +5818,12 @@ block decomposition of the model (see :opt:`block`).
.. option:: order = INTEGER
Order of approximation, either ``1`` or ``2``. When equal to
``2``, the likelihood is evaluated with a particle filter based
on a second order approximation of the model (see
*Fernandez-Villaverde and Rubio-Ramirez (2005)*). Default is
``1``, i.e. the likelihood of the linearized model is evaluated
using a standard Kalman filter.
Order of approximation around the deterministic steady
state. When greater than 1, the likelihood is evaluated with a
particle or nonlinear filter (see *Fernandez-Villaverde and
Rubio-Ramirez (2005)*). Default is ``1``, i.e. the likelihood
of the linearized model is evaluated using a standard Kalman
filter.
.. option:: irf = INTEGER
......@@ -6381,6 +6449,12 @@ block decomposition of the model (see :opt:`block`).
oo_.SmoothedVariables.MOMENT_NAME.VARIABLE_NAME
.. matcomm:: get_smooth ('VARIABLE_NAME' [, 'VARIABLE_NAME']...);
Returns the smoothed values of the given endogenous or exogenous
variable(s), as they are stored in the ``oo_.SmoothedVariables``
and ``oo_.SmoothedShocks`` variables.
.. matvar:: oo_.UpdatedVariables
Variable set by the ``estimation`` command (if used with the
......@@ -6397,6 +6471,10 @@ block decomposition of the model (see :opt:`block`).
oo_.UpdatedVariables.MOMENT_NAME.VARIABLE_NAME
.. matcomm:: get_update ('VARIABLE_NAME' [, 'VARIABLE_NAME']...);
Returns the updated values of the given variable(s), as they are stored
in the ``oo_.UpdatedVariables`` variable.
.. matvar:: oo_.FilterCovariance
......@@ -6948,11 +7026,36 @@ Shock Decomposition
See :opt:`nobs <nobs = INTEGER>`.
.. option:: use_shock_groups [= STRING]
.. option:: prefilter = INTEGER
See :opt:`prefilter <prefilter = INTEGER>`.
.. option:: loglinear
See :opt:`loglinear <loglinear>`.
.. option:: diffuse_kalman_tol = DOUBLE
See :opt:`diffuse_kalman_tol <diffuse_kalman_tol = DOUBLE>`.
.. option:: diffuse_filter
See :opt:`diffuse_filter <diffuse_filter>`.
.. option:: xls_sheet = NAME
See :opt:`xls_sheet <xls_sheet = NAME>`.
.. option:: xls_range = RANGE
See :opt:`xls_range <xls_range = RANGE>`.
.. option:: use_shock_groups [= NAME]
Uses shock grouping defined by the string instead of
individual shocks in the decomposition. The groups of shocks
are defined in the :bck:`shock_groups` block.
are defined in the :bck:`shock_groups` block. If no group name is
given, ``default`` is assumed.
.. option:: colormap = VARIABLE_NAME
......@@ -6980,7 +7083,7 @@ Shock Decomposition
.. option:: with_epilogue
If set, then also compute the decomposition for variables declared in
the ``epilogue`` block.
the ``epilogue`` block (see :ref:`epilogue`).
*Output*
......@@ -7021,7 +7124,8 @@ Shock Decomposition
groups. It is possible to use several ``shock_groups`` blocks
in a model file, each grouping being identified by a different
name. This name must in turn be used in the
``shock_decomposition`` command.
``shock_decomposition`` command. If no name is given, ``default`` is
used.
*Example*
......@@ -7100,9 +7204,9 @@ Shock Decomposition
See :opt:`nobs <nobs = INTEGER>`.
.. option:: use_shock_groups [= STRING]
.. option:: use_shock_groups [= NAME]
See :opt:`use_shock_groups <use_shock_groups [= STRING]>`.
See :opt:`use_shock_groups <use_shock_groups [= NAME]>`.
.. option:: colormap = VARIABLE_NAME
......@@ -7141,8 +7245,7 @@ Shock Decomposition
.. option:: with_epilogue
If set, then also compute the decomposition for variables declared in
the ``epilogue`` block.
See :opt:`with_epilogue`.
*Output*
......@@ -7244,9 +7347,9 @@ Shock Decomposition
*Options*
.. option:: use_shock_groups [= STRING]
.. option:: use_shock_groups [= NAME]
See :opt:`use_shock_groups <use_shock_groups [= STRING]>`.
See :opt:`use_shock_groups <use_shock_groups [= NAME]>`.
.. option:: colormap = VARIABLE_NAME
......@@ -7388,8 +7491,75 @@ Shock Decomposition
.. option:: with_epilogue
If set, then also compute the decomposition for variables declared in
the ``epilogue`` block.
See :opt:`with_epilogue`.
.. option:: init2shocks
init2shocks = NAME
Use the information contained in an :bck:`init2shocks` block, in order
to attribute initial conditions to shocks. The name of the block can be
explicitly given, otherwise it defaults to the ``default`` block.
.. block:: init2shocks ;
init2shocks (OPTIONS...);
|br| This blocks gives the possibility of attributing the initial condition
of endogenous variables to the contribution of exogenous variables in the
shock decomposition.
For example, in an AR(1) process, the contribution of the initial condition
on the process variable can naturally be assigned to the innovation of the
process.
Each line of the block should have the syntax::
VARIABLE_1 [,] VARIABLE_2;
Where VARIABLE_1 is an endogenous variable whose initial condition
will be attributed to the exogenous VARIABLE_2.
The information contained in this block is used by the
:comm:`plot_shock_decomposition` command when given the ``init2shocks``
option.
*Options*
.. option:: name = NAME
Specifies a name for the block, that can be referenced from
``plot_shock_decomposition``, so that several such blocks can coexist
in a single model file. If the name is unspecified, it defaults to
``default``.
*Example*
::
var y y_s R pie dq pie_s de A y_obs pie_obs R_obs;
varexo e_R e_q e_ys e_pies e_A;
...
model;
dq = rho_q*dq(-1)+e_q;
A = rho_A*A(-1)+e_A;
...
end;
...
init2shocks;
dq e_q;
A e_A;
end;
shock_decomposition(nograph);
plot_shock_decomposition(init2shocks) y_obs R_obs pie_obs dq de;
In this example, the initial conditions of ``dq`` and ``A`` will
be respectively attributed to ``e_q`` and ``e_A``.
.. command:: initial_condition_decomposition [VARIABLE_NAME]...;
initial_condition_decomposition (OPTIONS...) [VARIABLE_NAME]...;
......@@ -7556,6 +7726,14 @@ Dynare can also run the smoother on a calibrated model:
See :opt:`diffuse_kalman_tol <diffuse_kalman_tol = DOUBLE>`.
.. option:: xls_sheet = NAME
See :opt:`xls_sheet <xls_sheet = NAME>`.
.. option:: xls_range = RANGE
See :opt:`xls_range <xls_range = RANGE>`.
.. _fore:
Forecasting
......@@ -7974,7 +8152,7 @@ The forecast scenario can contain some simple shocks on the exogenous
variables. This shocks are described using the function
``basic_plan``:
.. matcomm:: HANDLE = basic_plan (HANDLE, 'VAR_NAME', 'SHOCK_TYPE', DATES, MATLAB VECTOR OF DOUBLE | [DOUBLE | EXPR [DOUBLE | | EXPR] ] );
.. matcomm:: HANDLE = basic_plan (HANDLE, `VAR_NAME', `SHOCK_TYPE', DATES, MATLAB VECTOR OF DOUBLE | [DOUBLE | EXPR [DOUBLE | EXPR] ] );
Adds to the forecast scenario a shock on the exogenous variable
indicated between quotes in the second argument. The shock type
......@@ -7992,7 +8170,7 @@ compatible with the constrained path are in this case computed. In
other words, a conditional forecast is performed. This kind of shock
is described with the function ``flip_plan``:
.. matcomm:: HANDLE = flip_plan (HANDLE, 'VAR_NAME, 'VAR_NAME', 'SHOCK_TYPE', DATES, MATLAB VECTOR OF DOUBLE | [DOUBLE | EXPR [DOUBLE | | EXPR] ] );
.. matcomm:: HANDLE = flip_plan (HANDLE, `VAR_NAME', `VAR_NAME', `SHOCK_TYPE', DATES, MATLAB VECTOR OF DOUBLE | [DOUBLE | EXPR [DOUBLE | EXPR] ] );
Adds to the forecast scenario a constrained path on the endogenous
variable specified between quotes in the second argument. The
......@@ -8049,7 +8227,8 @@ computed with the command ``det_cond_forecast``:
plot(dset_forecast.{'r','e'});
.. command:: smoother2histval [(OPTIONS...)];
.. command:: smoother2histval ;
smoother2histval(OPTIONS...);
The purpose of this command is to construct initial conditions
(for a subsequent simulation) that are the smoothed values of a
......@@ -8122,148 +8301,378 @@ Optimal policy
==============
Dynare has tools to compute optimal policies for various types of
objectives. ``ramsey_model`` computes automatically the First Order
Conditions (FOC) of a model, given the ``planner_objective``. You can
then use other standard commands to solve, estimate or simulate this
new, expanded model.
Alternatively, you can either solve for optimal policy under
commitment with ``ramsey_policy``, for optimal policy under discretion
with ``discretionary_policy`` or for optimal simple rule with ``osr``
objectives. You can either solve for optimal policy under
commitment with ``ramsey_model``, for optimal policy under discretion
with ``discretionary_policy`` or for optimal simple rules with ``osr``
(also implying commitment).
.. command:: osr [VARIABLE_NAME...];
osr (OPTIONS...) [VARIABLE_NAME...];
|br| This command computes optimal simple policy rules for
linear-quadratic problems of the form:
.. math::
.. command:: planner_objective MODEL_EXPRESSION ;
\min_\gamma E(y'_tWy_t)
|br| This command declares the policy maker objective, for use
with ``ramsey_model`` or ``discretionary_policy``.
such that:
You need to give the one-period objective, not the discounted
lifetime objective. The discount factor is given by the
``planner_discount`` option of ``ramsey_model`` and
``discretionary_policy``. The objective function can only contain
current endogenous variables and no exogenous ones. This
limitation is easily circumvented by defining an appropriate
auxiliary variable in the model.
.. math::
With ``ramsey_model``, you are not limited to quadratic
objectives: you can give any arbitrary nonlinear expression.
A_1 E_ty_{t+1}+A_2 y_t+ A_3 y_{t-1}+C e_t=0
With ``discretionary_policy``, the objective function must be quadratic.
where:
Optimal policy under commitment (Ramsey)
----------------------------------------
* :math:`E` denotes the unconditional expectations operator;
* :math:`\gamma` are parameters to be optimized. They must be
elements of the matrices :math:`A_1`, :math:`A_2`,
:math:`A_3`, i.e. be specified as parameters in the
``params`` command and be entered in the ``model`` block;
* :math:`y` are the endogenous variables, specified in the
``var`` command, whose (co)-variance enters the loss
function;
* :math:`e` are the exogenous stochastic shocks, specified in
the ``varexo``- ommand;
* :math:`W` is the weighting matrix;
.. command:: ramsey_model (OPTIONS...);
The linear quadratic problem consists of choosing a subset of
model parameters to minimize the weighted (co)-variance of a
specified subset of endogenous variables, subject to a linear law
of motion implied by the first order conditions of the model. A
few things are worth mentioning. First, :math:`y` denotes the
selected endogenous variables’ deviations from their steady state,
i.e. in case they are not already mean 0 the variables entering
the loss function are automatically demeaned so that the centered
second moments are minimized. Second, ``osr`` only solves linear
quadratic problems of the type resulting from combining the
specified quadratic loss function with a first order approximation
to the model’s equilibrium conditions. The reason is that the
first order state-space representation is used to compute the
unconditional (co)-variances. Hence, ``osr`` will automatically
select ``order=1``. Third, because the objective involves
minimizing a weighted sum of unconditional second moments, those
second moments must be finite. In particular, unit roots in
:math:`y` are not allowed.
|br| This command computes the First Order Conditions for maximizing
the policy maker objective function subject to the constraints
provided by the equilibrium path of the private economy.
The subset of the model parameters over which the optimal simple
rule is to be optimized, :math:`\gamma`, must be listed with
``osr_params``.
The planner objective must be declared with the :comm:`planner_objective` command.
The weighting matrix :math:`W` used for the quadratic objective
function is specified in the ``optim_weights`` block. By attaching
weights to endogenous variables, the subset of endogenous
variables entering the objective function, :math:`y`, is
implicitly specified.
This command only creates the expanded model, it doesn’t perform
any computations. It needs to be followed by other instructions to
actually perform desired computations. Examples are calls to ``steady``
to compute the steady state of the Ramsey economy, to ``stoch_simul``
with various approximation orders to conduct stochastic simulations based on
perturbation solutions, to ``estimation`` in order to estimate models
under optimal policy with commitment, and to perfect foresight simulation
routines.
The linear quadratic problem is solved using the numerical
optimizer specified with :opt:`opt_algo <opt_algo = INTEGER>`.
See :ref:`aux-variables`, for an explanation of how Lagrange
multipliers are automatically created.
*Options*
The ``osr`` command will subsequently run ``stoch_simul`` and
accepts the same options, including restricting the endogenous
variables by listing them after the command, as ``stoch_simul``
(see :ref:`stoch-sol`) plus
.. option:: opt_algo = INTEGER
Specifies the optimizer for minimizing the objective
function. The same solvers as for ``mode_compute`` (see
:opt:`mode_compute <mode_compute = INTEGER | FUNCTION_NAME>`)
are available, except for ``5``, ``6``, and ``10``.
This command accepts the following options:
.. option:: optim = (NAME, VALUE, ...)
.. option:: planner_discount = EXPRESSION
A list of NAME`` and VALUE pairs. Can be used to set options
for the optimization routines. The set of available options
depends on the selected optimization routine (i.e. on the
value of option :opt:`opt_algo <opt_algo = INTEGER>`). See
:opt:`optim <optim = (NAME, VALUE, ...)>`.
Declares or reassigns the discount factor of the central
planner ``optimal_policy_discount_factor``. Default: ``1.0``.
.. option:: maxit = INTEGER
.. option:: planner_discount_latex_name = LATEX_NAME
Determines the maximum number of iterations used in
``opt_algo=4``. This option is now deprecated and will be
removed in a future release of Dynare. Use ``optim`` instead
to set optimizer-specific values. Default: ``1000``.
Sets the LaTeX name of the ``optimal_policy_discount_factor``
parameter.
.. option:: tolf = DOUBLE
.. option:: instruments = (VARIABLE_NAME,...)
Convergence criterion for termination based on the function
value used in ``opt_algo=4``. Iteration will cease when it
proves impossible to improve the function value by more than
tolf. This option is now deprecated and will be removed in a
future release of Dynare. Use ``optim`` instead to set
optimizer-specific values. Default: ``e-7``.
Declares instrument variables for the computation of the
steady state under optimal policy. Requires a
``steady_state_model`` block or a ``_steadystate.m`` file. See
below.
.. option:: silent_optimizer
*Steady state*
See :opt:`silent_optimizer`.
Dynare takes advantage of the fact that the Lagrange multipliers
appear linearly in the equations of the steady state of the model
under optimal policy. Nevertheless, it is in general very
difficult to compute the steady state with simply a numerical
guess in ``initval`` for the endogenous variables.
.. option:: huge_number = DOUBLE
It greatly facilitates the computation, if the user provides an
analytical solution for the steady state (in
``steady_state_model`` block or in a ``_steadystate.m`` file). In
this case, it is necessary to provide a steady state solution
CONDITIONAL on the value of the instruments in the optimal policy
problem and declared with the option ``instruments``. The initial value
of the instrument for steady state finding in this case is set with
``initval``. Note that computing and displaying steady state values
using the ``steady``-command or calls to ``resid`` must come after
the ``ramsey_model`` statement and the ``initval``-block.
Value for replacing the infinite bounds on parameters by
finite numbers. Used by some optimizers for numerical reasons
(see :opt:`huge_number <huge_number = DOUBLE>`). Users need to
make sure that the optimal parameters are not larger than this
value. Default: ``1e7``.
Note that choosing the instruments is partly a matter of interpretation and
you can choose instruments that are handy from a mathematical
point of view but different from the instruments you would refer
to in the analysis of the paper. A typical example is choosing
inflation or nominal interest rate as an instrument.
The value of the objective is stored in the variable
``oo_.osr.objective_function`` and the value of parameters at the
optimum is stored in ``oo_.osr.optim_params``. See below for more
details.
After running ``osr`` the parameters entering the simple rule will
be set to their optimal value so that subsequent runs of
``stoch_simul`` will be conducted at these values.
.. block:: ramsey_constraints ;
|br| This block lets you define constraints on the variables in
the Ramsey problem. The constraints take the form of a variable,
an inequality operator (> or <) and a constant.
.. command:: osr_params PARAMETER_NAME...;
*Example*
|br| This command declares parameters to be optimized by ``osr``.
::
.. block:: optim_weights ;
ramsey_constraints;
i > 0;
end;
|br| This block specifies quadratic objectives for optimal policy problems.
.. command:: evaluate_planner_objective ;
More precisely, this block specifies the nonzero elements of the
weight matrix :math:`W` used in the quadratic form of the
This command computes, displays, and stores the value of the
planner objective function
under Ramsey policy in ``oo_.planner_objective_value``, given the
initial values of the endogenous state variables. If not specified
with ``histval``, they are taken to be at their steady state
values. The result is a 1 by 2 vector, where the first entry
stores the value of the planner objective when the initial
Lagrange multipliers associated with the planner’s problem are set
to their steady state values (see :comm:`ramsey_policy`).
In contrast, the second entry stores the value of the planner
objective with initial Lagrange multipliers of the planner’s
problem set to 0, i.e. it is assumed that the planner exploits its
ability to surprise private agents in the first period of
implementing Ramsey policy. This is the value of implementating
optimal policy for the first time and committing not to
re-optimize in the future.
Because it entails computing at least a second order approximation, the
computation of the planner objective value is skipped with a message when
the model is too large (more than 180 state variables, including lagged
Lagrange multipliers).
.. command:: ramsey_policy [VARIABLE_NAME...];
ramsey_policy (OPTIONS...) [VARIABLE_NAME...];
|br| This command is formally equivalent to the calling sequence
::
ramsey_model;
stoch_simul(order=1);
evaluate_planner_objective;
It computes the first order approximation of the
policy that maximizes the policy maker’s objective function
subject to the constraints provided by the equilibrium path of the
private economy and under commitment to this optimal policy. The
Ramsey policy is computed by approximating the equilibrium system
around the perturbation point where the Lagrange multipliers are
at their steady state, i.e. where the Ramsey planner acts as if
the initial multipliers had been set to 0 in the distant past,
giving them time to converge to their steady state
value. Consequently, the optimal decision rules are computed
around this steady state of the endogenous variables and the
Lagrange multipliers.
This first order approximation to the optimal policy conducted by
Dynare is not to be confused with a naive linear quadratic
approach to optimal policy that can lead to spurious welfare
rankings (see *Kim and Kim (2003)*). In the latter, the optimal
policy would be computed subject to the first order approximated
FOCs of the private economy. In contrast, Dynare first computes
the FOCs of the Ramsey planner’s problem subject to the nonlinear
constraints that are the FOCs of the private economy and only then
approximates these FOCs of planner’s problem to first
order. Thereby, the second order terms that are required for a
second-order correct welfare evaluation are preserved.
Note that the variables in the list after the ``ramsey_policy``
command can also contain multiplier names. In that case, Dynare
will for example display the IRFs of the respective multipliers
when ``irf>0``.
The planner objective must be declared with the :comm:`planner_objective` command.
*Options*
This command accepts all options of ``stoch_simul``, plus:
.. option:: planner_discount = EXPRESSION
See :opt:`planner_discount <planner_discount = EXPRESSION>`.
.. option:: instruments = (VARIABLE_NAME,...)
Declares instrument variables for the computation of the
steady state under optimal policy. Requires a
``steady_state_model`` block or a ``_steadystate.m`` file. See
below.
Note that only a first order approximation of the optimal Ramsey
policy is available, leading to a second-order accurate welfare
ranking (i.e. ``order=1`` must be specified).
*Output*
This command generates all the output variables of
``stoch_simul``. For specifying the initial values for the
endogenous state variables (except for the Lagrange multipliers),
see :bck:`histval`.
*Steady state*
See :comm:`Ramsey steady state <ramsey_model>`.
Optimal policy under discretion
-------------------------------
.. command:: discretionary_policy [VARIABLE_NAME...];
discretionary_policy (OPTIONS...) [VARIABLE_NAME...];
|br| This command computes an approximation of the optimal policy
under discretion. The algorithm implemented is essentially an LQ
solver, and is described by *Dennis (2007)*.
You should ensure that your model is linear and your objective is
quadratic. Also, you should set the ``linear`` option of the
``model`` block.
It is possible to use the :comm:`estimation` command after the
``discretionary_policy`` command, in order to estimate the model with
optimal policy under discretion.
*Options*
This command accepts the same options as ``ramsey_policy``, plus:
.. option:: discretionary_tol = NON-NEGATIVE DOUBLE
Sets the tolerance level used to assess convergence of the
solution algorithm. Default: ``1e-7``.
.. option:: maxit = INTEGER
Maximum number of iterations. Default: ``3000``.
Optimal Simple Rules (OSR)
--------------------------
.. command:: osr [VARIABLE_NAME...];
osr (OPTIONS...) [VARIABLE_NAME...];
|br| This command computes optimal simple policy rules for
linear-quadratic problems of the form:
.. math::
\min_\gamma E(y'_tWy_t)
such that:
.. math::
A_1 E_ty_{t+1}+A_2 y_t+ A_3 y_{t-1}+C e_t=0
where:
* :math:`E` denotes the unconditional expectations operator;
* :math:`\gamma` are parameters to be optimized. They must be
elements of the matrices :math:`A_1`, :math:`A_2`,
:math:`A_3`, i.e. be specified as parameters in the
``params`` command and be entered in the ``model`` block;
* :math:`y` are the endogenous variables, specified in the
``var`` command, whose (co)-variance enters the loss
function;
* :math:`e` are the exogenous stochastic shocks, specified in
the ``varexo``- ommand;
* :math:`W` is the weighting matrix;
The linear quadratic problem consists of choosing a subset of
model parameters to minimize the weighted (co)-variance of a
specified subset of endogenous variables, subject to a linear law
of motion implied by the first order conditions of the model. A
few things are worth mentioning. First, :math:`y` denotes the
selected endogenous variables’ deviations from their steady state,
i.e. in case they are not already mean 0 the variables entering
the loss function are automatically demeaned so that the centered
second moments are minimized. Second, ``osr`` only solves linear
quadratic problems of the type resulting from combining the
specified quadratic loss function with a first order approximation
to the model’s equilibrium conditions. The reason is that the
first order state-space representation is used to compute the
unconditional (co)-variances. Hence, ``osr`` will automatically
select ``order=1``. Third, because the objective involves
minimizing a weighted sum of unconditional second moments, those
second moments must be finite. In particular, unit roots in
:math:`y` are not allowed.
The subset of the model parameters over which the optimal simple
rule is to be optimized, :math:`\gamma`, must be listed with
``osr_params``.
The weighting matrix :math:`W` used for the quadratic objective
function is specified in the ``optim_weights`` block. By attaching
weights to endogenous variables, the subset of endogenous
variables entering the objective function, :math:`y`, is
implicitly specified.
The linear quadratic problem is solved using the numerical
optimizer specified with :opt:`opt_algo <opt_algo = INTEGER>`.
*Options*
The ``osr`` command will subsequently run ``stoch_simul`` and
accepts the same options, including restricting the endogenous
variables by listing them after the command, as ``stoch_simul``
(see :ref:`stoch-sol`) plus
.. option:: opt_algo = INTEGER
Specifies the optimizer for minimizing the objective
function. The same solvers as for ``mode_compute`` (see
:opt:`mode_compute <mode_compute = INTEGER | FUNCTION_NAME>`)
are available, except for ``5``, ``6``, and ``10``.
.. option:: optim = (NAME, VALUE, ...)
A list of NAME`` and VALUE pairs. Can be used to set options
for the optimization routines. The set of available options
depends on the selected optimization routine (i.e. on the
value of option :opt:`opt_algo <opt_algo = INTEGER>`). See
:opt:`optim <optim = (NAME, VALUE, ...)>`.
.. option:: maxit = INTEGER
Determines the maximum number of iterations used in
``opt_algo=4``. This option is now deprecated and will be
removed in a future release of Dynare. Use ``optim`` instead
to set optimizer-specific values. Default: ``1000``.
.. option:: tolf = DOUBLE
Convergence criterion for termination based on the function
value used in ``opt_algo=4``. Iteration will cease when it
proves impossible to improve the function value by more than
tolf. This option is now deprecated and will be removed in a
future release of Dynare. Use ``optim`` instead to set
optimizer-specific values. Default: ``e-7``.
.. option:: silent_optimizer
See :opt:`silent_optimizer`.
.. option:: huge_number = DOUBLE
Value for replacing the infinite bounds on parameters by
finite numbers. Used by some optimizers for numerical reasons
(see :opt:`huge_number <huge_number = DOUBLE>`). Users need to
make sure that the optimal parameters are not larger than this
value. Default: ``1e7``.
The value of the objective is stored in the variable
``oo_.osr.objective_function`` and the value of parameters at the
optimum is stored in ``oo_.osr.optim_params``. See below for more
details.
After running ``osr`` the parameters entering the simple rule will
be set to their optimal value so that subsequent runs of
``stoch_simul`` will be conducted at these values.
.. command:: osr_params PARAMETER_NAME...;
|br| This command declares parameters to be optimized by ``osr``.
.. block:: optim_weights ;
|br| This block specifies quadratic objectives for optimal policy problems.
More precisely, this block specifies the nonzero elements of the
weight matrix :math:`W` used in the quadratic form of the
objective function in ``osr``.
An element of the diagonal of the weight matrix is given by a line
......@@ -8382,218 +8791,6 @@ with ``discretionary_policy`` or for optimal simple rule with ``osr``
``M_.endo_names``.
.. command:: ramsey_model (OPTIONS...);
|br| This command computes the First Order Conditions for maximizing
the policy maker objective function subject to the constraints
provided by the equilibrium path of the private economy.
The planner objective must be declared with the
``planner_objective`` command.
This command only creates the expanded model, it doesn’t perform
any computations. It needs to be followed by other instructions to
actually perform desired computations. Note that it is the only
way to perform perfect foresight simulation of the Ramsey policy
problem.
See :ref:`aux-variables`, for an explanation of how Lagrange
multipliers are automatically created.
*Options*
This command accepts the following options:
.. option:: planner_discount = EXPRESSION
Declares or reassigns the discount factor of the central
planner ``optimal_policy_discount_factor``. Default: ``1.0``.
.. option:: planner_discount_latex_name = LATEX_NAME
Sets the LaTeX name of the ``optimal_policy_discount_factor``
parameter.
.. option:: instruments = (VARIABLE_NAME,...)
Declares instrument variables for the computation of the
steady state under optimal policy. Requires a
``steady_state_model`` block or a ``_steadystate.m`` file. See
below.
*Steady state*
Dynare takes advantage of the fact that the Lagrange multipliers
appear linearly in the equations of the steady state of the model
under optimal policy. Nevertheless, it is in general very
difficult to compute the steady state with simply a numerical
guess in ``initval`` for the endogenous variables.
It greatly facilitates the computation, if the user provides an
analytical solution for the steady state (in
``steady_state_model`` block or in a ``_steadystate.m`` file). In
this case, it is necessary to provide a steady state solution
CONDITIONAL on the value of the instruments in the optimal policy
problem and declared with option ``instruments``. Note that
choosing the instruments is partly a matter of interpretation and
you can choose instruments that are handy from a mathematical
point of view but different from the instruments you would refer
to in the analysis of the paper. A typical example is choosing
inflation or nominal interest rate as an instrument.
.. block:: ramsey_constraints ;
|br| This block lets you define constraints on the variables in
the Ramsey problem. The constraints take the form of a variable,
an inequality operator (> or <) and a constant.
*Example*
::
ramsey_constraints;
i > 0;
end;
.. command:: ramsey_policy [VARIABLE_NAME...];
ramsey_policy (OPTIONS...) [VARIABLE_NAME...];
|br| This command computes the first order approximation of the
policy that maximizes the policy maker’s objective function
subject to the constraints provided by the equilibrium path of the
private economy and under commitment to this optimal policy. The
Ramsey policy is computed by approximating the equilibrium system
around the perturbation point where the Lagrange multipliers are
at their steady state, i.e. where the Ramsey planner acts as if
the initial multipliers had been set to 0 in the distant past,
giving them time to converge to their steady state
value. Consequently, the optimal decision rules are computed
around this steady state of the endogenous variables and the
Lagrange multipliers.
This first order approximation to the optimal policy conducted by
Dynare is not to be confused with a naive linear quadratic
approach to optimal policy that can lead to spurious welfare
rankings (see *Kim and Kim (2003)*). In the latter, the optimal
policy would be computed subject to the first order approximated
FOCs of the private economy. In contrast, Dynare first computes
the FOCs of the Ramsey planner’s problem subject to the nonlinear
constraints that are the FOCs of the private economy and only then
approximates these FOCs of planner’s problem to first
order. Thereby, the second order terms that are required for a
second-order correct welfare evaluation are preserved.
Note that the variables in the list after the ``ramsey_policy``
command can also contain multiplier names. In that case, Dynare
will for example display the IRFs of the respective multipliers
when ``irf>0``.
The planner objective must be declared with the planner_objective command.
See :ref:`aux-variables`, for an explanation of how this operator
is handled internally and how this affects the output.
*Options*
This command accepts all options of ``stoch_simul``, plus:
.. option:: planner_discount = EXPRESSION
See :opt:`planner_discount <planner_discount = EXPRESSION>`.
.. option:: instruments = (VARIABLE_NAME,...)
Declares instrument variables for the computation of the
steady state under optimal policy. Requires a
``steady_state_model`` block or a ``_steadystate.m`` file. See
below.
Note that only a first order approximation of the optimal Ramsey
policy is available, leading to a second-order accurate welfare
ranking (i.e. ``order=1`` must be specified).
*Output*
This command generates all the output variables of
``stoch_simul``. For specifying the initial values for the
endogenous state variables (except for the Lagrange multipliers),
see :bck:`histval`.
.. _plan-obj:
In addition, it stores the value of planner objective function
under Ramsey policy in ``oo_.planner_objective_value``, given the
initial values of the endogenous state variables. If not specified
with ``histval``, they are taken to be at their steady state
values. The result is a 1 by 2 vector, where the first entry
stores the value of the planner objective when the initial
Lagrange multipliers associated with the planner’s problem are set
to their steady state values (see :comm:`ramsey_policy`).
In contrast, the second entry stores the value of the planner
objective with initial Lagrange multipliers of the planner’s
problem set to 0, i.e. it is assumed that the planner exploits its
ability to surprise private agents in the first period of
implementing Ramsey policy. This is the value of implementating
optimal policy for the first time and committing not to
re-optimize in the future.
Because it entails computing at least a second order approximation, the
computation of the planner objective value is skipped with a message when
the model is too large (more than 180 state variables, including lagged
Lagrange multipliers).
*Steady state*
See :comm:`Ramsey steady state <ramsey_model>`.
.. command:: discretionary_policy [VARIABLE_NAME...];
discretionary_policy (OPTIONS...) [VARIABLE_NAME...];
|br| This command computes an approximation of the optimal policy
under discretion. The algorithm implemented is essentially an LQ
solver, and is described by *Dennis (2007)*.
You should ensure that your model is linear and your objective is
quadratic. Also, you should set the ``linear`` option of the
``model`` block.
*Options*
This command accepts the same options than ``ramsey_policy``, plus:
.. option:: discretionary_tol = NON-NEGATIVE DOUBLE
Sets the tolerance level used to assess convergence of the
solution algorithm. Default: ``1e-7``.
.. option:: maxit = INTEGER
Maximum number of iterations. Default: ``3000``.
.. command:: planner_objective MODEL_EXPRESSION ;
|br| This command declares the policy maker objective, for use
with ``ramsey_policy`` or ``discretionary_policy``.
You need to give the one-period objective, not the discounted
lifetime objective. The discount factor is given by the
``planner_discount`` option of ``ramsey_policy`` and
``discretionary_policy``. The objective function can only contain
current endogenous variables and no exogenous ones. This
limitation is easily circumvented by defining an appropriate
auxiliary variable in the model.
With ``ramsey_policy``, you are not limited to quadratic
objectives: you can give any arbitrary nonlinear expression.
With ``discretionary_policy``, the objective function must be quadratic.
Sensitivity and identification analysis
=======================================
......@@ -9010,14 +9207,27 @@ Performing identification analysis
* reduced-form solution and linear rational expectation model
as in *Ratto and Iskrev (2011)*
2. Identification strength analysis based on sample information matrix as in
*Ratto and Iskrev (2011)*
Note that for orders 2 and 3, all identification checks are based on the pruned
state space system as in *Mutschler (2015)*. That is, theoretical moments and
spectrum are computed from the pruned ABCD-system, whereas the minimal system
criteria is based on the first-order system, but augmented by the theoretical
(pruned) mean at order 2 or 3.
2. Identification strength analysis based on (theoretical or simulated) curvature of
moment information matrix as in *Ratto and Iskrev (2011)*
3. Parameter checks based on nullspace and multicorrelation coefficients to
determine which (combinations of) parameters are involved
*General Options*
.. option:: order = 1|2|3
Order of approximation. At orders 2 and 3 identification is based on the
pruned state space system. Note that the order set in other functions does
not overwrite the default.
Default: ``1``.
.. option:: parameter_set = OPTION
See :opt:`parameter_set <parameter_set = OPTION>` for
......@@ -9075,13 +9285,15 @@ Performing identification analysis
* ``0``: efficient sylvester equation method to compute
analytical derivatives
* ``1``: kronecker products method to compute analytical
derivatives
derivatives (only at order=1)
* ``-1``: numerical two-sided finite difference method
to compute all identification Jacobians
to compute all identification Jacobians (numerical tolerance
level is equal to ``options_.dynatol.x``)
* ``-2``: numerical two-sided finite difference method
to compute derivatives of steady state and dynamic
model numerically, the identification Jacobians are
then computed analytically
then computed analytically (numerical tolerance
level is equal to ``options_.dynatol.x``)
Default: ``0``.
......@@ -9152,7 +9364,7 @@ Performing identification analysis
.. option:: no_identification_spectrum
Disables computations of identification check based on
Qu and Tkachenko (2012)'s G, i.e. Gram matrix of derivatives of
*Qu and Tkachenko (2012)*'s G, i.e. Gram matrix of derivatives of
first moment plus outer product of derivatives of spectral density.
.. option:: grid_nbr = INTEGER
......@@ -9166,7 +9378,7 @@ Performing identification analysis
.. option:: no_identification_minimal
Disables computations of identification check based on
Komunjer and Ng (2011)'s D, i.e. minimal state space system
*Komunjer and Ng (2011)*'s D, i.e. minimal state space system
and observational equivalent spectral density transformations.
*Misc Options*
......@@ -10448,6 +10660,48 @@ below.
See :opt:`regimes`.
.. _epilogue:
Epilogue Variables
==================
.. block:: epilogue ;
The epilogue block is useful for computing output variables of interest that
may not be necessarily defined in the model (e.g. various kinds of real/nominal
shares or relative prices, or annualized variables out of a quarterly model).
It can also provide several advantages in terms of computational efficiency and
flexibility:
- You can calculate variables in the epilogue block after smoothers/simulations
have already been run without adding the new definitions and equations and
rerunning smoothers/simulations. Even posterior smoother subdraws can be
recycled for computing epilogue variables without rerunning subdraws with the
new definitions and equations.
- You can also reduce the state space dimension in data
filtering/smoothing. Assume, for example, you want annualized variables as
outputs. If you define an annual growth rate in a quarterly model, you need
lags up to order 7 of the associated quarterly variable; in a medium/large
scale model this would just blow up the state dimension and increase by a
huge amount the computing time of a smoother.
The ``epilogue`` block is terminated by ``end;`` and contains lines of the
form:
NAME = EXPRESSION;
*Example*
::
epilogue;
// annualized level of y
ya = exp(y)+exp(y(-1))+exp(y(-2))+exp(y(-3));
// annualized growth rate of y
gya = ya/ya(-4)-1;
end;
Displaying and saving results
=============================
......@@ -10464,20 +10718,20 @@ Dynare has comments to plot the results of a simulation and to save the results.
.. command:: dynatype (FILENAME) [VARIABLE_NAME...];
|br| This command prints the listed variables in a text file named
|br| This command prints the listed endogenous or exogenous variables in a text file named
FILENAME. If no VARIABLE_NAME is listed, all endogenous variables
are printed.
.. command:: dynasave (FILENAME) [VARIABLE_NAME...];
|br| This command saves the listed variables in a binary file
named FILENAME. If no VARIABLE_NAME are listed, all endogenous
|br| This command saves the listed endogenous or exogenous variables in a binary file
named FILENAME. If no VARIABLE_NAME is listed, all endogenous
variables are saved.
In MATLAB or Octave, variables saved with the ``dynasave command``
In MATLAB or Octave, variables saved with the ``dynasave`` command
can be retrieved by the command::
load -mat FILENAME
load(FILENAME,'-mat')
.. _macro-proc-lang:
......@@ -10611,6 +10865,8 @@ The following operators can be used on arrays:
* Comparison operators: ``==, !=``
* Dereferencing: if ``v`` is an array, then ``v[2]`` is its 2nd element
* Concatenation of two arrays: ``+``
* Set union of two arrays: ``|``
* Set intersection of two arrays: ``&``
* Difference ``-``: returns the first operand from which the
elements of the second operand have been removed.
* Cartesian product of two arrays: ``*``
......@@ -10836,8 +11092,8 @@ Macro directives
@#ifdef MACRO_VARIABLE
@#ifndef MACRO_VARIABLE
@#elseif MACRO_EXPRESSION
@#else
@#endif
@#else
@#endif
|br| Conditional inclusion of some part of the ``.mod`` file. The lines
between ``@#if``, ``@#ifdef``, or ``@#ifndef`` and the next ``@#elseif``,
......@@ -10925,7 +11181,7 @@ Macro directives
@#for MACRO_VARIABLE in MACRO_EXPRESSION when MACRO_EXPRESSION
@#for MACRO_TUPLE in MACRO_EXPRESSION
@#for MACRO_TUPLE in MACRO_EXPRESSION when MACRO_EXPRESSION
@#endfor
@#endfor
|br| Loop construction for replicating portions of the ``.mod``
file. Note that this construct can enclose variable/parameters
......@@ -10998,7 +11254,7 @@ Macro directives
|br| Asks the preprocessor to display some error message on standard
output and to abort. The argument must evaluate to a string.
.. macrodir:: @#echomacrovars
.. macrodir:: @#echomacrovars
@#echomacrovars MACRO_VARIABLE_LIST
@#echomacrovars(save) MACRO_VARIABLE_LIST
......@@ -11432,7 +11688,7 @@ Misc commands
and ``morefloats``.
.. _Dynare wiki: https://archives.dynare.org/DynareWiki/EquationsTags
.. _Dynare wiki: https://archives.dynare.org/DynareWiki/
.. _io: https://octave.sourceforge.io/io/
.. _AIM website: https://www.federalreserve.gov/econres/ama-index.htm
......
......@@ -24,12 +24,11 @@ Dates in a mod file
-------------------
Dynare understands dates in a mod file. Users can declare annual,
quarterly, monthly or weekly dates using the following syntax::
quarterly, or monthly dates using the following syntax::
1990Y
1990Q3
1990M11
1990W49
Behind the scene, Dynare’s preprocessor translates these expressions
into instantiations of the MATLAB/Octave’s class ``dates`` described
......@@ -165,14 +164,13 @@ The dates class
.. class:: dates
:arg int freq: equal to 1, 4, 12 or 52 (resp. for annual,
quarterly, monthly or weekly dates).
:arg int freq: equal to 1, 4, or 12 (resp. for annual,
quarterly, or monthly dates).
:arg int ndat: the number of declared dates in the object.
:arg int time: a ``ndat*2`` array, the years are stored in the
first column, the subperiods (1 for annual dates,
1-4 for quarterly dates, 1-12 for monthly dates and
1-52 for weekly dates) are stored in the second
column.
1-4 for quarterly dates, and 1-12 for monthly
dates) are stored in the second column.
Each member is private, one can display the content of a member
but cannot change its value directly. Note that it is not possible
......@@ -187,14 +185,14 @@ The dates class
|br| Returns an empty ``dates`` object with a given frequency
(if the constructor is called with one input
argument). ``FREQ`` is a character equal to ’Y’ or ’A’ for
annual dates, ’Q’ for quarterly dates, ’M’ for monthly dates
or ’W’ for weekly dates. Note that ``FREQ`` is not case
sensitive, so that, for instance, ’q’ is also allowed for
quarterly dates. The frequency can also be set with an integer
scalar equal to 1 (annual), 4 (quarterly), 12 (monthly) or 52
(weekly). The instantiation of empty objects can be used to
rename the ``dates`` class. For instance, if one only works
with quarterly dates, object ``qq`` can be created as::
annual dates, ’Q’ for quarterly dates, or ’M’ for monthly
dates. Note that ``FREQ`` is not case sensitive, so that, for
instance, ’q’ is also allowed for quarterly dates. The
frequency can also be set with an integer scalar equal to 1
(annual), 4 (quarterly), or 12 (monthly). The instantiation of
empty objects can be used to rename the ``dates`` class. For
instance, if one only works with quarterly dates, object
``qq`` can be created as::
qq = dates('Q')
......@@ -213,11 +211,11 @@ The dates class
given by the string ``STRING``. This string has to be
interpretable as a date (only strings of the following forms
are admitted: ``'1990Y'``, ``'1990A'``, ``'1990Q1'``,
``'1990M2'``, ``'1990W5'``), the routine ``isdate`` can be
used to test if a string is interpretable as a date. If more
than one argument is provided, they should all be dates
represented as strings, the resulting ``dates`` object
contains as many elements as arguments to the constructor.
``'1990M2'``), the routine ``isdate`` can be used to test if a
string is interpretable as a date. If more than one argument
is provided, they should all be dates represented as strings,
the resulting ``dates`` object contains as many elements as
arguments to the constructor.
.. construct:: dates(DATES)
......@@ -233,13 +231,13 @@ The dates class
.. construct:: dates (FREQ, YEAR, SUBPERIOD)
|br| where ``FREQ`` is a single character (’Y’, ’A’, ’Q’, ’M’,
’W’) or integer (1, 4, 12 or 52) specifying the frequency,
``YEAR`` and ``SUBPERIOD`` are ``n*1`` vectors of
integers. Returns a ``dates`` object with ``n`` elements. If
``FREQ`` is equal to ``'Y'``, ``'A'`` or ``1``, the third
argument is not needed (because ``SUBPERIOD`` is necessarily a
vector of ones in this case).
|br| where ``FREQ`` is a single character (’Y’, ’A’, ’Q’, ’M’)
or integer (1, 4, or 12) specifying the frequency, ``YEAR``
and ``SUBPERIOD`` are ``n*1`` vectors of integers. Returns a
``dates`` object with ``n`` elements. If ``FREQ`` is equal to
``'Y'``, ``'A'`` or ``1``, the third argument is not needed
(because ``SUBPERIOD`` is necessarily a vector of ones in this
case).
*Example*
......@@ -253,22 +251,44 @@ The dates class
A list of the available methods, by alphabetical order, is given
below. Note that the MATLAB/Octave classes do not allow in place
below. Note that by default the methods do not allow in place
modifications: when a method is applied to an object a new object
is instantiated. For instance, to apply the method
``multiplybytwo`` to an object ``X`` we write::
Y = X.multiplybytwo()
>> X = 2;
>> Y = X.multiplybytwo();
>> X
2
>> Y
4
or equivalently::
Y = multiplybytwo(X)
>> Y = multiplybytwo(X);
the object ``X`` is left unchanged, and the object ``Y`` is a
modified copy of ``X``.
modified copy of ``X`` (multiplied by two). This behaviour is
altered if the name of the method is postfixed with an
underscore. In this case the creation of a copy is avoided. For
instance, following the previous example, we would have::
>> X = 2;
>> X.multiplybytwo_();
>> X
4
Modifying the objects in place, with underscore methods, is
particularly useful if the methods are called in loops, since this
saves the object instantiation overhead.
.. datesmethod:: C = append (A, B)
C = append_ (A, B)
|br| Appends ``dates`` object ``B``, or a string that can be
interpreted as a date, to the ``dates`` object ``A``. If ``B``
......@@ -282,15 +302,41 @@ The dates class
>> D = dates('1950Q1','1950Q2');
>> d = dates('1950Q3');
>> E = D.append(d);
>> F = D.append('1950Q3')
>> F = D.append('1950Q3');
>> isequal(E,F)
ans =
1
>> F
F = <dates: 1950Q1, 1950Q2, 1950Q3>
>> D
D = <dates: 1950Q1, 1950Q2>
>> D.append_('1950Q3')
ans = <dates: 1950Q1, 1950Q2, 1950Q3>
.. datesmethod:: B = char (A)
|br| Overloads the MATLAB/Octave ``char`` function. Converts a
``dates`` object into a character array.
*Example*
::
>> A = dates('1950Q1');
> A.char()
ans =
'1950Q1'
.. datesmethod:: C = colon (A, B)
C = colon (A, i, B)
......@@ -307,11 +353,42 @@ The dates class
>> A = dates('1950Q1');
>> B = dates('1951Q2');
>> C = A:B
C = <dates: 1950Q1, 1950Q2, 1950Q3, 1950Q4, 1951Q1>
>> D = A:2:B
D = <dates: 1950Q1, 1950Q3, 1951Q1>
.. datesmethod:: B = copy (A)
|br| Returns a copy of a ``dates`` object.
.. datesmethod:: disp (A)
|br| Overloads the MATLAB/Octave disp function for ``dates`` object.
.. datesmethod:: display (A)
|br| Overloads the MATLAB/Octave display function for ``dates`` object.
*Example*
::
>> disp(B)
B = <dates: 1950Q1, 1950Q2, 1950Q3, 1950Q4, 1951Q1, 1951Q2, 1951Q3, 1951Q4, 1952Q1, 1952Q2, 1952Q3>
>> display(B)
B = <dates: 1950Q1, 1950Q2, ..., 1952Q2, 1952Q3>
.. datesmethod:: B = double (A)
|br| Overloads the MATLAB/Octave ``double`` function. ``A`` is
......@@ -319,8 +396,7 @@ The dates class
representation of a ``dates`` object, the integer and
fractional parts respectively corresponding to the year and
the subperiod. The fractional part is the subperiod number
minus one divided by the frequency (``1``, ``4``, ``12`` or
``52``).
minus one divided by the frequency (``1``, ``4``, or ``12``).
*Example*:
......@@ -342,8 +418,8 @@ The dates class
|br| Overloads the MATLAB/Octave ``eq`` (equal, ``==``)
operator. ``dates`` objects ``A`` and ``B`` must have the same
number of elements (say, ``n``). The returned argument is a
``n`` by ``1`` vector of zeros and ones. The i-th element of
``C`` is equal to ``1`` if and only if the dates ``A(i)`` and
``n`` by ``1`` vector of logicals. The i-th element of
``C`` is equal to ``true`` if and only if the dates ``A(i)`` and
``B(i)`` are the same.
*Example*
......@@ -356,6 +432,8 @@ The dates class
ans =
2x1 logical array
1
0
......@@ -365,8 +443,8 @@ The dates class
|br| Overloads the MATLAB/Octave ``ge`` (greater or equal,
``>=``) operator. ``dates`` objects ``A`` and ``B`` must have
the same number of elements (say, ``n``). The returned
argument is a ``n`` by ``1`` vector of zeros and ones. The
i-th element of ``C`` is equal to ``1`` if and only if the
argument is a ``n`` by ``1`` vector of logicals. The
i-th element of ``C`` is equal to ``true`` if and only if the
date ``A(i)`` is posterior or equal to the date ``B(i)``.
*Example*
......@@ -379,6 +457,8 @@ The dates class
ans =
2x1 logical array
1
1
......@@ -388,7 +468,7 @@ The dates class
|br| Overloads the MATLAB/Octave ``gt`` (greater than, ``>``)
operator. ``dates`` objects ``A`` and ``B`` must have the same
number of elements (say, ``n``). The returned argument is a
``n`` by ``1`` vector of zeros and ones. The i-th element of
``n`` by ``1`` vector of logicals. The i-th element of
``C`` is equal to ``1`` if and only if the date ``A(i)`` is
posterior to the date ``B(i)``.
......@@ -402,6 +482,8 @@ The dates class
ans =
2x1 logical array
0
1
......@@ -421,6 +503,7 @@ The dates class
>> B = dates('1950Q2');
>> C = [A, B];
>> C
C = <dates: 1950Q1, 1950Q2>
......@@ -442,63 +525,53 @@ The dates class
>> B = dates('1951Q1'):dates('1951Q4');
>> C = intersect(A, B);
>> C
C = <dates: 1951Q1, 1951Q2, 1951Q3, 1951Q4>
.. datesmethod:: C = setdiff (A, B)
.. datesmethod:: B = isempty (A)
|br| Overloads the MATLAB/Octave ``setdiff`` function. All the
input arguments must be ``dates`` objects. The returned
argument is a ``dates`` object all dates present in ``A`` but
not in ``B``. If ``A`` and ``B`` are disjoint ``dates``
objects, the function returns ``A``. Returned dates in
``dates`` object ``C`` are sorted by increasing order.
|br| Overloads the MATLAB/Octave ``isempty`` function.
*Example*
::
>> A = dates('1950Q1'):dates('1969Q4') ;
>> B = dates('1960Q1'):dates('1969Q4') ;
>> C = dates('1970Q1'):dates('1979Q4') ;
>> d1 = setdiff(d1,d2);
>> d2 = setdiff(d1,d3);
d1 = <dates: 1950Q1, 1950Q2, ..., 1959Q3, 1959Q4>
d2 = <dates: 1950Q1, 1950Q2, ..., 1969Q3, 1969Q4>
.. datesmethod:: B = isempty (A)
>> A = dates('1950Q1');
>> A.isempty()
|br| Overloads the MATLAB/Octave ``isempty`` function for ``dates``
objects``.
ans =
*Example*
logical
::
0
>> A = dates('1950Q1'):dates('1951Q4');
>> A.isempty()
>> B = dates();
>> B.isempty()
ans =
0
logical
1
.. datesmethod:: C = isequal (A, B)
|br| Overloads the MATLAB/Octave ``isequal`` function for
``dates`` objects.
|br| Overloads the MATLAB/Octave ``isequal`` function.
*Example*
::
>> A = dates('1950Q1'):dates('1951Q4');
>> isequal(A,A)
>> A = dates('1950Q1');
>> B = dates('1950Q2');
>> isequal(A, B)
ans =
1
logical
0
.. datesmethod:: C = le (A, B)
......@@ -506,9 +579,9 @@ The dates class
|br| Overloads the MATLAB/Octave ``le`` (less or equal,
``<=``) operator. ``dates`` objects ``A`` and ``B`` must have
the same number of elements (say, ``n``). The returned
argument is a ``n`` by ``1`` vector of zeros and ones. The
i-th element of ``C`` is equal to ``1`` if and only if the
date ``A(i)`` is not posterior to the date ``B(i)``.
argument is a ``n`` by ``1`` vector of logicals. The
i-th element of ``C`` is equal to ``true`` if and only if the
date ``A(i)`` is anterior or equal to the date ``B(i)``.
*Example*
......@@ -520,36 +593,37 @@ The dates class
ans =
2x1 logical array
1
0
.. datesmethod:: B = length (A)
|br| Overloads the MATLAB/Octave ``length`` function. Returns the
number of dates in ``dates`` object ``A`` (``B`` is a scalar
integer).
|br| Overloads the MATLAB/Octave ``length`` function. Returns
the number of elements in a ``dates`` object.
*Example*
::
>> A = dates('1950Q1','1951Q2');
>> A = dates('1950Q1'):dates(2000Q3);
>> A.length()
ans =
2
203
.. datesmethod:: C = lt (A, B)
|br| Overloads the MATLAB/Octave ``lt`` (less than, ``<``)
operator. ``dates`` objects ``A`` and ``B`` must have the same
number of elements (say, ``n``). The returned argument is a
``n`` by ``1`` vector of zeros and ones. The i-th element of
``C`` is equal to ``1`` if and only if the date ``A(i)``
preceeds the date ``B(i)``.
|br| Overloads the MATLAB/Octave ``lt`` (less than,
``<``) operator. ``dates`` objects ``A`` and ``B`` must have
the same number of elements (say, ``n``). The returned
argument is a ``n`` by ``1`` vector of logicals. The
i-th element of ``C`` is equal to ``true`` if and only if the
date ``A(i)`` is anterior or equal to the date ``B(i)``.
*Example*
......@@ -561,6 +635,8 @@ The dates class
ans =
2x1 logical array
0
0
......@@ -577,6 +653,7 @@ The dates class
>> A = {dates('1950Q2'), dates('1953Q4','1876Q2'), dates('1794Q3')};
>> max(A{:})
ans = <dates: 1953Q4>
......@@ -592,6 +669,7 @@ The dates class
>> A = {dates('1950Q2'), dates('1953Q4','1876Q2'), dates('1794Q3')};
>> min(A{:})
ans = <dates: 1794Q3>
......@@ -619,17 +697,35 @@ The dates class
0
>> d1-(-ee)
ans = <dates: 1950Q3, 1950Q4, 1960Q1>
.. datesmethod:: C = mtimes (A, B)
|br| Overloads the MATLAB/Octave ``mtimes`` operator
(``*``). ``A`` and ``B`` are respectively expected to be a
``dseries`` object and a scalar integer. Returns ``dates``
object ``A`` replicated ``B`` times.
*Example*
::
>> d = dates('1950Q1');
>> d*2
ans = <dates: 1950Q1, 1950Q1>
.. datesmethod:: C = ne (A, B)
|br| Overloads the MATLAB/Octave ``ne`` (not equal, ``~=``)
operator. ``dates`` objects ``A`` and ``B`` must have the same
number of elements (say, ``n``) or one of the inputs must be a
single element ``dates`` object. The returned argument is a
``n`` by ``1`` vector of zeros and ones. The i-th element of
``C`` is equal to ``1`` if and only if the dates ``A(i)`` and
``n`` by ``1`` vector of logicals. The i-th element of
``C`` is equal to ``true`` if and only if the dates ``A(i)`` and
``B(i)`` are different.
*Example*
......@@ -642,6 +738,8 @@ The dates class
ans =
2x1 logical array
0
1
......@@ -654,7 +752,7 @@ The dates class
``B`` is a vector of integers, the ``plus`` operator shifts
the ``dates`` object by ``B`` periods forward.
:ex:
*Example*
::
......@@ -674,6 +772,8 @@ The dates class
.. datesmethod:: C = pop (A)
C = pop (A, B)
C = pop_ (A)
C = pop_ (A, B)
|br| Pop method for ``dates`` class. If only one input is
provided, the method removes the last element of a ``dates``
......@@ -685,15 +785,58 @@ The dates class
::
>> d1 = dates('1950Q1','1950Q2');
>> d1.pop()
>> d = dates('1950Q1','1950Q2');
>> d.pop()
ans = <dates: 1950Q1>
>> d1.pop(1)
>> d.pop_(1)
ans = <dates: 1950Q2>
.. datesmethod:: C = remove (A, B)
C = remove_ (A, B)
|br| Remove method for ``dates`` class. Both inputs have to be ``dates`` objects, removes dates in ``B`` from ``A``.
*Example*
::
>> d = dates('1950Q1','1950Q2');
>> d.remove(dates('1950Q2'))
ans = <dates: 1950Q1>
.. datesmethod:: C = setdiff (A, B)
|br| Overloads the MATLAB/Octave ``setdiff`` function. All the
input arguments must be ``dates`` objects. The returned
argument is a ``dates`` object all dates present in ``A`` but
not in ``B``. If ``A`` and ``B`` are disjoint ``dates``
objects, the function returns ``A``. Returned dates in
``dates`` object ``C`` are sorted by increasing order.
*Example*
::
>> A = dates('1950Q1'):dates('1969Q4');
>> B = dates('1960Q1'):dates('1969Q4');
>> C = dates('1970Q1'):dates('1979Q4');
>> setdiff(A, B)
ans = <dates: 1950Q1, 1950Q2, ..., 1959Q3, 1959Q4>
>> setdiff(A, C)
ans = <dates: 1950Q1, 1950Q2, ..., 1969Q3, 1969Q4>
.. datesmethod:: B = sort (A)
B = sort_ (A)
|br| Sort method for ``dates`` objects. Returns a ``dates`` object
with elements sorted by increasing order.
......@@ -704,9 +847,46 @@ The dates class
>> dd = dates('1945Q3','1938Q4','1789Q3');
>> dd.sort()
ans = <dates: 1789Q3, 1938Q4, 1945Q3>
.. datesmethod:: B = strings (A)
|br| Converts a ``dates`` object into a cell of char arrays.
*Example*
::
>> A = dates('1950Q1');
>> A = A:A+1;
>> strings(A)
ans =
1x2 cell array
{'1950Q1'} {'1950Q2'}
.. datesmethod:: B = subperiod (A)
|br| Returns the subperiod of a date (an integer scalar
between 1 and ``A.freq``).
*Example*
::
>> A = dates('1950Q2');
>> A.subperiod()
ans =
2
.. datesmethod:: B = uminus (A)
|br| Overloads the MATLAB/Octave unary minus operator. Returns
......@@ -718,6 +898,7 @@ The dates class
>> dd = dates('1945Q3','1938Q4','1973Q1');
>> -dd
ans = <dates: 1945Q2, 1938Q3, 1972Q4>
......@@ -735,10 +916,12 @@ The dates class
>> d1 = dates('1945Q3','1973Q1','1938Q4');
>> d2 = dates('1973Q1','1976Q1');
>> union(d1,d2)
ans = <dates: 1938Q4, 1945Q3, 1973Q1, 1976Q1>
.. datesmethod:: B = unique (A)
B = unique_ (A)
|br| Overloads the MATLAB/Octave ``unique`` function. Returns
a ``dates`` object with repetitions removed (only the last
......@@ -750,6 +933,7 @@ The dates class
>> d1 = dates('1945Q3','1973Q1','1945Q3');
>> d1.unique()
ans = <dates: 1973Q1, 1945Q3>
......@@ -764,9 +948,34 @@ The dates class
>> dd = dates('1945Q3','1938Q4','1973Q1');
>> +dd
ans = <dates: 1945Q4, 1939Q1, 1973Q2>
.. datesmethod:: D = vertcat (A, B, C, ...)
|br| Overloads the MATLAB/Octave ``horzcat`` operator. All the
input arguments must be ``dates`` objects. The returned
argument is a ``dates`` object gathering all the dates given
in the input arguments (repetitions are not removed).
.. datesmethod:: B = year (A)
|br| Returns the year of a date (an integer scalar
between 1 and ``A.freq``).
*Example*
::
>> A = dates('1950Q2');
>> A.subperiod()
ans =
1950
.. _dseries-members:
The dseries class
......@@ -804,26 +1013,34 @@ The dseries class
input. Valid file types are ``.m``, ``.mat``, ``.csv`` and
``.xls/.xlsx`` (Octave only supports ``.xlsx`` files and the
`io <https://octave.sourceforge.io/io/>`__ package from
Octave-Forge must be installed). A typical ``.m`` file will
have the following form::
Octave-Forge must be installed). The extension of the file
should be explicitly provided. A typical ``.m`` file will have
the following form::
FREQ__ = 4;
INIT__ = '1994Q3';
NAMES__ = {'azert';'yuiop'};
TEX__ = {'azert';'yuiop'};
TAGS__ = struct()
DATA__ = {}
azert = randn(100,1);
yuiop = randn(100,1);
If a ``.mat`` file is used instead, it should provide the same
informations. Note that the ``INIT__`` variable can be either
a ``dates`` object or a string which could be used to
instantiate the same ``dates`` object. If ``INIT__`` is not
provided in the ``.mat`` or ``.m`` file, the initial is by
default set equal to ``dates('1Y')``. If a second input
argument is passed to the constructor, ``dates`` object
*INITIAL_DATE*, the initial date defined in *FILENAME* is
reset to *INITIAL_DATE*. This is typically usefull if
``INIT__`` is not provided in the data file.
informations, except that the data should not be given as a
set of vectors, but as a single matrix of doubles named
``DATA__``. This array should have as many columns as elements
in ``NAMES__`` (the number of variables). Note that the
``INIT__`` variable can be either a ``dates`` object or a
string which could be used to instantiate the same ``dates``
object. If ``INIT__`` is not provided in the ``.mat`` or
``.m`` file, the initial is by default set equal to
``dates('1Y')``. If a second input argument is passed to the
constructor, ``dates`` object *INITIAL_DATE*, the initial date
defined in *FILENAME* is reset to *INITIAL_DATE*. This is
typically usefull if ``INIT__`` is not provided in the data
file.
.. construct:: dseries (DATA_MATRIX[,INITIAL_DATE[,LIST_OF_NAMES[,TEX_NAMES]]])
dseries (DATA_MATRIX[,RANGE_OF_DATES[,LIST_OF_NAMES[,TEX_NAMES]]])
......@@ -853,7 +1070,7 @@ The dseries class
Creates a ``dseries`` object given the MATLAB Table provided as the sole
argument. It is assumed that the first column of the table contains the
dates of the ``dseries`` and the first row contains the names. NB: This
dates of the ``dseries`` and the first row contains the names. This
feature is not available under Octave or MATLAB R2013a or earlier.
*Example*
......@@ -878,10 +1095,13 @@ The dseries class
to the last observation, then ``ds(d)`` instantiates a new
``dseries`` object containing the subsample defined by ``d``.
A list of the available methods, by alphabetical order, is given below.
A list of the available methods, by alphabetical order, is given
below. As in the previous section the in place modifications
versions of the methods are postfixed with an underscore.
.. dseriesmethod:: A = abs (B)
abs_ (B)
|br| Overloads the ``abs()`` function for ``dseries``
objects. Returns the absolute value of the variables in
......@@ -913,6 +1133,7 @@ The dseries class
.. dseriesmethod:: [A, B] = align (A, B)
align_ (A, B)
If ``dseries`` objects ``A`` and ``B`` are defined on
different time ranges, this function extends ``A`` and/or
......@@ -951,8 +1172,33 @@ The dseries class
2001Q1 | 0.17813
2001Q2 | 0.12801
>> ts0 = dseries(rand(5,1),dates('2000Q1')); % 2000Q1 -> 2001Q1
>> ts1 = dseries(rand(3,1),dates('2000Q4')); % 2000Q4 -> 2001Q2
>> align_(ts0, ts1); % 2000Q1 -> 2001Q2
>> ts1
ts1 is a dseries object:
| Variable_1
2000Q1 | NaN
2000Q2 | NaN
2000Q3 | NaN
2000Q4 | 0.66653
2001Q1 | 0.17813
2001Q2 | 0.12801
.. dseriesmethod:: C = backcast (A, B[, diff])
backcast_ (A, B[, diff])
Backcasts ``dseries`` object ``A`` with ``dseries`` object B's
growth rates (except if the last optional argument, ``diff``,
is true in which case first differences are used). Both
``dseries`` objects must have the same frequency.
.. dseriesmethod:: B = baxter_king_filter (A, hf, lf, K)
baxter_king_filter_ (A, hf, lf, K)
|br| Implementation of the *Baxter and King* (1999) band pass
filter for ``dseries`` objects. This filter isolates business
......@@ -997,7 +1243,17 @@ The dseries class
set(gca,'XTickLabel',strings(ts1.dates(id)));
.. dseriesmethod:: B = center (A[, geometric])
center_ (A[, geometric])
|br| Centers variables in ``dseries`` object ``A`` around their
arithmetic means, except if the optional argument ``geometric``
is set equal to ``true`` in which case all the variables are
divided by their geometric means.
.. dseriesmethod:: C = chain (A, B)
chain_ (A, B)
|br| Merge two ``dseries`` objects along the time
dimension. The two objects must have the same number of
......@@ -1051,7 +1307,68 @@ The dseries class
error.
.. dseriesmethod:: B = copy (A)
|br| Returns a copy of ``A``. If an inplace modification method
is applied to ``A``, object ``B`` will not be affected. Note
that if ``A`` is assigned to ``C``, ``C = A``, then any in
place modification method applied to ``A`` will change ``C``.
*Example*
::
>> a = dseries(randn(5,1))
a is a dseries object:
| Variable_1
1Y | -0.16936
2Y | -1.1451
3Y | -0.034331
4Y | -0.089042
5Y | -0.66997
>> b = copy(a);
>> c = a;
>> a.abs();
>> a.abs_();
>> a
a is a dseries object:
| Variable_1
1Y | 0.16936
2Y | 1.1451
3Y | 0.034331
4Y | 0.089042
5Y | 0.66997
>> b
b is a dseries object:
| Variable_1
1Y | -0.16936
2Y | -1.1451
3Y | -0.034331
4Y | -0.089042
5Y | -0.66997
>> c
c is a dseries object:
| Variable_1
1Y | 0.16936
2Y | 1.1451
3Y | 0.034331
4Y | 0.089042
5Y | 0.66997
.. dseriesmethod:: B = cumprod (A[, d[, v]])
cumprod_ (A[, d[, v]])
|br| Overloads the MATLAB/Octave ``cumprod`` function for
``dseries`` objects. The cumulated product cannot be computed
......@@ -1114,6 +1431,7 @@ The dseries class
.. dseriesmethod:: B = cumsum (A[, d[, v]])
cumsum (A[, d[, v]])
|br| Overloads the MATLAB/Octave ``cumsum`` function for
``dseries`` objects. The cumulated sum cannot be computed if
......@@ -1184,14 +1502,46 @@ The dseries class
10Y | 10.1416
.. dseriesmethod:: B = detrend (A, m)
dentrend_ (A, m)
|br| Detrends ``dseries`` object ``A`` with a fitted
polynomial of order ``m``. Note that each variable is
detrended with a different polynomial.
.. dseriesmethod:: B = diff (A)
diff_ (A)
|br| Returns the first difference of ``dseries`` object ``A``.
.. datesmethod:: disp (A)
|br| Overloads the MATLAB/Octave disp function for ``dseries`` object.
.. datesmethod:: display (A)
|br| Overloads the MATLAB/Octave display function for
``dseries`` object. ``display`` is the function called by
MATLAB to print the content of an object if a semicolon is
missing at the end of a MATLAB statement. If the ``dseries``
object is defined over a too large time span, only the first
and last periods will be printed. If the ``dseries`` object
contains too many variables, only the first and last variables
will be printed. If all the periods and variables are
required, the ``disp`` method should be used instead.
.. dseriesmethod:: C = eq (A, B)
|br| Overloads the MATLAB/Octave ``eq`` (equal, ``==``)
operator. ``dseries`` objects ``A`` and ``B`` must have the
same number of observations (say, :math:`T`) and variables
(:math:`N`). The returned argument is a :math:`T \times N`
matrix of zeros and ones. Element :math:`(i,j)` of ``C`` is
equal to ``1`` if and only if observation :math:`i` for
matrix of logicals. Element :math:`(i,j)` of ``C`` is
equal to ``true`` if and only if observation :math:`i` for
variable :math:`j` in ``A`` and ``B`` are the same.
*Example*
......@@ -1204,28 +1554,17 @@ The dseries class
ans =
3x1 logical array
1
0
1
.. dseriesmethod:: B = exp(A)
|br| Overloads the MATLAB/Octave ``exp`` function for
``dseries`` objects.
*Example*
::
>> ts0 = dseries(rand(10,1));
>> ts1 = ts0.exp();
.. dseriesmethod:: l = exist (A, varname)
|br| Tests if variable exists in ``dseries`` object ``A``. Returns
``1`` (true) iff variable exists in ``A``.
|br| Tests if variable ``varname`` exists in ``dseries`` object ``A``. Returns
``true`` iff variable exists in ``A``.
*Example*
......@@ -1236,15 +1575,33 @@ The dseries class
ans =
logical
1
>> ts.exist('Variable_2')
ans =
logical
0
.. dseriesmethod:: B = exp (A)
exp_ (A)
|br| Overloads the MATLAB/Octave ``exp`` function for
``dseries`` objects.
*Example*
::
>> ts0 = dseries(rand(10,1));
>> ts1 = ts0.exp();
.. dseriesmethod:: C = extract (A, B[, ...])
|br| Extracts some variables from a ``dseries`` object ``A``
......@@ -1263,12 +1620,14 @@ The dseries class
>> ts0 = dseries(ones(100,10));
>> ts1 = ts0{'Variable_1','Variable_2','Variable_3'};
>> ts2 = ts0{'Variable_@1,2,3@'}
>> ts3 = ts0{'Variable_[1-3]$'}
>> ts2 = ts0{'Variable_@1,2,3@'};
>> ts3 = ts0{'Variable_[1-3]$'};
>> isequal(ts1,ts2) && isequal(ts1,ts3)
ans =
logical
1
It is possible to use up to two implicit loops to select variables::
......@@ -1290,7 +1649,17 @@ The dseries class
1973Q4 | -0.03705 | -0.35899 | 0.85838 | -1.4675 | -2.1666 | -0.62032
.. dseriesmethod:: f = freq(B)
.. dseriesmethod:: f = firstdate (A)
|br| Returns the first period in ``dseries`` object ``A``.
.. dseriesmethod:: f = firstobservedperiod (A)
|br| Returns the first period where all the variables in ``dseries`` object ``A`` are observed (non NaN).
.. dseriesmethod:: f = frequency (B)
|br| Returns the frequency of the variables in ``dseries`` object ``B``.
......@@ -1299,7 +1668,7 @@ The dseries class
::
>> ts = dseries(randn(3,2),'1973Q1');
>> ts.freq
>> ts.frequency
ans =
......@@ -1342,6 +1711,7 @@ The dseries class
.. dseriesmethod:: B = hpcycle (A[, lambda])
hpcycle_ (A[, lambda])
|br| Extracts the cycle component from a ``dseries`` ``A``
object using the *Hodrick and Prescott (1997)* filter and
......@@ -1382,6 +1752,7 @@ The dseries class
.. dseriesmethod:: B = hptrend (A[, lambda])
hptrend_ (A[, lambda])
|br| Extracts the trend component from a ``dseries`` A object
using the *Hodrick and Prescott (1997)* filter and returns a
......@@ -1409,19 +1780,6 @@ The dseries class
set(gca,'XTickLabel',strings(ts0.dates(id)));
.. dseriesmethod:: f = init(B)
|br| Returns the initial date in ``dseries`` object ``B``.
*Example*
::
>> ts = dseries(randn(3,2),'1973Q1');
>> ts.init
ans = <dates: 1973Q1>
.. dseriesmethod:: C = insert (A, B, I)
|br| Inserts variables contained in ``dseries`` object ``B``
......@@ -1433,7 +1791,7 @@ The dseries class
defined over the same time ranges, but it is assumed that they
have common frequency.
:ex:
*Example*
::
......@@ -1460,19 +1818,40 @@ The dseries class
.. dseriesmethod:: B = isempty (A)
|br| Overloads the MATLAB/octave’s ``isempty`` function. Returns
``1`` if ``dseries`` object ``A`` is empty, ``0`` otherwise.
``true`` if ``dseries`` object ``A`` is empty.
.. dseriesmethod:: C = isequal (A, B)
|br| Overloads the MATLAB/octave’s ``isequal`` function. Returns
``1`` if ``dseries`` objects ``A`` and ``B`` are identical, ``0``
otherwise.
``true`` if ``dseries`` objects ``A`` and ``B`` are identical.
.. dseriesmethod:: C = isinf (A)
|br| Overloads the MATLAB/octave’s ``isinf`` function. Returns
a logical array, with element ``(i,j)`` equal to ``true`` if and
only if variable ``j`` is finite in period ``A.dates(i)``.
.. dseriesmethod:: C = isnan (A)
|br| Overloads the MATLAB/octave’s ``isnan`` function. Returns
a logical array, with element ``(i,j)`` equal to ``true`` if and
only if variable ``j`` isn't NaN in period ``A.dates(i)``.
.. dseriesmethod:: C = isreal (A)
|br| Overloads the MATLAB/octave’s ``isreal`` function. Returns
a logical array, with element ``(i,j)`` equal to ``true`` if and
only if variable ``j`` is real in period ``A.dates(i)``.
.. dseriesmethod:: B = lag (A[, p])
lag_ (A[, p])
Returns lagged time series. Default value of ``p``, the number
|br| Returns lagged time series. Default value of integer scalar ``p``, the number
of lags, is ``1``.
*Example*
......@@ -1493,7 +1872,7 @@ The dseries class
ts1 is a dseries object:
| lag(Variable_1,1)
| Variable_1
1950Q1 | NaN
1950Q2 | 1
1950Q3 | 2
......@@ -1503,7 +1882,7 @@ The dseries class
ts2 is a dseries object:
| lag(Variable_1,2)
| Variable_1
1950Q1 | NaN
1950Q2 | NaN
1950Q3 | 1
......@@ -1517,7 +1896,7 @@ The dseries class
ans is a dseries object:
| lag(Variable_1,1)
| Variable_1
1950Q1 | NaN
1950Q2 | 1
1950Q3 | 2
......@@ -1529,32 +1908,39 @@ The dseries class
ans is a dseries object:
| lag(Variable_1,1)
| Variable_1
1950Q1 | NaN
1950Q2 | 1
1950Q3 | 2
1950Q4 | 3
.. dseriesmethod:: l = last(B)
.. dseriesmethod:: l = lastdate (B)
|br| Returns the last date in ``dseries`` object ``B``.
|br| Returns the last period in ``dseries`` object ``B``.
*Example*
::
>> ts = dseries(randn(3,2),'1973Q1');
>> ts.last
>> ts.lastdate()
ans = <dates: 1973Q3>
.. dseriesmethod:: f = lastobservedperiod (A)
|br| Returns the last period where all the variables in ``dseries`` object ``A`` are observed (non NaN).
.. dseriesmethod:: B = lead (A[, p])
lead_ (A[, p])
|br| Returns lead time series. Default value of ``p``, the
number of leads, is ``1``. As in the ``lag`` method, the
``dseries`` class overloads the parenthesis so that
``ts.lead(p)`` is equivalent to ``ts(p)``.
|br| Returns lead time series. Default value of integer scalar
``p``, the number of leads, is ``1``. As in the ``lag``
method, the ``dseries`` class overloads the parenthesis so
that ``ts.lead(p)`` is equivalent to ``ts(p)``.
*Example*
......@@ -1565,7 +1951,7 @@ The dseries class
ts1 is a dseries object:
| lead(Variable_1,1)
| Variable_1
1950Q1 | 2
1950Q2 | 3
1950Q3 | 4
......@@ -1575,7 +1961,7 @@ The dseries class
ts2 is a dseries object:
| lead(Variable_1,2)
| Variable_1
1950Q1 | 3
1950Q2 | 4
1950Q3 | NaN
......@@ -1606,7 +1992,29 @@ The dseries class
in the ``model`` block is zero, but the residuals are non
zero).
.. dseriesmethod:: B = lineartrend (A)
|br| Returns a linear trend centered on 0, the length of the
trend is given by the size of ``dseries`` object ``A`` (the
number of periods).
*Example*
::
>> ts = dseries(ones(3,1));
>> ts.lineartrend()
ans =
-1
0
1
.. dseriesmethod:: B = log (A)
log_ (A)
|br| Overloads the MATLAB/Octave ``log`` function for
``dseries`` objects.
......@@ -1618,8 +2026,23 @@ The dseries class
>> ts0 = dseries(rand(10,1));
>> ts1 = ts0.log();
.. dseriesmethod:: B = mdiff (A)
mdiff_ (A)
|br| Computes monthly growth rates of variables in
``dseries`` object ``A``.
.. dseriesmethod:: C = merge(A, B)
.. dseriesmethod:: B = mean (A[, geometric])
|br| Overloads the MATLAB/Octave ``mean`` function for
``dseries`` objects. Returns the mean of each variable in
``dseries`` object ``A``. If the second argument is ``true``
the geometric mean is computed, otherwise (default) the
arithmetic mean is reported.
.. dseriesmethod:: C = merge (A, B[, legacy])
|br| Merges two ``dseries`` objects ``A`` and ``B`` in
``dseries`` object ``C``. Objects ``A`` and ``B`` need to have
......@@ -1629,7 +2052,10 @@ The dseries class
select the variable ``x`` as defined in the second input
argument, ``B``, except for the NaN elements in ``B`` if
corresponding elements in ``A`` (ie same periods) are well
defined numbers.
defined numbers. This behaviour can be changed by setting the
optional argument ``legacy`` equal to true, in which case the
second variable overwrites the first one even if the second
variable has NaNs.
*Example*
......@@ -1640,60 +2066,61 @@ The dseries class
ts0 is a dseries object:
| A1 | A2
1950Q1 | 0.42448 | 0.92477
1950Q2 | 0.60726 | 0.64208
1950Q3 | 0.070764 | 0.1045
1950Q1 | 0.96284 | 0.5363
1950Q2 | 0.25145 | 0.31866
1950Q3 | 0.34447 | 0.4355
>> ts1 = dseries(rand(3,1),'1950Q2',{'A1'})
ts1 is a dseries object:
| A1
1950Q2 | 0.70023
1950Q3 | 0.3958
1950Q4 | 0.084905
1950Q2 | 0.40161
1950Q3 | 0.81763
1950Q4 | 0.97769
>> merge(ts0,ts1)
ans is a dseries object:
| A1 | A2
1950Q1 | NaN | 0.92477
1950Q2 | 0.70023 | 0.64208
1950Q3 | 0.3958 | 0.1045
1950Q4 | 0.084905 | NaN
1950Q1 | 0.96284 | 0.5363
1950Q2 | 0.40161 | 0.31866
1950Q3 | 0.81763 | 0.4355
1950Q4 | 0.97769 | NaN
>> merge(ts1,ts0)
ans is a dseries object:
| A1 | A2
1950Q1 | 0.42448 | 0.92477
1950Q2 | 0.60726 | 0.64208
1950Q3 | 0.070764 | 0.1045
1950Q4 | NaN | NaN
1950Q1 | 0.96284 | 0.5363
1950Q2 | 0.25145 | 0.31866
1950Q3 | 0.34447 | 0.4355
1950Q4 | 0.97769 | NaN
.. dseriesmethod:: C = minus (A, B)
|br| Overloads the ``minus`` (``-``) operator for ``dseries``
objects, element by element subtraction. If both ``A`` and
``B`` are ``dseries`` objects, they do not need to be defined
over the same time ranges. If ``A`` and ``B`` are ``dseries``
objects with :math:`T_A` and :math:`T_B` observations and
:math:`N_A` and :math:`N_B` variables, then :math:`N_A` must
be equal to :math:`N_B` or :math:`1` and :math:`N_B` must be
equal to :math:`N_A` or :math:`1`. If :math:`T_A=T_B`,
``isequal(A.init,B.init)`` returns ``1`` and :math:`N_A=N_B`,
then the ``minus`` operator will compute for each couple
:math:`(t,n)`, with :math:`1\le t\le T_A` and :math:`1\le n\le
N_A`, ``C.data(t,n)=A.data(t,n)-B.data(t,n)``. If :math:`N_B`
is equal to :math:`1` and :math:`N_A>1`, the smaller
``dseries`` object (``B``) is “broadcast” across the larger
``dseries`` (``A``) so that they have compatible shapes, the
``minus`` operator will subtract the variable defined in ``B``
from each variable in ``A``. If ``B`` is a double scalar, then
the method ``minus`` will subtract ``B`` from all the
|br| Overloads the MATLAB/Octave ``minus`` (``-``) operator
for ``dseries`` objects, element by element subtraction. If
both ``A`` and ``B`` are ``dseries`` objects, they do not need
to be defined over the same time ranges. If ``A`` and ``B``
are ``dseries`` objects with :math:`T_A` and :math:`T_B`
observations and :math:`N_A` and :math:`N_B` variables, then
:math:`N_A` must be equal to :math:`N_B` or :math:`1` and
:math:`N_B` must be equal to :math:`N_A` or :math:`1`. If
:math:`T_A=T_B`, ``isequal(A.init,B.init)`` returns ``1`` and
:math:`N_A=N_B`, then the ``minus`` operator will compute for
each couple :math:`(t,n)`, with :math:`1\le t\le T_A` and
:math:`1\le n\le N_A`,
``C.data(t,n)=A.data(t,n)-B.data(t,n)``. If :math:`N_B` is
equal to :math:`1` and :math:`N_A>1`, the smaller ``dseries``
object (``B``) is “broadcast” across the larger ``dseries``
(``A``) so that they have compatible shapes, the ``minus``
operator will subtract the variable defined in ``B`` from each
variable in ``A``. If ``B`` is a double scalar, then the
method ``minus`` will subtract ``B`` from all the
observations/variables in ``A``. If ``B`` is a row vector of
length :math:`N_A`, then the ``minus`` method will subtract
``B(i)`` from all the observations of variable ``i``, for
......@@ -1711,7 +2138,7 @@ The dseries class
ans is a dseries object:
| minus(Variable_1,Variable_2) | minus(Variable_2,Variable_2)
| Variable_1 | Variable_2
1Y | -0.48853 | 0
2Y | -0.50535 | 0
3Y | -0.32063 | 0
......@@ -1729,7 +2156,7 @@ The dseries class
ans is a dseries object:
| minus(Variable_2,0.703)
| Variable_2
1Y | 0
2Y | 0.051148
3Y | -0.15572
......@@ -1738,7 +2165,7 @@ The dseries class
ans is a dseries object:
| minus(0.703,Variable_2)
| Variable_2
1Y | 0
2Y | -0.051148
3Y | 0.15572
......@@ -1746,7 +2173,7 @@ The dseries class
.. dseriesmethod:: C = mpower (A, B)
|br| Overloads the ``mpower`` (``^``) operator for ``dseries``
|br| Overloads the MATLAB/Octave ``mpower`` (``^``) operator for ``dseries``
objects and computes element-by-element power. ``A`` is a
``dseries`` object with ``N`` variables and ``T``
observations. If ``B`` is a real scalar, then ``mpower(A,B)``
......@@ -1765,7 +2192,7 @@ The dseries class
ts1 is a dseries object:
| power(Variable_1,2)
| Variable_1
1Y | 1
2Y | 4
3Y | 9
......@@ -1774,7 +2201,7 @@ The dseries class
ts2 is a dseries object:
| power(Variable_1,Variable_1)
| Variable_1
1Y | 1
2Y | 4
3Y | 27
......@@ -1782,7 +2209,7 @@ The dseries class
.. dseriesmethod:: C = mrdivide (A, B)
|br| Overloads the ``mrdivide`` (``/``) operator for
|br| Overloads the MATLAB/Octave ``mrdivide`` (``/``) operator for
``dseries`` objects, element by element division (like the
``./`` MATLAB/Octave operator). If both ``A`` and ``B`` are
``dseries`` objects, they do not need to be defined over the
......@@ -1826,7 +2253,7 @@ The dseries class
ans is a dseries object:
| divide(Variable_1,Variable_2) | divide(Variable_2,Variable_2)
| Variable_1 | Variable_2
1Y | 0.80745 | 1
2Y | 4.2969 | 1
3Y | 0.59235 | 1
......@@ -1834,34 +2261,44 @@ The dseries class
.. dseriesmethod:: C = mtimes (A, B)
|br| Overloads the ``mtimes`` (``*``) operator for ``dseries``
objects and the Hadammard product (the .* MATLAB/Octave
operator). If both ``A`` and ``B`` are ``dseries`` objects,
they do not need to be defined over the same time ranges. If
``A`` and ``B`` are ``dseries`` objects with :math:`T_A` and
:math:`_B` observations and :math:`N_A` and :math:`N_B`
variables, then :math:`N_A` must be equal to :math:`N_B` or
:math:`1` and :math:`N_B` must be equal to :math:`N_A` or
:math:`1`. If :math:`T_A=T_B`, ``isequal(A.init,B.init)``
returns ``1`` and :math:`N_A=N_B`, then the ``mtimes``
operator will compute for each couple :math:`(t,n)`, with
:math:`1\le t\le T_A` and :math:`1\le n\le N_A`,
``C.data(t,n)=A.data(t,n)*B.data(t,n)``. If :math:`N_B` is
equal to :math:`1` and :math:`N_A>1`, the smaller ``dseries``
object (``B``) is “broadcast” across the larger ``dseries``
(``A``) so that they have compatible shapes, ``mtimes``
operator will multiply each variable defined in ``A`` by the
variable in ``B``, observation per observation. If ``B`` is a
double scalar, then the method ``mtimes`` will multiply all
the observations/variables in ``A`` by ``B``. If ``B`` is a
row vector of length :math:`N_A`, then the ``mtimes`` method
will multiply all the observations of variable ``i`` by
``B(i)``, for :math:`i=1,...,N_A`. If ``B`` is a column vector
of length :math:`T_A`, then the ``mtimes`` method will perform
a multiplication of all the variables by ``B``, element by
|br| Overloads the MATLAB/Octave ``mtimes`` (``*``) operator
for ``dseries`` objects and the Hadammard product (the .*
MATLAB/Octave operator). If both ``A`` and ``B`` are
``dseries`` objects, they do not need to be defined over the
same time ranges. If ``A`` and ``B`` are ``dseries`` objects
with :math:`T_A` and :math:`_B` observations and :math:`N_A`
and :math:`N_B` variables, then :math:`N_A` must be equal to
:math:`N_B` or :math:`1` and :math:`N_B` must be equal to
:math:`N_A` or :math:`1`. If :math:`T_A=T_B`,
``isequal(A.init,B.init)`` returns ``1`` and :math:`N_A=N_B`,
then the ``mtimes`` operator will compute for each couple
:math:`(t,n)`, with :math:`1\le t\le T_A` and :math:`1\le n\le
N_A`, ``C.data(t,n)=A.data(t,n)*B.data(t,n)``. If :math:`N_B`
is equal to :math:`1` and :math:`N_A>1`, the smaller
``dseries`` object (``B``) is “broadcast” across the larger
``dseries`` (``A``) so that they have compatible shapes,
``mtimes`` operator will multiply each variable defined in
``A`` by the variable in ``B``, observation per
observation. If ``B`` is a double scalar, then the method
``mtimes`` will multiply all the observations/variables in
``A`` by ``B``. If ``B`` is a row vector of length
:math:`N_A`, then the ``mtimes`` method will multiply all the
observations of variable ``i`` by ``B(i)``, for
:math:`i=1,...,N_A`. If ``B`` is a column vector of length
:math:`T_A`, then the ``mtimes`` method will perform a
multiplication of all the variables by ``B``, element by
element.
.. dseriesmethod:: B = nanmean (A[, geometric])
|br| Overloads the MATLAB/Octave ``nanmean`` function for
``dseries`` objects. Returns the mean of each variable in
``dseries`` object ``A`` ignoring the NaN values. If the
second argument is ``true`` the geometric mean is computed,
otherwise (default) the arithmetic mean is reported.
.. dseriesmethod:: C = ne (A, B)
|br| Overloads the MATLAB/Octave ``ne`` (not equal, ``~=``)
......@@ -1882,6 +2319,8 @@ The dseries class
ans =
3x1 logical array
0
1
0
......@@ -1904,6 +2343,28 @@ The dseries class
10
.. dseriesmethod:: B = onesidedhpcycle (A[, lambda[, init]])
onesidedhpcycle_ (A[, lambda[, init]])
|br| Extracts the cycle component from a ``dseries`` ``A``
object using a one sided HP filter (with a Kalman filter) and
returns a ``dseries`` object, ``B``. The default value for
``lambda``, the smoothing parameter, is ``1600``. By default,
if ``ìnit`` is not provided, the initial value is based on the
first two observations.
.. dseriesmethod:: B = onesidedhptrend (A[, lambda[, init]])
onesidedhptrend_ (A[, lambda[, init]])
|br| Extracts the trend component from a ``dseries`` ``A``
object using a one sided HP filter (with a Kalman filter) and
returns a ``dseries`` object, ``B``. The default value for
``lambda``, the smoothing parameter, is ``1600``. By default,
if ``ìnit`` is not provided, the initial value is based on the
first two observations.
.. dseriesmethod:: h = plot (A)
h = plot (A, B)
h = plot (A[, ...])
......@@ -1969,33 +2430,34 @@ The dseries class
.. dseriesmethod:: C = plus (A, B)
|br| Overloads the ``plus`` (``+``) operator for ``dseries``
objects, element by element addition. If both ``A`` and ``B``
are ``dseries`` objects, they do not need to be defined over
the same time ranges. If ``A`` and ``B`` are ``dseries``
objects with :math:`T_A` and :math:`T_B` observations and
:math:`N_A` and :math:`N_B` variables, then :math:`N_A` must
be equal to :math:`N_B` or :math:`1` and :math:`N_B` must be
equal to :math:`N_A` or :math:`1`. If :math:`T_A=T_B`,
``isequal(A.init,B.init)`` returns ``1`` and :math:`N_A=N_B`,
then the ``plus`` operator will compute for each couple
:math:`(t,n)`, with :math:`1\le t\le T_A` and :math:`1\le n\le
N_A`, ``C.data(t,n)=A.data(t,n)+B.data(t,n)``. If :math:`N_B`
is equal to :math:`1` and :math:`N_A>1`, the smaller
``dseries`` object (``B``) is “broadcast” across the larger
``dseries`` (``A``) so that they have compatible shapes, the
plus operator will add the variable defined in ``B`` to each
variable in ``A``. If ``B`` is a double scalar, then the
method ``plus`` will add ``B`` to all the
observations/variables in ``A``. If ``B`` is a row vector of
length :math:`N_A`, then the ``plus`` method will add ``B(i)``
to all the observations of variable ``i``, for
:math:`i=1,...,N_A`. If ``B`` is a column vector of length
:math:`T_A`, then the ``plus`` method will add ``B`` to all
the variables.
|br| Overloads the MATLAB/Octave ``plus`` (``+``) operator for
``dseries`` objects, element by element addition. If both
``A`` and ``B`` are ``dseries`` objects, they do not need to
be defined over the same time ranges. If ``A`` and ``B`` are
``dseries`` objects with :math:`T_A` and :math:`T_B`
observations and :math:`N_A` and :math:`N_B` variables, then
:math:`N_A` must be equal to :math:`N_B` or :math:`1` and
:math:`N_B` must be equal to :math:`N_A` or :math:`1`. If
:math:`T_A=T_B`, ``isequal(A.init,B.init)`` returns ``1`` and
:math:`N_A=N_B`, then the ``plus`` operator will compute for
each couple :math:`(t,n)`, with :math:`1\le t\le T_A` and
:math:`1\le n\le N_A`,
``C.data(t,n)=A.data(t,n)+B.data(t,n)``. If :math:`N_B` is
equal to :math:`1` and :math:`N_A>1`, the smaller ``dseries``
object (``B``) is “broadcast” across the larger ``dseries``
(``A``) so that they have compatible shapes, the plus operator
will add the variable defined in ``B`` to each variable in
``A``. If ``B`` is a double scalar, then the method ``plus``
will add ``B`` to all the observations/variables in ``A``. If
``B`` is a row vector of length :math:`N_A`, then the ``plus``
method will add ``B(i)`` to all the observations of variable
``i``, for :math:`i=1,...,N_A`. If ``B`` is a column vector of
length :math:`T_A`, then the ``plus`` method will add ``B`` to
all the variables.
.. dseriesmethod:: C = pop (A[, B])
pop_ (A[, B])
|br| Removes variable ``B`` from ``dseries`` object ``A``. By
default, if the second argument is not provided, the last
......@@ -2018,6 +2480,8 @@ The dseries class
.. dseriesmethod:: B = qdiff (A)
B = qgrowth (A)
qdiff_ (A)
qgrowth_ (A)
|br| Computes quarterly differences or growth rates.
......@@ -2030,7 +2494,7 @@ The dseries class
ts1 is a dseries object:
| qdiff(Variable_1)
| Variable_1
1950Q1 | NaN
1950Q2 | 1
1950Q3 | 1
......@@ -2041,7 +2505,7 @@ The dseries class
ts1 is a dseries object:
| qdiff(Variable_1)
| Variable_1
1950M1 | NaN
1950M2 | NaN
1950M3 | NaN
......@@ -2051,6 +2515,7 @@ The dseries class
.. dseriesmethod:: C = remove (A, B)
remove_ (A, B)
|br| Alias for the ``pop`` method with two arguments. Removes
variable ``B`` from ``dseries`` object ``A``.
......@@ -2084,9 +2549,12 @@ The dseries class
.. dseriesmethod:: B = rename (A, oldname, newname)
rename_ (A, oldname, newname)
|br| Rename variable ``oldname`` to ``newname`` in ``dseries``
object ``A``. Returns a ``dseries`` object.``
object ``A``. Returns a ``dseries`` object. If more than one
variable needs to be renamed, it is possible to pass cells of
char arrays as second and third arguments.
*Example*
......@@ -2103,22 +2571,23 @@ The dseries class
.. dseriesmethod:: C = rename (A, newname)
rename_ (A, newname)
|br| Replace the names in ``A`` with those passed in the cell
string array ``newname``. ``newname`` must have the same
number of cells as ``A`` has ``dseries``. Returns a
``dseries`` object.
number of elements as ``dseries`` object ``A`` has
variables. Returns a ``dseries`` object.
*Example*
::
>> ts0 = dseries(ones(2,3));
>> ts1 = ts0.rename({'Tree','Worst','President'})
>> ts1 = ts0.rename({'TinkyWinky','Dipsy','LaaLaa'})
ts1 is a dseries object:
| Bush | Worst | President
| TinkyWinky | Dipsy | LaaLaa
1Y | 1 | 1 | 1
2Y | 1 | 1 | 1
......@@ -2126,9 +2595,9 @@ The dseries class
.. dseriesmethod:: save (A, basename[, format])
|br| Overloads the MATLAB/Octave ``save`` function and saves
``dseries`` object ``A`` to disk. Possible formats are ``csv``
``dseries`` object ``A`` to disk. Possible formats are ``mat``
(this is the default), ``m`` (MATLAB/Octave script), and
``mat`` (MATLAB binary data file). The name of the file
``csv`` (MATLAB binary data file). The name of the file
without extension is specified by ``basename``.
*Example*
......@@ -2136,7 +2605,7 @@ The dseries class
::
>> ts0 = dseries(ones(2,2));
>> ts0.save('ts0');
>> ts0.save('ts0', 'csv');
The last command will create a file ts0.csv with the
following content::
......@@ -2158,6 +2627,8 @@ The dseries class
NAMES__ = {'Variable_1'; 'Variable_2'};
TEX__ = {'Variable_{1}'; 'Variable_{2}'};
OPS__ = {};
TAGS__ = struct();
Variable_1 = [
1
......@@ -2217,8 +2688,34 @@ The dseries class
1 3
.. dseriesmethod:: B = std (A[, geometric])
|br| Overloads the MATLAB/Octave ``std`` function for
``dseries`` objects. Returns the standard deviation of each
variable in ``dseries`` object ``A``. If the second argument
is ``true`` the geometric standard deviation is computed
(default value of the second argument is ``false``).
.. dseriesmethod:: A = tag (A, a[, b, c])
|br| Add a tag to a variable in ``dseries`` object ``A``.
*Example*
::
>> ts = dseries(randn(10, 3));
>> tag(ts, 'type'); % Define a tag name.
>> tag(ts, 'type', 'Variable_1', 'Stock');
>> tag(ts, 'type', 'Variable_2', 'Flow');
>> tag(ts, 'type', 'Variable_3', 'Stock');
.. dseriesmethod:: B = tex_rename (A, name, newtexname)
B = tex_rename (A, newtexname)
tex_rename_ (A, name, newtexname)
tex_rename_ (A, newtexname)
|br| Redefines the tex name of variable ``name`` to
``newtexname`` in ``dseries`` object ``A``. Returns a
......@@ -2250,7 +2747,7 @@ The dseries class
ts1 is a dseries object:
| -Variable_1
| Variable_1
1Y | -1
......@@ -2300,5 +2797,7 @@ The dseries class
.. dseriesmethod:: B = ydiff (A)
B = ygrowth (A)
ydiff_ (A)
ygrowth_ (A)
|br| Computes yearly differences or growth rates.
......@@ -34,7 +34,7 @@ from docutils.parsers.rst import Directive, directives
from sphinx import addnodes
from sphinx.domains import Domain, ObjType
from sphinx.locale import l_, _
from sphinx.locale import _
from sphinx.directives import ObjectDescription
from sphinx.roles import XRefRole
from sphinx.util.nodes import make_refnode
......@@ -140,14 +140,14 @@ class DynCallable(DynObject):
has_arguments = True
doc_field_types = [
TypedField('arguments', label=l_('Arguments'),
TypedField('arguments', label=_('Arguments'),
names=('argument', 'arg', 'parameter', 'param'),
typerolename='func', typenames=('paramtype', 'type')),
Field('returnvalue', label=l_('Returns'), has_arg=False,
Field('returnvalue', label=_('Returns'), has_arg=False,
names=('returns', 'return')),
Field('returntype', label=l_('Return type'), has_arg=False,
Field('returntype', label=_('Return type'), has_arg=False,
names=('rtype',)),
Field('example', label=l_('Example'), has_arg=False,
Field('example', label=_('Example'), has_arg=False,
names=('ex',)),
]
......@@ -157,10 +157,10 @@ class DynClass(DynObject):
allow_nesting = True
doc_field_types = [
TypedField('members', label=l_('Members'),
TypedField('members', label=_('Members'),
names=('argument', 'arg', ),
typerolename='func', typenames=('type', )),
Field('example', label=l_('Example'), has_arg=False,
Field('example', label=_('Example'), has_arg=False,
names=('ex',)),
]
......@@ -291,22 +291,22 @@ class DynareDomain(Domain):
name = 'dynare'
label = 'Dynare'
object_types = {
'function': ObjType(l_('function'), 'func'),
'datesmethod': ObjType(l_('method'), 'datmeth'),
'dseriesmethod': ObjType(l_('method'), 'dsermeth'),
'reportingmethod': ObjType(l_('method'), 'repmeth'),
'matcomm': ObjType(l_('matlab command'), 'mcomm'),
'command': ObjType(l_('command'), 'comm'),
'class': ObjType(l_('class'), 'class'),
'block': ObjType(l_('block'), 'bck'),
'confblock': ObjType(l_('config block'), 'cbck'),
'macrodir': ObjType(l_('macro directive'), 'mdir'),
'construct': ObjType(l_('constructor'), 'cstr'),
'matvar': ObjType(l_('matlab variable'), 'mvar'),
'specvar': ObjType(l_('special variable'), 'svar'),
'operator': ObjType(l_('operator'), 'op'),
'constant': ObjType(l_('constant'), 'const'),
'option': ObjType(l_('option'), 'opt'),
'function': ObjType(_('function'), 'func'),
'datesmethod': ObjType(_('method'), 'datmeth'),
'dseriesmethod': ObjType(_('method'), 'dsermeth'),
'reportingmethod': ObjType(_('method'), 'repmeth'),
'matcomm': ObjType(_('matlab command'), 'mcomm'),
'command': ObjType(_('command'), 'comm'),
'class': ObjType(_('class'), 'class'),
'block': ObjType(_('block'), 'bck'),
'confblock': ObjType(_('config block'), 'cbck'),
'macrodir': ObjType(_('macro directive'), 'mdir'),
'construct': ObjType(_('constructor'), 'cstr'),
'matvar': ObjType(_('matlab variable'), 'mvar'),
'specvar': ObjType(_('special variable'), 'svar'),
'operator': ObjType(_('operator'), 'op'),
'constant': ObjType(_('constant'), 'const'),
'option': ObjType(_('option'), 'opt'),
}
directives = {
'function': DynFunction,
......
......@@ -52,7 +52,7 @@ class DynareLexer(RegexLexer):
"save_params_and_steady_state","load_params_and_steady_state",
"dynare_version","write_latex_definitions","write_latex_parameter_table",
"write_latex_prior_table","collect_latex_files","prior_function",
"posterior_function","generate_trace_plots")
"posterior_function","generate_trace_plots","evaluate_planner_objective")
report_commands = ("report","addPage","addSection","addGraph","addTable",
"addSeries","addParagraph","addVspace","write","compile")
......@@ -73,7 +73,7 @@ class DynareLexer(RegexLexer):
(r'\s*(%|//).*$', Comment),
(words((
'model','steady_state_model','initval','endval','histval',
'model','steady_state_model','initval','endval','histval','epilogue',
'shocks','mshocks','homotopy_setup','observation_trends',
'estimated_params','estimated_params_init','estimated_params_bounds',
'shock_groups','conditional_forecast_paths','optim_weights',
......@@ -92,7 +92,6 @@ class DynareLexer(RegexLexer):
(r'\s*[a-zA-Z_]\s*', Name),
(r'\s*(\d+\.\d+|\d*\.\d+)([eEf][+-]?[0-9]+)?\s*', Number.Float),
(r'\s*\d+[eEf][+-]?[0-9]+\s*', Number.Float),
(r'\s*\d+\s*', Number.Integer),
......
......@@ -248,7 +248,7 @@ The configuration file is designed as follows:
The list of slave options includes:
\begin{description}
\item[Name]: name of the node;
\item[CPUnbr]: this is the number of CPU's to be used on that computer; if \verb"CPUnbr" is a vector of integers, the syntax is \verb"[s:d]", with \verb"d>=s" (\verb"d, s" are integer); the first core has number 1 so that, on a quad-core, use \verb"4" to use all cores, but use \verb [3:4] to specify just the last two cores (this is particularly relevant for Windows where it is possible to assign jobs to specific processors);
\item[CPUnbr]: this is the number of CPU's to be used on that computer; if \verb"CPUnbr" is a vector of integers, the syntax is \verb"[s:d]", with \verb"d>=s" (\verb"d, s" are integer); the first core has number 1 so that, on a quad-core, use \verb"4" to use all cores, but use \verb"[3:4]" to specify just the last two cores (this is particularly relevant for Windows where it is possible to assign jobs to specific processors);
\item[ComputerName]: Computer name on the network or IP address; use the NETBIOS name under Windows\footnote{In Windows XP it is possible find this name in 'My Computer' $->$ mouse right click $->$ 'Property' $->$ 'Computer Name'.}, or the DNS name under Unix.;
\item[UserName]: required for remote login; in order to assure proper communications between the master and the slave threads, it must be the same user name actually logged on the `master' machine. On a Windows network, this is in the form \verb"DOMAIN\username", like \verb"DEPT\JohnSmith", i.e. user JohnSmith in windows group DEPT;
\item[Password]: required for remote login (only under Windows): it is the user password on \verb"DOMAIN" and \verb"ComputerName";
......