We are pleased to announce the release of Dynare 5.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.
All users are strongly encouraged to upgrade.
This release is compatible with MATLAB versions ranging from 8.3 (R2014a) to 9.11 (R2021b), and with GNU Octave version 6.4.0 (under Windows).
The new tools for semistructural models and the improvements on the nonlinear solvers were funded by the European Central Bank. Special thanks to Nikola Bokan (ECB) for his contributions and numerous bug reports and fixes.
Major uservisible changes

New routines for simulating semistructural (backward) models where some equations incorporate expectations based on future values of a VAR or trend component model. See the
var_model
,trend_component_model
andvar_expectation_model
commands, and thevar_expectation
operator. 
New routines for simulating semistructural models where some equations are specified using the polynomial adjustment costs (PAC) approach, as in the FRB/US model (see Brayton et al., 2014 and Brayton et al., 2000) and the ECBBASE model (see Angelini et al., 2019). The forwardlooking terms of the PAC equations can be computed either using a satellite VAR model, or using full modelconsistent expectations. See the
pac_model
command and thepac_expectation
operator. 
New Method of Moments toolbox that provides functionality to estimate parameters by (i) Generalized Method of Moments (GMM) up to 3rdorder pruned perturbation approximation or (ii) Simulated Method of Moments (SMM) up to any perturbation approximation order. The toolbox is inspired by replication codes accompanying Andreasen et al. (2018), Born and Pfeifer (2014), and Mutschler (2018). It is accessible via the new
method_of_moments
command and the newmatched_moments
block. Moreover, by default, a new nonlinear least squares optimizer based onlsqnonlin
is used for minimizing the method of moments objective function (available undermode_compute=13
). GMM can further benefit from using gradientbased optimizers (usinganalytic_standard_errors
option and/or passing'Jacobian','on'
to the optimization options) as the Jacobian of the moment conditions can be computed analytically. 
Implementation of the Occbin algorithm by Guerrieri and Iacoviello (2015), together with the inversion filter of CubaBorda, Guerrieri, Iacoviello, and Zhong (2019) and the piecewise Kalman filter of Giovannini, Pfeiffer, and Ratto (2021). It is available via the new block
occbin_constraints
and the new commandsoccbin_setup
,occbin_solver
,occbin_graph
, andoccbin_write_regimes
. 
Stochastic simulations

stoch_simul
now supports theoretical moments atorder=3
withpruning
. 
stoch_simul
now reports second moments based on the pruned state space if thepruning
option is set (in previous Dynare releases it would report a secondorder accurate result based on the linear solution).


Estimation

Performance optimization to pruned state space systems and Lyapunov solvers.

New option
mh_posterior_mode_estimation
toestimation
to perform modefinding by running the MCMC. 
New heteroskedastic filter and smoother, where shock standard errors may unexpectedly change in every period. Triggered by the
heteroskedastic_filter
option of theestimation
command, and configured via theheteroskedastic_shocks
block. 
New option
mh_tune_guess
for setting the initial value formh_tune_jscale
. 
New option
smoother_redux
toestimation
andcalib_smoother
to trigger computing the Kalman smoother on a restricted state space instead of the full one. 
New block
filter_initial_state
for setting the initial condition of the Kalman filter/smoother. 
New option
mh_initialize_from_previous_mcmc
to theestimation
command that allows to pick initial values for a new MCMC from a previous one. 
The
xls_sheet
option of theestimation
command now takes a quoted string as value. The former unquoted syntax is still accepted, but no longer recommended. 
New option
particle_filter_options
to set various particle filter options.


Perfect foresight and extended path

New specialized algorithm in
perfect_foresight_solver
to deal with purely static problems. 
The
debug
option ofperfect_foresight_solver
provides debugging information if the Jacobian is singular. 
In deterministic models (perfect foresight or extended path), exogenous variables with lead/lags are now replaced by auxiliary variables. This brings those models in line with the transformation done on stochastic models. However, note that the transformation is still not exactly the same between the two classes of models, because there is no need to take into account the Jensen inequality for the latter. In deterministic models, there is a onetoone mapping between exogenous with lead/lags and auxiliaries, while in stochastic models, an auxiliary endogenous may correspond to a more complex nonlinear expression.


Optimal policy

Several improvements to
evaluate_planner_objective
: it now applies a consistent approximation order when doing the computation;
 in addition to the conditional welfare, it now also provides the unconditional welfare;
 in a stochastic context, it now works with higher order approximation (only the conditional welfare is available for order âŠž 3);
 it now also works in a perfect foresight context.

discretionary_policy
is now able to solve nonlinear models (it will then use their firstorder approximation, and the analytical steady state must be provided).


Identification

New option
schur_vec_tol
to theidentification
command, for setting the tolerance level used to find nonstationary variables in the Schur decomposition of the transition matrix. 
The
identification
command now supports optimal policy.


Shock decomposition
 The
fast_realtime
option of therealtime_shock_decomposition
command now accepts a vector of integers, which runs the smoother for all the specified data vintages.
 The

Macro processor
 Macroprocessor variables can be defined without a value (they are assigned integer 1).

LaTeX and JSON outputs

New
nocommutativity
option to thedynare
command. This option tells the preprocessor not to use the commutativity of addition and multiplication when looking for common subexpressions. As a consequence, when using this option, equations in various outputs (LaTeX, JSONâŚ) will appear as the user entered them (without terms or factors swapped). Note that using this option may have a performance impact on the preprocessing stage, though it is likely to be small. 
Modellocal variables are now substituted out as part of the various model transformations. This means that they will no longer appear in LaTeX or in JSON files (for the latter, they are still visible with
json=parse
orjson=check
).


Compilation of the model (
use_dll
option)
Block decomposition (option
block
ofmodel
) can now be used in conjunction with theuse_dll
option. 
The
use_dll
option can now directly be given to thedynare
command.


dseries classes

Routines for converting between time series frequencies (e.g. daily to monthly) have been added.

dseries now supports biannual and daily frequency data.

dseries can now import data from DBnomics, via the mdbnomics plugin. Note that this does not yet work under Octave. For the time being, the DBnomics plugin must be installed separately.


Misc improvements

The
histval_file
andinitval_file
commands have been made more flexible and now have functionalities similar to thedatafile
option of theestimation
command. 
When using the
loglinear
option, the output from Dynare now clearly shows that the results reported concern the log of the original variable. 
Options
block
andbytecode
ofmodel
can now be used in conjunction with modellocal variables (variables declared with a poundsign#
). 
The
model_info
command now prints the typology of endogenous variables for nonblock decomposed models. 
The total computing time of a run (in seconds) is now saved to
oo_.time
. 
New
notime
option to thedynare
command, to disable the printing and the saving of the total computing time. 
New
parallel_use_psexec
commandline Windowsspecific option for parallel local clusters: whentrue
(the default), usepsexec
to spawn processes; whenfalse
, usestart
. 
When compiling from source, it is no longer necessary to pass the
MATLAB_VERSION
version to the configure script; the version is now automatically detected.

Incompatible changes

Dynare will now generally save its output in the
MODFILENAME/Output
folder (or theDIRNAME/Output
folder if thedirname
option was specified) instead of the main directory. Most importantly, this concerns the_results.mat
and the_mode.mat
files. 
The structure of the
oo_.planner_objective
field has been changed, in relation to the improvements toevaluate_planner_objective
. 
The preprocessor binary has been renamed to
dynarepreprocessor
, and is now located in a dedicatedpreprocessor
subdirectory. 
The
dynare
command no longer acceptsoutput=dynamic
andoutput=first
(these options actually had no effect). 
The minimal required MATLAB version is now R2014a (8.3).

The 32bit support has been dropped for Windows.
Bugs that were present in 4.6.4 and that have been fixed in 5.0
 Equations marked with
static
tags were not detrended when adeflator
was specified  Parallel execution of
dsge_var
estimation was broken  The preprocessor would incorrectly simplify forwardlooking constant equations of the form
x(+1)=0
to implyx=0
 Under some circumstances, the use of the
model_local_variable
statement would lead to a crash of the preprocessor  When using the
block
option withoutbytecode
the residuals of the static model were incorrectly displayed  When using
k_order_solver
, thesimult_
function ignored requested approximation orders that differed from the one used to compute the decision
rules  Stochastic simulations of the
k_order_solver
withoutpruning
iterated on the policy function with a zero shock vector for the first (nonendogenous) period 
estimation
would ignore the mean of nonzero observables if the mean was 0 for the initial parameter vector 
mode_check
would crash if a parameter was estimated to be exactly 0 
load_mh_file
would not be able to load the proposal density if the previous run was done in parallel 
load_mh_file
would not work with MCMC runs from Dynare versions before 4.6.2 
ramsey_model
would not correctly work withlmmcp

ramsey_model
would crash if a nonscalar error code was encountered during steady state finding.  Using undefined objects in the
planner_objective
function would yield an erroneous error message about the objective containing exogenous variables 
model_diagnostics
did not correctly handle a previousloglinear
option 
solve_algo=3
(csolve) would ignore usersetmaxit
andtolf
options  The
planner_objective
values were not based on the correct initialization of auxiliary variables (if any were present)  The
nostrict
command line option was not ignoring unused endogenous variables ininitval
,endval
, andhistval

prior_posterior_statistics_core
could crash for models with eigenvalues very close to 1  The display of the equation numbers in
debug
mode related to issues in the Jacobian would not correctly take auxiliary equations into account  The
resid
command was not correctly taking auxiliary and missing equations related to optimal policy (ramsey_model
,discretionary_policy
) into account 
bytecode
would lock thedynamic.bin
file upon encountering an exception, requiring a restart of MATLAB to be able to rerun the file  Estimation with the
block
model option would crash when calling the block Kalman filter  The
block
model option would crash if noinitval
statement was present  Having a variable with the same name as the modfile present in the base workspace would result in a crash

oo_.FilteredVariablesKStepAheadVariances
was wrongly computed in the Kalman smoother based on the previous period forecast error variance  Forecasts after
estimation
would not work if there were lagged exogenous variables present  Forecasts after
estimation
with MC would crash if measurement errors were present  Smoother results would be infinity for auxiliary variables associated with lagged exogenous variables
 In rare cases, the posterior Kalman smoother could crash due to previously accepted draws violating the BlanchardKahn conditions when using an unrestricted state space

perfect_foresight_solver
would crash for purely static problems  Monte Carlo sampling in
identification
would crash if the minimal state space for the Komunjer and Ng test could not be computed  Monte Carlo sampling in
identification
would skip the computation of identification statistics for all subsequent parameter draws if an error was triggered by one draw  The
steps
option of Dynare++ was broken 
smoother2histval
would crash if variable names were too similar 
smoother2histval
was not keeping track of whether previously stored results were generated withloglinear
 The
initval_file
option was not supporting Dynareâs translation of a model into a one lead/lagmodel via auxiliary variables
References

Andreasen et al. (2018): âThe pruned statespace system for nonlinear DSGE models: Theory and empirical applications,â Review of Economic Studies, 85(1), 1â49

Angelini, Bokan, Christoffel, Ciccarelli and Zimic (2019): âIntroducing ECBBASE: The blueprint the new ECB semistructural model for the euro area,â ECB Working Paper no. 2315

Born and Pfeifer (2014): âPolicy risk and the business cycle,â Journal of Monetary Economics, 68, 68â85

Brayton, Davis and Tulip (2000): âPolynomial adjustment costs in FRB/US,â Unpublished manuscript

Brayton, Laubach, and Reifschneider (2014): âThe FRB/US Model: A tool for macroeconomic policy analysis,â FEDS Notes. Washington: Board of Governors of the Federal Reserve System, FRB: FEDS Notes: The FRB/US Model: A Tool for Macroeconomic Policy Analysis

CubaBorda, Guerrieri, Iacoviello, and Zhong (2019): âLikelihood evaluation of models with occasionally binding constraints,â Journal of Applied Econometrics, 34(7), 1073â1085

Giovannini, Pfeiffer, and Ratto (2021): âEfficient and robust inference of models with occasionally binding constraints,â Working Paper 202103, Joint Research Centre, European Commission

Guerrieri and Iacoviello (2015): âOccBin: A toolkit for solving dynamic models with occasionally binding constraints easily,â Journal of Monetary Economics, 70, 22â38

Mutschler (2018): âHigherorder statistics for DSGE models,â Econometrics and Statistics, 6(C), 44â56