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.
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
orderoption ofstoch_simulaccepts an arbitrary positive integer (of course, up to some model-specific computational limit). -
New option
filtered_theoretical_moments_gridofstoch_simul, that supersedeshp_ngrid.
-
-
Estimation
-
Nonlinear estimation is now also available at an arbitrary approximation order. In other words, the
orderoption ofestimationaccepts 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_jscaleofestimationcommand for tuning the scale parameter of the proposal distribution of the Random Walk Metropolis Hastings. -
Added debugging info when parameters take a
NaNorInfvalue. -
Option
mode_compute=1is now available under Octave.
-
-
Perfect foresight and extended path
-
A significant speed improvement should be noted on large models (when neither
bytecodenorblockoption 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 theuse_dlloption is used). -
New options
printandnoprintofperfect_foresight_solvercommand. -
Option
stack_solve_algo=2is now available under Octave.
-
-
Steady state
- Option
solve_algo=7is now available under Octave.
- Option
-
Optimal policy
-
The
ramsey_policycommand is now deprecated. It is superseded by successive calls toramsey_model,stoch_simul, andevaluate_planner_objective(in this order). -
It is now possible to estimate a model under optimal policy (either Ramsey or discretionary) by running the
estimationcommand after eitherramsey_modelordiscretionary_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_filteroption to thedynare_sensitivitycommand. -
Arbitrary expressions can now be passed for the interval boundaries in
irf_calibrationandmoment_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 ofcontrolled_varexomatters: if the second endogenous variable is controlled for less periods than the first one, the secondcontrolled_varexoisn’t set for the last periods. -
New option
parameter_setto thecalib_smoothercommand. -
The results of conditional_forecastcommand is now saved inoo_(used to be in a file)
-
-
Shock decomposition
-
Added
fast_realtimeoption 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_dateandplot_end_dateoptions toplot_shock_decomposition. -
New
initial_decomposition_decompositioncommand, for computing and plotting the decomposition of the effect of smoothed initial conditions of state variables. -
New
squeeze_shock_decompositioncommand, for removing decompositions of variables that are not of interest. -
New
with_epilogueoption (common toshock_decomposition,realtime_shock_decompositionandinitial_condition_decomposition). -
New
init2shocksblock 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
@#defineoperator (e.g.@#define f(x) = 2*x^2+3*x+5). -
@#elseif-clauses are now supported in conditional statements. -
@#forloops can iterate over several variables at the same time (e.g.@#for (i,j) in X, whereXis an array containing tuples of size 2). -
Added the possibility to exclude some elements when iterating over
@#forloops (e.g.@#for i in 1:5 when mod(i,2) == 0iterates 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
@#echomacrovarsand@#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 flooroperator. -
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:3creates[1,2,3]while[1:3]would create[[1,2,3]]). -
Previously, printing a boolean would print 1or0. Now, it printstrueorfalse. 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_nameoframsey_modelanddiscretionary_policy. -
New command
model_local_variablecommand for assigning a LaTeX name to model-local variables. -
The
write_latex_static_modelandwrite_latex_original_modelcommands now support thewrite_equation_tagsoption.
-
-
Compilation of the model (
use_dlloption) 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_setupblock 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
modelblock. To do this, simply follow the symbol name with a vertical line (|, pipe character) and either ane, anx, or ap. For example, to declare a parameter namedalphain the model block, you could writealpha|pdirectly in an equation where it appears. Similarly, to declare an endogenous variablecin the model block you could writec|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, orparameterfollowed by an equal sign and the variable name in single quotes. Hence, to declare a variablecas endogenous in an equation tag, you can type[endogenous='c']. -
New
epilogueblock 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
.modfile. -
New option
nopreprocessoroutputto 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
-Dsyntax. -
New option
linemacroto 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
.modfile is saved in.jsonfiles. 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 underFILENAME/. -
The macro-generated output is now more readable (no more line numbers and empty lines). The old behaviour can be restored using the
linemacrooption (see above). -
Ability to call the preprocessor by passing the
.modfile as a string argument from the macOS or GNU/Linux command line.
-
-
dseries classes
-
New functionalities and efficiency improvements.
-
Complete rewrite using the new
classdefsyntax and exploiting in place modifications when possible. -
Integration of the
datesclasses withindseries.
-
-
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
classdefsyntax.
-
-
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_tolto themodelblock; 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 themjdgges,gensylv,A_times_B_kronecker_C,sparse_hessian_times_B_kronecker_Candlocal_state_space_iteration_2DLLs).
-
Since there are a few backward-incompatible changes in this release, users may want to have a look at the upgrade guide 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+fastoptions would not always recompile the model when the equations were changed. - Under certain circumstances, the combination of
bytecodeandstack_solve_algo=1options could lead to crashes or wrong results.
References
-
Komunjer, I. and S. Ng (2011), “Dynamic Identification of Dynamic Stochastic General Equilibrium Models,” 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,” Quantitative Economics, 3(1), 95–132
-
Mutschler, W. (2015), “Identification of DSGE models—The effect of higher-order approximation and
pruning,” Journal of Economic Dynamics and Control, 56, 34–54