Also add comments about the choice for the definition of the linear
combination of the VAR companion variables.
We should test the numbe of output arguments, not the number of input
arguments. This was bug was probably not affecting the outcomes since
the number of input arguments is always greater than 1.
Under Debian 12, it fails with:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/12/libgomp.a(team.o): réadressage R_X86_64_TPOFF32 vers symbole caché « gomp_tls_data » ne peut pas être utilisé en créant un objet partagé
The implicit conversion from Vector to ConstVector, in addition to the
rewriting rules and ConstVector::operator<=>, ensure that those are no longer
needed.
1. 'fGlobalVar' was misspelled
2. Removing the eval crashes the parallel option as global variables are not passed correctly. Because it originally was an assignment where the variable named options_ was assigned to fGlobalVar.options_, but after 47af0cdewe only assign the string 'options_' stored in GlobalNames{j}.
brute_force_regime_guess (default) and loss_function_regime_guess (optional, more time consuming) may be used to search for better solution (i.e. a solution providing better data density). Governed by options_.occbin.likelihood.number_of_initial_periods_with_extra_regime_guess
where the latter is 0 by default and can be set by user
Also allows periodic loops to be a solution (periodic_solution_strict=false), provided regime is found that does not violate constraint in expectation AND the number of periods in violation is smaller than max allowed (periodic_solution_threshold= INTEGER)
isfolder is the modern replacement to isdir, and is available in MATLAB ⩾
R2017b and in Octave ⩾ 7.
Detected and automatically fixed by MATLAB Code Analyzer app.
It’s not possible to use tildes for declaration of output arguments (otherwise
these arguments will be uninitialized if requested).
Detected by MATLAB Code Analyzer app.
Allows using e.g. TolFun=1.e-5 with coarser values for TolGstep; helpful whenmaximizing non smooth surfaces (e.g. PKF or very large models), where numerical noise may count. By default TolGstep=TolFun as in usual historical behavior.
- Use (old default) mode_compute=4 which is closer to the algorithm
used by Frank Schorfheide and ensures that the hessian matrix is well
behaved (contrary to the new default, because of the asymptote at 0
in the beta prior for autoregressive parameter ρ).
- Change parameterization for mst. A normal prior on mst is not
equivalent to a normal prior on log(mst) (which is done the
parameterization in the JAE paper).
Closes#2177.
Under Linux and macOS, the default location for the configuration file is now
dynare/dynare.ini under the configuration directories as defined by the XDG
specification. Under Windows, the default configuration file is now
%APPDATA%\dynare\dynare.ini.
There is now a default value for the global initialization file (GlobalInitFile
option of the configuration file): the global_init.m in the Dynare
configuration directory.
Automatically detected by clang-tidy using
clang-diagnostic-unused-but-set-variable, clang-analyzer-deadcode.DeadStores
and clang-diagnostic-unused-const-variable checks.
The test “solve_algo >= 6 || solve_algo <= 8” was always true.
Issue detected by clang-tidy using the
clang-diagnostic-tautological-overlap-compare check.
That class is a base class, so it must have a virtual destructor to avoid
memory leaks.
Issue detected by clang-tidy with
clang-diagnostic-delete-non-abstract-non-virtual-dtor check.
If a solution corresponding to 100% of the shock can’t be found in the first
informational period, marginal linearization will be performed to extrapolate a
solution.
However, in subsequent informational periods, this extrapolated solution cannot
be used for the initial conditions of endogenous variables, because the initial
conditions are not a true solution of the nonlinear model. For those subsequent
informational periods, the correct approach is to compute the two solutions
needed for marginal linearization using as initial conditions the values
obtained in the same two solutions for the previous informational
periods (stored as oo_.deterministic_simulation.{sim1,sim2}).
First simulation before doing extrapolation is stored in several fields of
oo_.deterministic_simulation.sim1.
For marginal linearization, the second simulation used to compute the marginal
contribution is stored in oo_.deterministic_simulation.sim2.
Unfortunately it is not possible to enable it for all supported Octave
versions (which would have allowed us to remove the old codepath), because of
this bug: https://savannah.gnu.org/bugs/?64687
MATLAB R2018b does not have a true batch mode, and will not exit if there is no
final quit statement in a script. Hence ensure there is one when testing a .m
file.
By the way, remove a batch argument for Windows that is obviously incorrect.
Compilation wargnings were pointing at: (i) some supposedly uninitialized variables (-Wmaybe-uninitialized); (ii) a pointer assignment (=) to a non-pointer target (-Wsurprising).
This replaces the old hack which was using a local Linux-specific symlink. Now,
the Dynare default is the same as in Sphinx, i.e. rely on a CDN for delivering
MathJax.
Adapt our CI accordingly to continue using MathJax from the Debian package
there (to avoid privacy issues related to the use of a CDN).
- Ensure that we always use the same DGP (e.g. same transition matrix).
- Call the mex more than once with different samples.
- Ensure that the size of the state space model is the same in tests 1, 2 and 3.
- Fix the seed (same samples across 1, 2 and 3 except for the additive noise in 2 and 3 on the observed variables).
In “evaluate” mode, with mfs>0, if the value of variable would depend on a
previously re-evaluated recursive variable, then the value used for that recursive
variable would be incorrect (it would be the value before re-evaluation of the
recursive variable, as passed by the caller).
In particular:
– properly return temporary terms as output argument in evaluate+dynamic mode
(with periods in rows and the temporary terms in column)
– drop the unused “global_temporary_terms” keyword input argument
- Simulation of the model was not working since to (1) wrong commented
line (dynare comments in a verbatim block), and (2) dates are not interpreted
in a verbatim block.
- A variable was missing (the auxiliary for the PAC expectation term) causing
problems for the initialisation of the simulations in dcontribs (presence of a
NaN in the guess for the first period).
Similarly to the regular “endval” block, any variable mentioned in this
block will jump to its new value in the period where the information is learnt.
In particular, this means that any temporary shock that may have been
anticipated on that variable (as specified through a “shocks(learnt_in=...)”
block for a previous informational period) will be overwritten.
Ensure that the block is always interpreted multiplicatively relative to the
steady state, and not relative to the pre-existing shock value (if there was
already a shock declared for the same exogenous and period(s)).
By the way, in the dynamic case, ensure that solve_algo variable corresponds to
options_.solve_algo; it would previously correspond to
options_.stack_solve_algo, while there is already a separate stack_solve_algo
variable for that purpose.
For marginal linearization, an extra simulation is needed. This extra
simulation is first computed using the first simulation as guess value. If that
does not work, the present commits adds an additional attempt for computing
that extra simulation, using a full homotopy loop from the beginning.
As a consequence, the present commits puts the homotopy loop in a dedicated
function.
If under a Wayland desktop session, some graphics would be displayed on the
screen, despite Octave being run in the virtual X11 frame buffer (xvfb).
Moreover, some unexplained random crashes would occur.
This commit ensures that Wayland is never used when running the testsuite.
By the way, add a command to explain why xvfb-run is needed and the
--no-window-system option cannot be run (see commit
96346b77e5).
Only modify oo_ when the homotopy procedure is finished, now that oo_ is no
longer an input to perfect_foresight_solver_core.
By the way, fix the treatment of the exogenous steady state (it is now set
in a consistent way with the endogenous steady state, if the shock is not
simulated up to 100%).
Also fix the initial guess when doing a second attempt at recomputing the
terminal steady state and failing (in the absence of a permanent shock). It was
supposed to use the initial steady state as an initial guess for that second
attempt (through oo_.steady_state), but since that latter variable was modified
in the loop, it would actually correspond to the same initial guess as in the
first attempt.
Fixes#1893Closes#1894
Explain how to get Xcode CLT and gcc via homebrew in installer at the end using a conclusion.html file.
Clarify this also in the manual.
- homotopy_mode = 2: in case of failure, print last successful point as in the
other two modes
- homotopy_mode = 1: if there is a failure at the first iteration (starting
values), do not incorrectly report that there was a successful point
- homotopy_mode = 3: if there is a failure at the first iteration (starting
values), honour the option homotopy_force_continue
– homotopy2: remove globals
MATLAB R2014a run with -nodisplay crashes with the TeX option. A workaround was
introduced in commit f946baf6c5. The present
commit updates this workaround following the move to the Meson build system.
By the way, use consistent variable naming in tests/run_mod_file.m.
By the way, simplify the dependency build system by removing 32-bit
SLICOT (was only used for the Octave package), and the symlinks for MatIO and
GSL (no longer needed with Meson).
Also changed:
- options_mom_.vector_output to options_mom_.mom.vector_output
- optimizer_vec to options_mom_.optimizer_vec
- oo_.dr.obs_var to oo_.mom.obs_var
This enables re-using estimation functions for other Bayesian estimation routines such as Bayesian method_of_moments and printing it nicer to the console.
Mostly working. The testsuite remains to be done.
In particular, windows/deps/mkoctfile64 is modified to print its version number
on stdout instead of stderr. This is what the standard mkoctfile does, and it
allows easier capture of the output from Meson.
The exogenous steady state vector was passed as a row-vector to
evaluate_steady_state, thus leading to an incorrectly-sized matrix passed to
bytecode when checking the steady state on the dynamic model (when different
from the static model).
The newly-created FBEGINBLOCK_ and FCALL_ instances were freed using a
base-class pointer. But the latter does not have a virtual destructor.
Those class instances are now stored by value in containers, so that the
destructor of the derived class is used.
This change allows the user to change the number of parameters for which the MCMC convergence diagnostics are shown. The user needs to set a value for options_.convergence.brooksgelman.plotrows for an arbitrary number of parameters to be shown, but defaulting to 3 if no input is supplied.
The considered pruning routines can be found in
- `simult_.m`
- `local_state_space_iteration_2` MEX
- `local_state_space_iteration_3` MEX
- `pruned_state_space_system.m`
Usually these files are not needed (if then user can turn this option on manually) and only clutter the folder.
Moreover, the testsuite crashes on rare occasions if several mod files are run in the same folder and the optimizers write the files simultaneously.
– new option “endval_steady” to pf_setup command to recompute terminal
steady state in the homotopy loop
– new options “homotopy_linearization_fallback” and
“homotopy_marginal_linearization_fallback” to pf_solver and pfwee_solver
commands, to get an approximate solution when homotopy fails to go to 100%
– new options “homotopy_initial_step_size”, “homotopy_min_step_size”,
“homotopy_step_size_increase_success_count” and “homotopy_max_completion_share”
to pf_solver and pfwee_solver commands to fine tune the homotopy behaviour
– removed option “homotopy_alt_starting_point” to pf_solver command, not really
useful
– new options “steady_solve_algo”, “steady_tolf”, “steady_tolx”,
“steady_maxit”, “steady_markowitz” to pf_solver and pfwee_solver commands, to
control the computation of the terminal steady state (and remove the
equivalent options which previously had different names in pfwee_solver command)
If the guess value passed to dynare_solve was such that the residuals were all
below tolerance, except some that were NaN, then this guess value would be
incorrectly accepted as a solution.
– enable maximum optimization (-O3), which in particular triggers code
auto-vectorization
– raise the minimal architectural requirement to match MSYS2 policy
(roughly requires CPUs from ~2006/7+)
– Remove the terminal_steady_state_as_guess_value option to pfwee_solver
– pfwee_setup now sets the same guess values as pf_setup (i.e. terminal steady
state at all periods)
– With constant_simulation_length option, pfwee_solver uses terminal steady
state as guess values for periods that are added to the simulation
Now uses options_.verbosity to decide what to print:
– if options_.verbosity == 0, prints nothing
– if options_.verbosity >= 1, prints iteration counter and duration, and fatal errors
– if options_.verbosity >= 2, additionally print floating point exceptions and
details about algorithmic decisions
Previously it would also include initial and terminal conditions (i.e.
residuals would have periods+maximum_lag+maximum_lead columns). But we do not
care about residuals at the initial and terminal conditions.
This change is for consistency with the perfect_foresight_problem MEX.
The formulas are taken from commit 46401325ed2c4d72adb6f1592cf6096bb844b489 of
the homebrew-core repository.
The gcc.rb formula was modified by adding “cellar: :any” to all bottles (see
https://github.com/Homebrew/brew/blob/master/docs/Bottles.md).
The preprocessor has been updated accordingly.
They now only return what’s really their output (simulated paths, maximum
residual error…). This is a move towards a more functional programming style.
In C++20, a==b can also be implicitly rewritten as b==a, assuming
commutativity. But if the operator==(const &) is not declared as const, and is
thus asymmetric, this results in an ambiguity because neither of a==b or b==a
is a better match according to the overload resolution rules.
This commit only changes the routine used to draw random deviates from
the prior distribution, without relying on persistent variables (which allows
parallelisation).
This bug would impact the qmc_sequence MEX, which manipulates an int64
input/output argument (the seed). Thanks to little-endianness, the bug would
however only manifest for seeds > 2³¹.
The statement “implicit none” forbids implicit typing of variables, but not
implicit procedure declaration. The new “implicit none (type, external)” syntax
forbids both, and is thus safer.
Explain that the solver is a direct sparse LU, to differentiate it from
stack_solve_algo={2,3,4} which use the same Newton algorithm but with different
solvers.
mxArray objects were not properly destroyed within the iteration loop, leading
to higher memory usage. Note that there was no memory leak, because these
objects would be destroyed later by MATLAB when exiting the MEX.
– ramsey_policy is now fully implemented at the preprocessor level
– 🐛 ramsey_policy: lift restriction that order must be ⩽ 2
– 🐛 Extend incompatibility with deterministic exogenous to ramsey_model command
If auxiliary variables were created *before* the Lagrange multipliers (e.g. aux
vars related to the expectation or diff operators), then the vector of
residuals of the reduced Ramsey steady state problem (with respect to original
variables, as computed by the dyn_ramsey_static_1 subfunction) was incorrect.
– 🐛 Incorrect stochastic transformation with endo lead ⩾ 2 or exo lead ⩾ 1 in
external functions
– New solution for solving the Ramsey steady state with Lagrange multipliers
with lead or lag ⩾ 2. Now generates a dedicated file for derivatives of static
model w.r.t. multipliers using chain rule derivation (#633, #1119, #1133)
– 🐛 Incorrect cost table used when computing temporary terms in static model
with “use_dll”
– 🐛 Crash when writing the (static) set_auxiliary_variables file in the
presence of external functions
Calls to change_type can be done in a file named model-inversion-setup.inc in
the current folder. The file is included, between the declaration of the
exogenous variables and the model block, in the aggregate mod file if and only
if the macrovariable InvertModel exists and is equal to True. To invert a model,
the user just has to run the aggregated mod file with -DInvertModel=True on the
command line.
Since 3244340e7a, the MEX files are built with
-fstack-protector. But this added a dynamic link to libssp-0.dll on some MEX
files, making them unusable.
The number of logical cores may be greater than the number of physical cores,
for example on Intel CPUs with hyperthreading. Using all logical cores makes
more sense in this context.
- enforce x86-64 architecture
- use “sysctl -n hw.ncpu” instead of “nproc” (which has not been installed in
the new runner)
- use MATLAB R2022b for building with the latest ABI
– Performance improvement of chain rule derivation (for block decomposition)
– Bugfix in derivation of external functions (a priori without consequences)
– Misc improvements and simplifications
The “more off” command is incompatible with MATLAB Online.
Moreover, output pagination is disabled by default on MATLAB and on
Octave (since version 4 for the latter), so in most cases that command would do
nothing.
Incidentally, this allows users to enable output pagination should they want
to.
[skip ci]
– Drop dynamic_g1_nz.m generated file
– Fix size of dynamic derivatives (legacy representation) when there are unused
exogenous and “nostrict” option is given
– Block decomposition: another fix for sparse indices of static Jacobian when
mfs > 0
We also take advantage of the fact that the non-block version is always
available next to the block one, so when we are only interested in the residual
as a whole, we simplify by using the non-block version.
As a consequence, a new “block_decomposed” option of the bytecode MEX has been
introduced to explicitly select the block-decomposed version.
Note that we do not always use the “block_decomposed” option even when the
“block” option has been passed to the user, in situations where the block
decomposition brings nothing (e.g. when evaluating the residuals of the whole
model).
Incidentally, no longer run Dynare++ unit tests, since they are intricated in
the Dynare++ build system. If we finally decide not to drop the Dynare++
codebase for our MEX files, then we should probably find a way to build and run
them again.
Ref. #1825
– Fix indexing in M_.endo_trends (Ref. #1648)
– JSON: fix output of date options (Closes: #1875)
– Allow LOG_* auxiliary variables in various commands
– Macro processor: fix tracking of line numbers after @#define, @#include and
@#includepath directives
– Macro processor: fix error message when @#include is used with nonexistent file
– Sparse representation: compatibility fix with MATLAB < R2020a (Closes: #1875)
– Sparse representation: fix bug in output of indices in driver and JSON files
Use the new time-recursive block decomposition computed by the preprocessor
for:
- the simulation of backward models with “simul_backward”
- the perfect foresight simulation of purely backward/forward/static models
Also note that in this case, the preprocessor now defaults to “mfs=3” (i.e. it
minimizes the set of feedback variables and tries to renormalize equations).
This replaces the previous algorithm based on Dulmage-Mendelsohn (dmperm), plus
an ad hoc identification of some equations that can be evaluated (those with a
LHS equal to a variable, the log of a variable, or the diff-log of a variable).
By the way, the block_trust_region MEX has been modified so that it accepts a
boolean argument to decide whether it performs a Dulmage-Mendelsohn
decomposition (if not, then it performs a simple trust region on the whole
nonlinear system).
This provides a significant performance improvement (of almost an order of
magnitude for solve_algo=14 on a 700 equations model).
Explicitly specify that OCTAVE_VERSION is a builtin. Otherwise the call to
“exists” will look for a file, among other things, which takes a lot of time.
The implementation was relying on the fact that in M_.equations_tags, all
equations have a name tag and they appear in the order given by equation
numbers. There is no guarantee that this will always be the case, so use a more
robust approach.
By the way, improve the implementation of get_equation_name_by_number.
We also do not check for periodicity when check ahead periods have been increased endogenously, again to avoid mis-identified periodicity.
Any other type of periodicity, is flagged as non-convergence with error code 313 (infinite loop of solutions).
when performing stochastic simulations, check ahead periods may increase endogenously at some point for regimes very long in expectation. such longer check ahead periods may considerably slow down convergence in subsequent periods, so users may want to avoid this.
— use_dll: fix bug where operator abs() within a .mod file would return an
incorrect result
— use_dll: various improvements to parallel compilation of MEX files
— use_dll: split generated C file into smaller files that will be compiled in
parallel
— various refactorings
— use_dll: compile MEX files in parallel
— bugfix: “relative_irf” option passed to “irf_calibration” was also passed to next command
— various refactorings
– fix bug with “graph_format” option of “identification” and
“dynare_sensitivity”
– fix check of “domain” option of new estimation prior syntax
– refactor OptionsList class
The formulas are taken from commit aae5963a69896021466a037f500aa06bef405be4 of
the homebrew-core repository.
The gcc.rb formula was modified by adding “cellar: :any” to all bottles (see
https://github.com/Homebrew/brew/blob/master/docs/Bottles.md).
The preprocessor has been updated accordingly.
A move to fixed format was erroneously made in
4893f0e82c and
ff85fc6489, where stream formatting of floating
points has been replaced by the use of std::to_string().
Use an iterator wrapped inside std::optional instead of a possibly-singular
iterator, because the latter has undefined behaviour.
By the way, pass arguments by const reference.
In particular, no longer rely on a duplicate implementation of the evaluator to
locate where the NaN or Inf is produced. Rather directly pass the pointer to
the faulty operator.
Class Evaluate had data members with the same name as members of
ErrorMsg (which it derives from). In practice, this means that the data members
from ErrorMsg could be unitialized when displaying error messages.
– before erroring out, check whether the residuals for the block are already
zero (in which case, move to next block)
– improve error message that is printed otherwise
Note that trying to solve under-determined blocks (as in dynare_solve.m) would
require too many changes in the existing code, so let’s leave it out.
Closes: #1851
– Bugfix with temporary terms in block+bytecode
– Block decomposition: (likely) performance improvement in static file in
relation to temp terms
– Code factorization
– Fix interaction of temporary terms with steady_state operator.
Incidentally, this implies that external functions can no longer be used inside
steady_state operators.
– JSON output: remove duplicate “rhs” field when RHS of equation is non-zero
constant
– Bytecode: remove hack for exogenous deterministic index
Previously, LBJ was available:
– under stack_solve_algo=6 when neither block nor bytecode were present
– under stack_solve_algo=1 with either block or bytecode (but the documentation
was not making it clear that it was LBJ)
This commit merges the two values for the option, and makes them
interchangeable. LBJ should now be invoked with stack_solve_algo=1 (but
stack_solve_algo=6 is kept for compatibility, and is a synonymous).
– Block decomposition: fix crash when a variable appears in an equation but has
zero symbolic derivative
– Correctly clean up options list after a “pac_model” statement
– A few optimizations
I’m not sure that the intent for the hash function was actually what is
currently in the code, but it’s not worth improving this given that we want to
get rid of Dynare++ and the performance impact is probably negligible.
The variable “gap” is compared to zero, so the intent probably was that it
could be negative. But size_t is an unsigned type. Rather use a signed type.
They don’t bring any added value, and break compilation in C++20 mode (because
they are then of type “const char8_t *” which is distinct from “const char *”).
This is more logical, since those values are constraints from the point of view
of the solver.
Also, this allows to have maxit and tolf options for the steady state solver,
at the level of the setup command, without a clash with the same option names
for the deterministic solver at the level of the solver command.
— Reject exogenous deterministic variables in a few places where they were
erroneously accepted
– Use booleans for “exo_det” and “multiplicative” fields of M_.det_shocks
— Add checks on the value of the “learnt_in” option of “shocks” and “endval”
The feval(f, x, args{:}) call would fail under Octave because the contents of
args{:} would be appended twice (hence too many input arguments error).
The same bug would materialize under MATLAB for errorcode>1.
In this version of Octave, “warning on” really enables all warnings (while this
was not the case in Octave 6, suprisingly; I think this used to be different
with even older Octave releases).
We therefore need to explicitly disable the Octave:array-as-logical warnings,
that is triggered by some internal Octave functions.
We also need to be careful to call “warning_config” instead of “warning on”
when restoring warnings to their default state.
Since Octave 7, LDFLAGS as returned by mkoctfile include -shared, which is
undesirable for generic LDFLAGS. Pass the --link-stand-alone option to strip
this flag.
In this version of Octave, “warning on” really enables all warnings (while this
was not the case in Octave 6, suprisingly; I think this used to be different
with even older Octave releases).
We must therefore avoid to reenable all warnings after having disabled a
problematic one.
It is now supported by the MATLAB editor (as of R2022a).
The old ASCII notation is left in some files that we copy as-is from other
sources (e.g. in the contrib/ and m4/ subdirectories).
The particles submodule is not updated at this point, because it is in an
inconsistent state.
[skip ci]
Print a message instead of throwing an error if the nonlinear solver fails in a
period, since we do not need previous or future values of the endogenous
variables. If the nonlinear solver fails in period t, the endogenous variables
are set to nan in period t.
There was no user interface, and the feature that it provides has lost
relevance over time.
Note that algorithms for block and/or bytecode still internally use some
equivalent of this parameter, but its initial value will no longer be
modifiable (which could lead to bugs, see commit
e49e7e906f).
Trust region with block decomposition (as provided by dmperm) fails to provide
correct simulations (most likely due to the interpretation of tolf which
depends on the number and size of blocks).
If solved function returns complex values (with nonzero imaginary part), turn
them into NaNs. This mimics the behaviour of the use_dll case.
Next step will be to adapt the trust region algorithm to diminish radius when
there are NaNs.
Incidentally, bump the required GCC version to 9, since we use the %re and %im
components of complex values in Fortran.
Note that the unitary test in lyapunov_solver.m that checks sparse matrix input
had to be removed. Previously, this test was passing by chance (because the
sparse test matrices had actually no zero element, hence the internal double
float storage was the same as in the dense case). Now it consistently fails
with the additional checks in disclyap_fast MEX.
Improve the model that is used to test all combinations of algorithms with
block and bytecode options, by ensuring that it includes the 8 possible types of blocks:
– Solve {forward, backward, two boundaries} {simple, complete}
– Evaluate {forward, backward}
All the “Solve” blocks are also included in both linear and nonlinear forms
(since the codepaths are typically different depending on the linearity of
the block).
Note that there is no such thing as a nonlinear “Evaluate” block, since the
endogenous variables of the block always enter linearly (on the LHS).
Also:
- use perfect_foresight_{setup,solver} instead of simul (and disable automatic homotopy)
- add a shock on e_R (though this is not strictly needed since the
corresponding block already inherits the shock from another ancestor block)
- remove the block for observables, there is already another block of type
“Evaluate forward”
When solving a “Solve two boundarise” block with stack_solve_algo=4, the
“slowc” variable is modified. This would affect the resolution of further
“solve backward/forward” blocks, which would yield results.
The fix consists in saving and restoring “slowc”.
Only one iteration is performed on linear blocks. But in the case of
stack_solve_algo=4 it is not enough, since it will not find the right optimal
path lenght at the first iteration (even though that optimal path length is
ufnitary).
– Temporary terms were not correctly passed between blocks
– solve_algo ⩾ 9 was incorrectly passed through bytecode own’s solver instead
of through dynare_solve
In 3025a14ed9, the call to the deprecated “luinc”
has been replaced by a call to “ilu”.
However, the type of “ilu” decomposition had not been specified. The default,
“nofill”, does not make use of the “droptol” option which was used with
“luinc”. Also, under Octave, it does not work when there is a zero on the
diagonal of the input matrix.
Rather use the “crout” type, which addresses these two issues.
These options were implemented and described in the reference manual, but their
interface was missing.
By the way, make various minor improvements to the description of “model_info”
in the reference manual. In particular, remove the single quotes around the two
aforementioned options (which are a remnant from an older interface).
It is needed for /usr/include/FlexLexer.h. It used to be a dependency of flex,
but has been demoted to a recommends, so it’s better to list separately.
[skip ci]
– Fix matching of diff leads/lags in TCM and PAC models
– Fix a bug in variable mapping (M_.mapping) where some endogenous, appearing
in a log() in a VAR or TCM, would not be mentioned
– Various refactorings related to auxiliary variables and TCM
The cherrypick was failing if the selected equations were not about a PAC equation (e.g. a VAR expectation
model), because the code was assuming the existence of the pac field in M_.
– Macroprocessor: under Windows, trim trailing slashes and backslashes in the
value of “@#includepath” (Closes: Madysson/estimation-codes#11)
– Remove unused field M_.pac.(model_name).lhs
By the way, drop the -static-* flags from LDFLAGS in Windows mkoctfile stub. It
is no more needed and creates duplicates in the link command line (since those
flags are already in DL_LDFLAGS).
Also adjust the periods in Simulated_time_series (output of the perfect
foresight solver in the workspace). Note that this dseries object contains the
observations for the initial condition (M_.orig_maximum_lag observations) and
for the terminal condition (M_.orig_maximum_lead observations).
See #1838.
Fix testsuite (wrong file name)
– Fix orig_lead_lag field for unary op auxiliary variables (Closes: #1837)
– In case of nested unary ops (e.g. log(log())), ensure that the definition of
the external aux var references the internal aux var
– Fix orig_lead_lag field for diff lag aux vars
– Refactor the code that substitutes unary ops in model equations
– Refactor handling of var_expectation_model statements
– Add missing “time_shift” option to JSON output of var_expectation_model
– Add check to ensure that column indices in derivative matrices do not overflow
Enforce the positivity of standard errors in the maximum likelihood
estimations. Otherwise some stderr are estimated negative, and the Bayesian
estimation fail because the initial value is out of the bounds of the prior
shape.
Auxiliary variables were still present in the growth neutrality correction. This
commit remove the auxiliaries, so that the user doesn't need to update the
database with the auxiliary variable definitions.
Also adds integration test.
TODO Check that it works with log unary op
TODO Complete tests by checking that the written evaluate routine works
By the same token, improve the logical expression for determining whether all
values are infinite (it was nevertheless giving the right result, because an
“all()” is implicit when an array of booleans is passed to an “if” statement).
The formulas are taken from commit afe7d6a73ec16b5479434bbe3613d4e7a3c28fac of
the homebrew-core repository.
The gcc.rb formula was modified by adding “cellar: :any” to all bottles (see
https://github.com/Homebrew/brew/blob/master/docs/Bottles.md).
The print_expectations routine was previously only considering the
aggregate expectation (for the target). Now it updates the
database (dseries) with each component of the PAC model. The growth
neutrality correction is included in the aggregate expectation but not
in the expectations of the components.
The taget in PAC equation can be decomposed into an arbitrary number of components (variables
in the VAR auxiliary model).
TODO Iterative OLS estimation (which is not the preferred estimation routine).
TODO Decomposition in the routine evaluating the forecasts for each component.
The change implemented in 21a8a5794a broke the
testsuite and was incomplete.
– new option “overwrite” to provide the old behaviour (used to fix the testsuite);
– when concatenating several “estimated_params” block, the preprocessor now
checks that paramateres are not declared twice across blocks.
– multiple “model” and “estimated_params” block are supported
– new “model_options” statement to set model options in a global fashion
– new “model_remove” command to remove equations
– new “model_replace” block to replace equations
– new “var_remove” command to remove variables (or parameters)
– new “estimated_params_remove” block to remove estimated parameters
gen_data.mod creates a datafile called "data.mat"
test_compute_Pinf_Pstar_data.mod creates a datafile called "Data.mat"
There could be a race condition on systems that don't distinguish between upper and lower cases.
- steady,
- check,
- evaluate_likelihood,
- evaluate_posterior_kernel, and
- evaluate_prior.
*Example*
After running a mod file, on the Matlab's command line:
>> cli.check
EIGENVALUES:
Modulus Real Imaginary
0 0 0
1.389e-16 1.389e-16 0
0.6452 0.6452 0
0.9707 0.9707 0
1.038 1.038 0
1.271e+16 1.271e+16 0
2.33e+17 2.33e+17 0
There are 3 eigenvalue(s) larger than 1 in modulus
for 3 forward-looking variable(s)
The rank condition is verified.
This commit only introduce new elements in the Dynare language (adding the
possibility to decompose the target into stationary and non stationary
components) and insure that all the former codes (ie without decomposition of
the target) are still working as expected.
The routine would not put elements at the right place in the residuals
vector (it would use variable indices instead of equation indices).
Also change the routine so that it computes a residual on evaluated
equations (instead of systematically returning zero for those).
Finally, simplify resid.m by calling this routine instead of embedding a
similar code.
Ref. #1823
– Macroprocessor: various fixes for CR+LF encoding
– Macroprocessor: fix line counter inside @{} constructs
– Fix handling of undeclared variables in the planner_objective statement
– With nostrict, really ignore unused endogenous in initval/endval/histval
– No longer consider an equation of the form “x(+1) = 0” as defining x to be a
constant
This patch provide a mathematically equivalent approach to update the growth
neutrality correction.
(cherry picked from commit 980a890487cd983eba027bdec63c8a777fd793f7)
Non zero mean exogenous variables in non optimizing part where not accounted for
due to a wrong call to `isfield` function. It is not possible to test
simultaneously the existence of a field and a subfield.
(cherry picked from commit 5a7c0fd2dda6c0ccc554994524bbefb95c29e722)
The correction for growth neutrality should be substituted in the optimal part
of the PAC equations.
(cherry picked from commit 12694ff9347b2191b4e0f6a32cb038956cb38f53)
- Force long run levels of the exogenous variables to be zero or g (the BGP growth rate of the LHS endogenous variable).
- Fix the correction of the correction for the share λ (aak γ).
- Provisions for the case where the long run level of the exogenous variable is
different from 0 or g (see tmp1 and ll which should be added to the growth
neutrality correction as a constant).
(cherry picked from commit a4423d734e1df1d4ee09c7225d7fd610e0d94cd1)
The code that computes ghx·yhat+ghu·u (both with and without pruning) was
making the implicit assumption that q⩽n, i.e. that the number of shocks is less
than or equal to the number of states. If q>n, it would try to read invalid
memory references in ghx and yhat, and would thus either crash or return dummy
results.
Closes: #1820
The Octave package for Windows ships with libgfortran from gfortran 9. This
version of libgfortran does not include symbol _gfortran_os_error_at, which is
needed by binaries created with gfortran 10 (used on our runners). The solution
is to statically link against libgfortran (as we already do for libgcc and
libstdc++).
– PAC: better error message in case of name conflict for the PAC growth
neutrality correction parameter
– improve message for GCC installation under macOS
– Windows 11 is supported
– macOS versions older than 11 are no longer supported
– Octave versions older than 6.2.0 are no longer supported
– do not claim compatibility with future (unknown) versions of MATLAB and Octave
- Creates the library `libkordersim` with all the relevant Fortran routines to `folded_to_unfolded_dr` and `local_state_space_iteration_fortran`
- Implements `folded_to_unfolded_dr`, which converts folded decision rule matrices to their unfolded counterparts
This is a workaround for Octave bug 46849. It complements commit
4c0b2e8c4e.
The workaround consists in moving the two problematic files to a subfolder
which is not in the path at startup. They will be added to the path later, at a
time when the Octave:shadowed-function warning has already been disabled by
warning_config.m.
Closes: #1817
This is a partial revert of 4346903c65. The
xlswrite function is actually not able to write XLS files on GNU/Linux and
macOS, and moreover its CSV fallback does not work with cell arrays.
- evaluate_planner_objective now returns conditional welfare depending on the initial value of the Lagrange multipliers when it is suitable to do so
- histval blocks are no longer ignored
— fix detection of x13as on Debian bookworm/sid
— add ability to use self-compiled x13as on macOS
— add ISO 8601 weeks
— generalize isleapyear routine for vector of integers
A bug was introduced in 440a0e460b, erroneously
changing the name of the baseline for a comparison.
The bug was left unnoticed with recent versions of MATLAB and on Octave,
because the first array in the ensuing comparison had zero line, and because of
automatic broadcasting, the error message was not triggered.
However, the bug was exposed on MATLAB < R2016b.
This code was never integrated in Dynare. Also, the authors would like to
release a new version soon, and they prefer that we remove this old version
from our repositories.
Closes: #568
The MATLAB_CFLAGS variable was not injected when testing for the presence of
libslicot64_pic. In particular, on GNU/Linux system, this means that the -fPIC
flag was not injected when doing the test. This was not a problem on Debian,
where GCC now enables -fPIC by default. But this would fail on RHEL, where
-fPIC is not enabled by default.
By the way:
— rename ac_save_* variables to my_save_*, to avoid conflicts with internal
autoconf variables;
— do not inject “$(mkoctfile -p LFLAGS)” into LDFLAGS when testing for SLICOT
under Octave; this is no longer necessary, since those flags are already
injected at the beginning of mex/build/octave/configure.ac.
This option could crash or give wrong results.
Bug introduced in 6d99b6d120.
The Vector(Vector &) and Vector(const Vector &) constructors are not
equivalent.
Closes: #1804
lsqnonlin is an optimization algorithm that is specifically well suited for minimizing quadratic objectives, so I would like to have it as default. However, we fallback to csminwel if the optimization toolbox for Matlab or optim for Octave are not available.
Instead of checking everything in one mod file, this commit separates the checks into individual mod files that test:
- whether the translation from matched_moments works
- whether the duplicate moments are found
- whether GMM and SMM both work with different estimated_params blocks.
wip
As we have a working interface now, this commit improves the provisional handling of finding duplicate moments. Previously, indices for GMM were created, but this is not really needed. This commit cleans this up and similar to SMM makes use of the matched_moments block.
As a by-product of the previous provisonal handling higher-order moments for SMM where not correctly displayed as no labels were created. This is now fixed. The comparison of data moments and estimated model moments is also in the same ordering as the inputed orthogonality conditions in matched_moments.
Signed-off-by: Willi Mutschler <willi@mutschler.eu>
On Windows, `filesep` evaluates to `\` and, in a `*printf` statement, this can have unintended consequences (e.g. `\t` evaluates to the tab character
Since '/' works on all systems, replace all occurrences of `filesep` with `/` in the codebase
- Rewrote doc headers
- Changed function signatures
- Removed persistent variables
- Compute the mode of the particle weights
- Return the covariance matrix of the particles in the last period
- Various cosmetic changes
If you don't do this, the title will be centered over the plot (not including YTickLabel width) as opposed to within the cell. This can be weird if you have one table in the section as the plot title will not center with the page title.
- 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'
Hello from the Dynare Team! We're happy you're on this page because hopefully that means you're thinking of getting directly involved with the Dynare project. Herein, we outline how you can contribute to Dynare. Please read this document all the way through before contributing.
Hello from the Dynare Team! We’re happy you’re on this page because hopefully that means you’re thinking of getting directly involved with the Dynare project. Herein, we outline how you can contribute to Dynare. Please read this document all the way through before contributing.
Please follow the steps in the sections below in order. Note that, though we'd love for you to contribute code, you don't need to be a programmer to contribute to Dynare. You can report bugs, ask for enhancements, fix typos in the manual, contribute tests to the test suite, or do something we haven't thought of yet!
Please follow the steps in the sections below in order. Note that, though we’d love for you to contribute code, you don’t need to be a programmer to contribute to Dynare. You can report bugs, ask for enhancements, fix typos in the manual, contribute tests to the test suite, or do something we haven’t thought of yet!
If something is not clear, don't hesitate to ask if you can't find the answer online. You can contact us directly at [dev@dynare.org](mailto:dev@dynare.org).
If something is not clear, don’t hesitate to ask if you can’t find the answer online. You can contact us directly at [dev@dynare.org](mailto:dev@dynare.org).
Please note that the repositories under the purview of this page are:
Before making changes to the codebase, it'd be helpful if you communicated your intentions with us. This will avoid double work and ensure that you don't contribute code that won't be included in Dynare for one reason or another.
Before making changes to the codebase, it’d be helpful if you communicated your intentions with us. This will avoid double work and ensure that you don’t contribute code that won’t be included in Dynare for one reason or another.
### Create your account on our GitLab instance
All the development of Dynare happens in [GitLab](https://about.gitlab.com/), which is an integrated environment for storing code under git, keeping track of issues and milestones, and perform testing. The Dynare Team has its own instance of GitLab.
In order to work with us, you need to create your account on our GitLab instance on the [register page](https://git.dynare.org/users/sign_in).
In order to work with us, you need to create your account on our GitLab instance on the [register page](https://git.dynare.org/users/sign_in). Note that account requests are manually validated, so be prepared to wait for a couple of hours or days before your account is created; if your account request is rejected, do not hesitate to contact us directly.
You will also need to register your SSH key in your GitLab profile if you want to contribute code.
@ -36,7 +34,7 @@ You can report bugs in both the stable and unstable versions of Dynare. Before r
To report a bug in Dynare, simply open a Gitlab issue in the repository where the bug resides. For example, to report a bug in Dynare itself, go to the [Dynare repository issue page](https://git.dynare.org/Dynare/dynare/issues) and click on "New Issue."
The minimal information to add is a subject and a description of the steps needed to reproduce the bug. However, the most helpful description would also provide the code to reproduce the bug (often times a `.mod` file). The most helpful `.mod` file is a minimal, quick-running example that reproduces the bug, but we'll take anything that will help us squash a bug.
The minimal information to add is a subject and a description of the steps needed to reproduce the bug. However, the most helpful description would also provide the code to reproduce the bug (often times a `.mod` file). The most helpful `.mod` file is a minimal, quick-running example that reproduces the bug, but we’ll take anything that will help us squash a bug.
To include short amounts of code, please paste it into the description box, using the appropriate [GitLab Flavored Markdown](https://docs.gitlab.com/ee/user/markdown.html) code. For larger amounds of code like `.mod` files, please create a new [GitLab snippet](https://git.dynare.org/dashboard/snippets) and provide the link in the description box.
@ -44,13 +42,13 @@ To include short amounts of code, please paste it into the description box, usin
Issues are not only used to report bugs. They are also used to ask for improvements to the codebase or new features to Dynare in general. Please be descriptive when asking for improvements or new features. Links or references to papers or detailed examples are helpful.
Though our development priorities lay with those who finance Dynare and with what we think may most benefit the Dynare community, this does not mean we are closed to outside ideas for enhancements. On the contrary: we invite them! Moreover, if you are willing to program the enhancement you want, the odds of it being included in Dynare are much higher than if you needed us to do it. That said, it is best to create an issue with an enhancement idea **before** beginning the work. As stated above, this is important to avoid duplication of work and also because we wouldn't want you to take the time to work on something that would not end up being included in Dynare.
Though our development priorities lay with those who finance Dynare and with what we think may most benefit the Dynare community, this does not mean we are closed to outside ideas for enhancements. On the contrary: we invite them! Moreover, if you are willing to program the enhancement you want, the odds of it being included in Dynare are much higher than if you needed us to do it. That said, it is best to create an issue with an enhancement idea **before** beginning the work. As stated above, this is important to avoid duplication of work and also because we wouldn’t want you to take the time to work on something that would not end up being included in Dynare.
## Get to Coding!
So, now you've reported the bug or asked for an enhancemnt by creating a GitLab issue. That's already a great help. Thank you!
So, now you’ve reported the bug or asked for an enhancemnt by creating a GitLab issue. That’s already a great help. Thank you!
Now, if you want to go the extra mile, you'll volunteer to contribute code to fix the GitLab issue you created above. Once we've agreed that you'll do it, please do the following:
Now, if you want to go the extra mile, you’ll volunteer to contribute code to fix the GitLab issue you created above. Once we’ve agreed that you’ll do it, please do the following:
@ -60,9 +58,10 @@ Now, if you want to go the extra mile, you'll volunteer to contribute code to fi
* `git remote add personal git@git.dynare.org:<<GitLab username>>/dynare.git`
1. Create a branch to work on
* `git checkout -b <<descriptive branch name>>`
1. Do your work, all the while respecting the [Dynare Coding Standards](https://archives.dynare.org/DynareWiki/CodingStandards)
1. Do your work, all the while respecting the [Dynare Coding Guidelines](https://git.dynare.org/Dynare/dynare/-/wikis/CodingGuidelines)
1. You may also want to have a look at the [coding resources](https://git.dynare.org/Dynare/dynare/-/wikis/CodingResources)
As you work, your forked repository will likely fall out of sync with the main Dynare repository as we'll be working in parallel. No matter. Follow these steps to ensure your changes will be merge-able when they're done:
As you work, your forked repository will likely fall out of sync with the main Dynare repository as we’ll be working in parallel. No matter. Follow these steps to ensure your changes will be merge-able when they’re done:
1. Get the changes from the main Dynare repository:
* `git checkout master`
@ -73,7 +72,7 @@ As you work, your forked repository will likely fall out of sync with the main D
* `git rebase origin/master`
* This last command may cause a conflict. It is up to you to resolve this conflict.
Once you've made the changes necessary to fix the bug or add an enhancement, ensure that it has been rebased on the master branch (following the steps above), commit it, push it to your forked Dynare repository, and create a pull request:
Once you’ve made the changes necessary to fix the bug or add an enhancement, ensure that it has been rebased on the master branch (following the steps above), commit it, push it to your forked Dynare repository, and create a pull request:
1. Get the latest changes from Dynare and rebase your branch on top of them (see above)
1. Commit your changes:
@ -85,17 +84,49 @@ Once you've made the changes necessary to fix the bug or add an enhancement, ens
## Tests
The Dynare testsuite runs every time a commit is pushed, either in the official repository or in your personal repository, through [GitLab Continuous Integration](https://docs.gitlab.com/ee/ci/). It's how we quickly catch bugs that may have been introduced by changes made.
The Dynare testsuite runs every time a commit is pushed, either in the official repository or in your personal repository, through [GitLab Continuous Integration](https://docs.gitlab.com/ee/ci/). It’s how we quickly catch bugs that may have been introduced by changes made.
The output from the latest run of the test suite can be found in the `test_matlab` job associated to the [latest pipeline](https://git.dynare.org/Dynare/dynare/pipelines). This is also a good place to start fixing bugs. If you see a `.mod` file that doesn't run in the test suite and think you can fix it, create an issue and once you have the go ahead, go for it!
The output from the latest run of the test suite can be found in the `test_matlab` job associated to the [latest pipeline](https://git.dynare.org/Dynare/dynare/pipelines). This is also a good place to start fixing bugs. If you see a `.mod` file that doesn’t run in the test suite and think you can fix it, create an issue and once you have the go ahead, go for it!
### Test `.mod` File
### Integration tests
It's useful to contribute `.mod` files that test some aspect of Dynare that is not currently tested. A `.mod` file that runs into a bug is perfect. As the test suite currently takes several hours to run, we prefer you modify a current test to also create the bug you've found. If you can't do that, please add a new test that runs as quickly as possible. It will contain only those commands necessary to create the bug, nothing more. To contribute a test, after having made an issue and cloned and forked the repository as described above, do the following:
It’s useful to contribute `.mod` files that test some aspect of Dynare that is not currently tested. A `.mod` file that runs into a bug is perfect. As the test suite currently takes several hours to run, we prefer you modify a current test to also create the bug you’ve found. If you can’t do that, please add a new test that runs as quickly as possible. It will contain only those commands necessary to create the bug, nothing more. To contribute a test, after having made an issue and cloned and forked the repository as described above, do the following:
1. Modify the `MODFILES` variable in `tests/Makefile.am` with a line containing your test file name
1. If any ancillary files are needed to run your test, please include them in the `EXTRA_DIST` variable in `tests/Makefile.am`
1. Add and commit your test file and `tests/Makefile.am` as described above
1. Modify the `mod_and_m_tests` variable in `meson.build` with a entry containing your test file name
1. If any ancillary files are needed to run your test, please include them in the `'extra'` field
1. Add and commit your test file and `meson.build` as described above
1. Push and create a pull request as described above
### Unitary Tests
### Unit tests
So-called unit tests allow the test suite to check the correct functioning of the MATLAB/Octave functions contained in Dynare. To add a unit test you need to
1. add the `return % --*-- Unit tests --*--` at the end of the `function` to tell the testsuite that the file contains unit tests.
1. Add the particular tests at the end of the file after the `return` statement by
1. Starting a test with `%@test:INTEGER`
2. Adding a MATLAB/Octave test code that provides a pass/fail indicator `T` that takes on `true` if the test passed.
3. Closing the test with `%@eof:INTEGER`
where `INTEGER` denotes the number of the test.
An example testing the correct functionality of mode-computations for a normal distribution is
```
function m = compute_prior_mode(hyperparameters,shape)
return % --*-- Unit tests --*--
%@test:1
% Normal density
try
m1 = compute_prior_mode([1 1],3);
t(1) = true;
catch
t(1) = false;
end
%$
if t(1)
t(2) = dassert(m1,1,1e-6);
end
T = all(t);
%@eof:1
```
You can also put a unit test after the closing `end`, but in this case you will need to preface each line with `%$`. See e.g. https://git.dynare.org/Dynare/dseries/-/commit/be4a4d39c125b92ee84ef876d86e6ec947c522b8
@ -26,7 +26,6 @@ Dynare distribution for specifics).
Here, we explain how to build from source:
- Dynare, including preprocessor and MEX files for MATLAB and Octave
- Dynare++
- all the associated documentation (PDF and HTML)
This source can be retrieved in three forms:
@ -34,8 +33,6 @@ This source can be retrieved in three forms:
- using the stable source archive of the latest Dynare version from <https://www.dynare.org/download/>
- using a source snapshot of the unstable version, also from <https://www.dynare.org/download/>
Note that if you obtain the source code via git, you will need to install more tools (see below).
The first section of this page gives general instructions, which apply to all platforms. Then some specific platforms are discussed.
**Note:** Here, when we refer to 32-bit or 64-bit, we refer to the type of
@ -46,8 +43,8 @@ determine the type of your MATLAB/Octave installation, type:
```matlab
>> computer
```
at the MATLAB/Octave prompt. Under MATLAB, if it returns `PCWIN64`, `GLNX64` or
`MACI64`, then it is a 64-bit MATLAB; if it returns `PCWIN`, `MACI` or `GLNX`,
at the MATLAB/Octave prompt. Under MATLAB, if it returns `PCWIN64`, `GLNX64`,
`MACI64` or `MACA64` then it is a 64-bit MATLAB; if it returns `PCWIN`, `MACI` or `GLNX`,
then it is a 32-bit MATLAB. Under Octave, if it returns a string that begins
with `x86_64`, it is a 64-bit Octave; if the strings begins with `i686`, it is
a 32-bit Octave.
@ -59,6 +56,7 @@ a 32-bit Octave.
1. [**Fedora, CentOS or RHEL**](#fedora-centos-or-rhel)
1. [**Windows**](#windows)
1. [**macOS**](#macos)
1. [**Docker**](#docker)
## General Instructions
@ -66,207 +64,166 @@ a 32-bit Octave.
A number of tools and libraries are needed in order to recompile everything. You don't necessarily need to install everything, depending on what you want to compile.
- A POSIX compliant shell and an implementation of Make (mandatory)
- The [GNU Compiler Collection](http://gcc.gnu.org/), version 8 or later, with
gcc, g++ and gfortran (mandatory)
- The [GNU Compiler Collection](https://gcc.gnu.org/), version 10 or later, with
gcc, g++ and gfortran
- [MATLAB](https://mathworks.com) (if you want to compile the MEX for MATLAB)
- [GNU Octave](http://www.octave.org) with
- [GNU Octave](https://www.octave.org) with
- the development headers (if you want to compile the MEX for Octave)
- the development libraries corresponding to the [UMFPACK](https://people.engr.tamu.edu/davis/suitesparse.html) packaged with Octave
- Optionally, the [Control](https://wiki.octave.org/Control_package), [IO](https://wiki.octave.org/IO_package), [Optimization](https://wiki.octave.org/Optimization_package) and [Statistics](https://wiki.octave.org/Statistics_package) package either installed via your package manager or through [Octave Forge](https://wiki.octave.org/Category:Octave_Forge).
- [Boost libraries](http://www.boost.org), version 1.36 or later
- [Bison](http://www.gnu.org/software/bison/), version 3.2 or later (only if you get the source through Git)
- [Flex](http://flex.sourceforge.net/), version 2.5.4 or later (only if you get the source through Git)
- [Autoconf](http://www.gnu.org/software/autoconf/), version 2.62 or later (only if you get the source through Git)
- [Automake](http://www.gnu.org/software/automake/), version 1.11.2 or later (only if you get the source through Git)
- An implementation of BLAS and LAPACK: either [ATLAS](http://math-atlas.sourceforge.net/), [OpenBLAS](http://xianyi.github.com/OpenBLAS/), Netlib ([BLAS](http://www.netlib.org/blas/), [LAPACK](http://www.netlib.org/lapack/)) or [MKL](http://software.intel.com/en-us/intel-mkl/) (only if you want to build Dynare++)
- [MAT File I/O library](http://sourceforge.net/projects/matio/), version 1.5 or later (if you want to compile Markov-Switching code, the estimation DLL, k-order DLL and Dynare++)
- [SLICOT](http://www.slicot.org) (if you want to compile the Kalman steady state DLL)
- [GSL library](http://www.gnu.org/software/gsl/) (if you want to compile Markov-Switching code)
- the development libraries corresponding to the [UMFPACK](https://people.engr.tamu.edu/davis/suitesparse.html) packaged with Octave (if you want to compile the MEX for Octave)
- the [statistics](https://octave.sourceforge.io/statistics/) package and, optionally, the [control](https://octave.sourceforge.io/control/), [io](https://octave.sourceforge.io/io/) and [optimization](https://octave.sourceforge.io/optim/) packages, either installed via your package manager or through [Octave Forge](https://octave.sourceforge.io/)
- [Meson](https://mesonbuild.com), version 0.64.0 or later
- [Pkgconf](http://pkgconf.org/), or another pkg-config implementation
- [Bash](https://www.gnu.org/software/bash/)
- [Boost libraries](https://www.boost.org), version 1.36 or later
- [Bison](https://www.gnu.org/software/bison/), version 3.2 or later
- [Flex](https://github.com/westes/flex), version 2.5.4 or later
- [MAT File I/O library](https://sourceforge.net/projects/matio/), version 1.5 or later (only when compiling for Octave)
The last line runs Autoconf and Automake in order to prepare the build environment (this is not necessary if you got the sources from an official source archive or the source snapshot). If you want a certain version (e.g. 4.6) , then add `--single-branch --branch 4.6` to the git clone command.
If you want a certain version (e.g. 5.x) , then add `--single-branch --branch 5.x` to the git clone command.
### Configuring the build tree
### Configuring the build directory
Simply launch the configure script from a terminal:
If you want to compile for MATLAB, please run the following (after adapting the path to MATLAB):
- `--disable-matlab`: skip the compilation of MEX files for MATLAB
- `--disable-octave`: skip the compilation of MEX files for Octave
- `--disable-doc`: skip the compilation of the documentation (PDF and HTML)
You may need to specify additional options to the configure script, see the output of the `--help` option, and also the platform specific instructions below. If the configuration goes well, the script will tell you which components are correctly configured and will be built.
Note that it is possible that some MEX files cannot be compiled, due to missing
build dependencies. If you find no way of installing the missing dependencies,
a workaround can be to give up on compiling these MEX files and rather use
slower implementations (in the MATLAB/Octave language) that are available under
the `matlab/missing/mex/` subdirectories. For example, if you fail to compile
the gensylv MEX, you can type the following at the MATLAB/Octave prompt before
(where you need to replace `<DYNARE_ROOT>` with the full path to your Dynare copy).
The build directory will thus be `build-octave`.
Note that if you do not chose `build-matlab` (under MATLAB) or `build-octave`
(under Octave) as the build directory, you will need to set the environment
variable `DYNARE_BUILD_DIR` to the full path of your build tree, before running
MATLAB or Octave, if you want Dynare to be able to find the preprocessor and
the MEX files.
It is possible to specify various Meson options, see the Meson documentation
for more details. Modifying options of an existing build directory can be
done using the `meson configure` command.
### Building
Binaries are built with:
For compiling the preprocessor and the MEX files:
```sh
make
meson compile -C <builddir>
```
PDF and HTML documentation are respectively built with:
where `<builddir>` is the build directory, typically either `build-matlab` or `build-octave`.
PDF and HTML documentation can be built with:
```sh
make pdf
make html
meson compile -C <builddir> doc
```
### Check
The Git source comes with unit tests (in the MATLAB functions) and integration tests (under the `tests` subfolder). All the tests can be run with:
Dynare comes with unit tests (in the MATLAB functions) and integration tests (under the `tests` subfolder). All the tests can be run with:
```sh
make check
```
in the `tests` subfolder. If Dynare has been compiled against MATLAB and Octave, the tests will be run with both MATLAB and Octave. Depending on the performance of your machine, this can take several hours. It is possible to run the tests only with MATLAB:
```sh
make check-matlab
```
or only with Octave:
```sh
make check-octave
meson test -C <builddir>
```
Depending on the performance of your machine, this can take several hours.
Note that running the testsuite with Octave requires the additional packages `pstoedit`, `epstool`, `xfig`, and `gnuplot`.
A summary of the results is available in `tests/run_test_matlab_output.txt` or `tests/run_test_octave_output.txt`. Often, it does not make sense to run the complete testsuite. For instance, if you modify codes only related to the perfect foresight model solver, you can decide to run only a subset of the integration tests, with:
Often, it does not make sense to run the complete testsuite. For instance, if you modify codes only related to the perfect foresight model solver, you can decide to run only a subset of the integration tests, with:
```sh
make deterministic_simulations
meson test -C <builddir> --suite deterministic_simulations
```
This will run all the integration tests in `tests/deterministic_simulations` with MATLAB and Octave. Again, it is possible to do this only with MATLAB:
This will run all the integration tests in `tests/deterministic_simulations`.
This syntax also works with a nested directory (e.g. `--suite deterministic_simulations/purely_forward`).
Finally if you want to run a single integration test, e.g. `deterministic_simulations/lbj/rbc.mod`:
```sh
make m/deterministic_simulations
meson test -C <builddir> deterministic_simulations/lbj/rbc.mod
```
or with Octave:
```sh
make o/deterministic_simulations
```
Finally if you want to run a single integration test, e.g. `deterministic_simulations/lbj/rbc.mod` with MATLAB:
```sh
make deterministic_simulations/lbj/rbc.m.trs
```
or with Octave:
```sh
make deterministic_simulations/lbj/rbc.o.trs
```
The result of the test (`PASSED` or `FAILED`) will be printed in the terminal, the produced log can be displayed with:
```sh
make deterministic_simulations/lbj/rbc.m.drs
```
or
```sh
make deterministic_simulations/lbj/rbc.o.drs
```
Note that only tests will be executed where the `m.trs/o.trs` does not yet exist. You can run
```sh
make clean
```
in the `tests` folder to delete files that were created by the run of the testsuite. You can also manually delete the desired `m.trs/o.trs` file(s).
NB: Some individual tests cannot be run using that syntax, if they are a dependency in a chain of tests (see the `mod_and_m_tests` variable `meson.build`); in that case, you should use the name of the last `.mod` file in the chain as the test name to be passed to `meson test`.
## Debian or Ubuntu
All the prerequisites are packaged:
- `build-essential` (for gcc, g++ and make)
- `gcc`
- `g++`
- `gfortran`
- `liboctave-dev`
- `octave-dev` (or `liboctave-dev` on older Debian/Ubuntu releases)
If you use MATLAB, we strongly advise to also `apt install matlab-support` and confirm to rename the GCC libraries shipped with MATLAB to avoid possible conflicts with GCC libraries shipped by your distribution.
In Fedora these are available from the default repositories; whereas for CentOS and RHEL you need to enable the [Extra Packages for Enterprise Linux (EPEL)](https://fedoraproject.org/wiki/EPEL) repository and either the PowerTools repository for CentOS or the CodeReady Linux Builder repository for RHEL:
The documentation packages have slightly different names in CentOS and RHEL, you can also choose to pass the `--disable-doc` flag to your configure script to skip these dependencies.
The documentation packages have slightly different names in CentOS and RHEL, but this should only impact you if you build the documentation.
`Slicot` and `x13as` need to be compiled from source:
sed -i "s|-static| |" makefile.gf # this removes '-static' in the makefile.gf
make -f makefile.gf FFLAGS="-O2 -std=legacy" PROGRAM=x13as
sudo cp x13as /usr/bin/
@ -305,17 +265,16 @@ sudo cp x13as /usr/bin/
If you use MATLAB, we strongly advise to also rename or exclude the GCC libraries shipped with MATLAB to avoid possible conflicts with GCC libraries shipped by Fedora, see e.g. [Matlab on Fedora 33](https://mutschler.eu/linux/install-guides/fedora-post-install/#matlab) or [MATLAB-ArchWiki](https://wiki.archlinux.org/index.php/MATLAB) for instructions.
Keep in mind to use the `--with-slicot` option to the configure command, e.g.:
Now use the following commands if using MATLAB (adapt them for Octave, see above):
If your distribution ships an older version of `bison`, compile it from source and append it *temporarily* to your path before calling the configure script:
If your distribution ships an older version of `bison`, compile it from source and append it *temporarily* to your path before running meson:
If you are installing `git-lfs` for the first time, you need to run `git lfs install` once after installing it.
- Link the sphinx-doc package to be able to compile the documentation:
```sh
arch -$ARCH $BREWDIR/bin/brew link --force sphinx-doc
```
- Install [MacTeX](http://www.tug.org/mactex/index.html) using the universal installer, if you want to build the documentation. MacTeX runs natively on both ARM and Intel machines. On Apple Silicon, it is advised to symlink `pdflatex`, `bibtex` and `latexmk` into `/usr/local/bin`:
If you don't have admin privileges, then you can also symlink them into `$HOME/.local/bin` and add this folder to your PATH.
- Install MATLAB and additional toolboxes.
We recommend, but don't require, the following: Optimization, Global Optimization, Statistics and Machine Learning, Econometrics, and Control System.
For Apple Silicon: MATLAB offers a native Apple silicon version (arm64) as of version R2023b, see [the official instructions](https://de.mathworks.com/support/requirements/apple-silicon.html) how to install it.
You can also run the Intel version (x86_64) under Rosetta 2.
Don't forget to run MATLAB at least once to make sure you have a valid license.
where the path to MATLAB is specified, typically of the form
`/Applications/MATLAB_R2020b.app`. If you don’t have MATLAB, simply replace
`--with-matlab=<…>` in the above command by `--disable-matlab`.
where you need to adapt the path to MATLAB.
Similarly, if you want to compile for Octave, replace the `-Dmatlab_path` option by `-Dbuild_for=octave`, and change the build directory to `build-octave`.
- Compile:
```sh
make -j$(nproc)
arch -$ARCH meson compile -C $BUILDDIR
```
If no errors occured, you are done. Dynare is now ready to use.
- If you additionally want to compile the documentation run:
```sh
arch -$ARCH meson compile -C $BUILDDIR doc
```
- Optionally, run the testsuite:
```sh
arch -$ARCH meson test -C $BUILDDIR --num-processes=$(sysctl -n hw.perflevel0.physicalcpu)
```
where `--num-processes` specifies the number of parallel processes to use for the testsuite (here set to the number of performance cores on your mac).
### Optional: pass the full PATH to MATLAB to run system commands
If you start MATLAB from a terminal, you will get the PATH inherited from the shell.
However, when you click on the application icon in macOS, you are not running at the terminal level:
the program is run by launcher, which does not go through a shell login session.
In other words, you get the system default PATH which includes `/usr/bin:/bin:/usr/sbin:/sbin`, but not `/usr/local/bin` or `$HOME/.local/bin`.
So if you want to use system commands like `pdflatex`, `latexmk` or `x13as` you should either call them by their full path (e.g `/Library/TeX/texbin/pdflatex`)
or append the PATH by running `setenv('PATH', [getenv('PATH') ':/usr/local/bin:$HOME/.local/bin:/Library/TeX/texbin']);` in your MATLAB command line once,
e.g. by adding this to your mod file. Alternatively, you can create a `startup.m` file or change the system default PATH in the `/etc/paths` file.
## Docker
We offer a variety of pre-configured Docker containers for Dynare, pre-configured with Octave and MATLAB including all recommended toolboxes.
These are readily available for your convenience on [Docker Hub](https://hub.docker.com/r/dynare/dynare).
The `scripts/docker` folder contains [information and instructions](scripts/docker/README.md) to interact, built and customize the containers.
AC_ARG_ENABLE([org-export], AS_HELP_STRING([--enable-org-export], [enable exporting of Org files (requires Emacs, org-mode and other external programs)]))
test "$PDFLATEX" = no && AC_MSG_ERROR([pdflatex cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])
AC_CHECK_PROG([BIBTEX], [bibtex], [bibtex], [no])
test "$BIBTEX" = no && AC_MSG_ERROR([bibtex cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])
test "$SPHINXBUILD" = no && AC_MSG_ERROR([sphinx-build cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])
AX_LATEX_CLASS([beamer], [ax_latex_have_beamer], [], [AC_MSG_ERROR([beamer cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])])
fi
# Check for BLAS, LAPACK and MATIO, needed by Dynare++
if test "$enable_dynareplusplus" = yes; then
AC_PROG_F77
AC_F77_LIBRARY_LDFLAGS
case ${host_os} in
*darwin*)
# * OS X doesn't need to link against the Fortran libraries because
# everything is contained within the vecLib framework.
FLIBS=''
;;
esac
AX_BLAS
AX_LAPACK
AX_MATIO
if test "$ax_blas_ok" != yes -o "$ax_lapack_ok" != yes -o "$has_matio" != yes; then
AC_MSG_ERROR([Some dependencies of Dynare++ cannot be found. If you want to skip the compilation of Dynare++, pass the --disable-dynare++ flag.])
fi
fi
# Check for MATLAB
if test "$enable_matlab" = yes; then
AC_CONFIG_SUBDIRS([mex/build/matlab])
AX_MATLAB
AX_MATLAB_BATCH_OPTIONS
test "$ax_enable_matlab" != yes && AC_MSG_ERROR([MATLAB cannot be found. If you want to compile Dynare without MATLAB support, pass the --disable-matlab flag.])
fi
# Check for Octave
if test "$enable_octave" = yes; then
AC_CONFIG_SUBDIRS([mex/build/octave])
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
if test "$enable_dynareplusplus" = yes; then
BUILD_DYNAREPLUSPLUS="yes"
TESTSUITE_DYNAREPLUSPLUS="yes"
else
BUILD_DYNAREPLUSPLUS="no"
TESTSUITE_DYNAREPLUSPLUS="no"
fi
if test "$enable_doc" = yes; then
BUILD_DOC="yes"
else
BUILD_DOC="no"
fi
if test -n "$enable_org_export"; then
BUILD_INTERNAL_DOC="yes"
else
BUILD_INTERNAL_DOC="no"
fi
if test "$enable_matlab" = yes; then
TESTSUITE_MATLAB="yes"
else
TESTSUITE_MATLAB="no"
fi
if test "$enable_octave" = yes; then
TESTSUITE_OCTAVE="yes"
else
TESTSUITE_OCTAVE="no"
fi
AC_MSG_NOTICE([
Dynare is now configured for building the following components...
\indent Many thanks to Christopher Sims for providing his BVAR
MATLAB\textregistered~routines, to St\'ephane Adjemian and Michel Juillard
MATLAB\textsuperscript{\textregistered}~routines, to St\'ephane Adjemian and Michel Juillard
for their helpful support, and to Marek Jaroci\'nski for reporting a bug.
}}
\author{S\'ebastien Villemot\thanks{Paris School of Economics and
CEPREMAP.}\and Johannes Pfeifer\thanks{Universität der Bundeswehr München. E-mail: \href{mailto:johannes.pfeifer@unibw.de}{\texttt{johannes.pfeifer@unibw.de}}.}}
CEPREMAP.}\and Johannes Pfeifer\thanks{University of the Bundeswehr Munich. E-mail: \href{mailto:johannes.pfeifer@unibw.de}{\texttt{johannes.pfeifer@unibw.de}}.}}
\date{First version: September 2007 \hspace{1cm} This version: May 2017}
author = {Adjemian, St\'ephane and Bastani, Houtan and Juillard, Michel and Mihoubi, Ferhat and Perendia, George and Ratto, Marco and Villemot, S\'ebastien},
title = {Dynare: Reference Manual, Version 4},
institution = {CEPREMAP},
year = {2011},
type = {Dynare Working Papers},
number = {1}
@TechReport{adjemian/al:2011,
author = {Adjemian, St\'ephane and Bastani, Houtan and Juillard, Michel and Karam\'e, Fr\'ederic and Maih, Junior and Mihoubi, Ferhat and Mutschler, Willi and Perendia, George and Pfeifer, Johannes and Ratto, Marco and Villemot, S\'ebastien},
institution = {CEPREMAP},
title = {Dynare: Reference Manual Version 4},
year = {2011},
number = {1},
type = {Dynare Working Papers},
}
@Article{blanchard/kahn:1980,
author = {Blanchard, Olivier Jean and Kahn, Charles M.},
journal = {Econometrica},
title = {The Solution of Linear Difference Models under Rational Expectations},
year = {1980},
month = {7},
number = {5},
pages = {1305-11},
volume = {48},
abstract = {Many have questioned the empirical relevance of the Calvo-Yun model. This paper adds a term structure to three widely studied macroeconomic models (Calvo-Yun, hybrid and Svensson). We back out from observations on the yield curve the underlying macroeconomic model that most closely matches the level, slope and curvature of the yield curve. With each model we trace the response of the yield curve to macroeconomic shocks. We assess the fit of each model against the observed behaviour of interest rates and find limited support for the Calvo-Yun model in terms of fit with the observed yield curve, we find some support for the hybrid model but the Svensson model performs best.},
doi = {10.2307/1912186},
keywords = {Macromodels Yield curve Persistence},
}
@Article{klein:2000,
author = {Klein, Paul},
journal = {Journal of Economic Dynamics and Control},
title = {Using the generalized {Schur} form to solve a multivariate linear rational expectations model},
year = {2000},
month = {September},
number = {10},
pages = {1405-1423},
volume = {24},
doi = {10.1016/s0165-1889(99)00045-7},
}
@Article{schmitt-grohe/uribe:2004,
author = {Schmitt-Groh\'{e}, Stephanie and Ur\'{i}be, Martin},
journal = {Journal of Economic Dynamics and Control},
title = {Solving dynamic general equilibrium models using a second-order approximation to the policy function},
year = {2004},
month = {January},
number = {4},
pages = {755-775},
volume = {28},
doi = {10.1016/s0165-1889(03)00043-5},
}
@Article{sims:2001,
author = {Sims, Christopher A},
journal = {Computational Economics},
title = {Solving Linear Rational Expectations Models},
year = {2002},
month = {October},
number = {1-2},
pages = {1-20},
volume = {20},
doi = {10.1023/A:1020517101123},
}
@InCollection{uhlig:1999,
author = {Uhlig, Harald},
booktitle = {Computational Methods for the Study of Dynamic Economies},
publisher = {Oxford University Press},
address = {Oxford},
title = {A toolkit for analysing nonlinear dynamic stochastic models easily},
year = {1999},
editor = {Marimon, Ramon and Scott, Andrew},
pages = {30-61},
}
@article{blanchard/kahn:1980,
author = {Blanchard, Olivier Jean and Kahn, Charles M.},
title = {The Solution of Linear Difference Models under Rational Expectations},
abstract = {Many have questioned the empirical relevance of the Calvo-Yun model. This paper adds a term structure to three widely studied macroeconomic models (Calvo-Yun, hybrid and Svensson). We back out from observations on the yield curve the underlying macroeconomic model that most closely matches the level, slope and curvature of the yield curve. With each model we trace the response of the yield curve to macroeconomic shocks. We assess the fit of each model against the observed behaviour of interest rates and find limited support for the Calvo-Yun model in terms of fit with the observed yield curve, we find some support for the hybrid model but the Svensson model performs best.},
title = {A toolkit for analysing nonlinear dynamic stochastic models easily},
booktitle = {Computational Methods for the Study of Dynamic Economics},
publisher = {Oxford University Press},
year = {1999},
editor = {Marimon, Ramon and Scott, Androw},
pages = {30-61}
}
@techreport{kamenik:2003,
@techreport{kamenik:2004,
author = {Kamenik, Ondra},
title = {Solution of Specialized Sylvester Equation},
institution = {Manuscript},
year = {2003}
year = {2004}
}
@article{collard/juillard:2001:compecon,
author = {Collard, Fabrice and Juillard, Michel},
title = {A Higher-Order Taylor Expansion Approach to Simulation of Stochastic Forward-Looking Models with an Application to a Nonlinear Phillips Curve Model},
title = {A Higher-Order {Taylor} Expansion Approach to Simulation of Stochastic Forward-Looking Models with an Application to a Nonlinear {Phillips} Curve Model},
year = {2001},
month = {6},
number = {2-3},
pages = {125-139},
volume = {17},
doi = {10.1023/A:1011624124377},
}
@book{golub/van-loan:1996,
author = {Golub, Gene H. and Van Loan, Charles F.},
title = {Matrix Computations},
publisher = {The John Hopkins University Press},
year = {1996},
edition = {third}
@Book{golub/van-loan:1996,
author = {Golub, Gene H. and Van Loan, Charles F.},
\title{Stochastic simulations with {\sc Dynare}. \\ A practical guide.}
\author{Fabrice Collard (GREMAQ, University of Toulouse)\\Adapted for Dynare 4.1\\ by Michel Juillard and S\'ebastien Villemot (CEPREMAP)}
\author{Fabrice Collard (GREMAQ, University of Toulouse)\\Adapted for Dynare 4.x\\ by Michel Juillard and S\'ebastien Villemot (CEPREMAP)}
\date{First draft: February 2001\hspace{10mm}This draft: December 2009.}
\maketitle
This document describes a model involving both endogenous and exogenous state variable. We first describe the theoretical model, before showing how the perturbation method is implemented in {\sc Dynare}.
\section{A theoretical model}
We consider an economy that consists of a large number of dynastic households and a large number of firms. Firms are producing a homogeneous final product that can be either consumed or invested by means of capital and labor services. Firms own their capital stock and hire labor supplied by the households. Households own the firms. In each and every period three perfectly competitive markets open --- the markets for consumption goods, labor services, and financial capital in the form of firms' shares.
\section{A theoretical model}
We consider an economy that consists of a large number of dynastic households and a large number of firms. Firms are producing a homogeneous final product that can be either consumed or invested by means of capital and labor services. Firms own their capital stock and hire labor supplied by the households. Households own the firms. In each and every period three perfectly competitive markets open --- the markets for consumption goods, labor services, and financial capital in the form of firms' shares.
Household preferences are characterized by the lifetime utility function:
\noindent where $0<\beta^\star<1$ is a constant discount factor, $c_t$ is consumption in period
$t$, $h_t$ is the fraction of total available time devoted to productive activity in period $t$, $\theta>0$ and $\psi\geqslant0$. We assume that there exists a central planner that determines hours, consumption and capital accumulation maximizing the household's utility function subject to the following budget constraint
$t$, $h_t$ is the fraction of total available time devoted to productive activity in period $t$, $\theta>0$ and $\psi\geqslant0$. We assume that there exists a central planner that determines hours, consumption and capital accumulation maximizing the household's utility function subject to the following budget constraint
\begin{equation}
c_t+i_t=y_t
\label{eq:bud}
@ -44,7 +44,7 @@ a_t\\b_t
\left(
\begin{array}{cc}
\rho&\tau\\
\tau&\rho\\
\tau&\rho\\
\end{array}
\right)\left(
\begin{array}{c}
@ -57,7 +57,7 @@ a_{t-1}\\b_{t-1}
\end{array}
\right) \label{eq:process}
\end{equation}
where $|\rho+\tau|<1$ and $|\rho-\tau|<1$ for sake of stationarity and
where $|\rho+\tau|<1$ and $|\rho-\tau|<1$ for sake of stationarity and
The {\sc dynare} code is straightforward to write, as the equilibrium is written in the natural way. The whole code is reported at the end of the section. Before that we proceed step by step.
\paragraph{Preamble}
The preamble consists of the some declarations to setup the endogenous and exogenous variables, the parameters and assign values to these parameters.
The preamble consists of the some declarations to setup the endogenous and exogenous variables, the parameters and assign values to these parameters.
\begin{enumerate}
\item{\tt var y, c, k, h, a, b;} specifies the endogenous variables in the model since we have output ({\tt y}), consumption ({\tt c}), capital ({\tt k}), hours ({\tt h}) and the two shocks ({\tt a, b}).
\item{\tt varexo e, u;} specifies the exogenous variables in the model --- namely the innovations of the shocks, since we have the innovation of the non--incorporated shock ({\tt e}), and the innovation of the incorporated shock ({\tt u}).
@ -133,9 +133,9 @@ theta = 2.95;
\end{enumerate}
\paragraph{Declaration of the model:}
This step is done in a straightforward way. It starts with the instruction {\tt model;} and ends with {\tt end;}, in between all equilibrium conditions are written exactly the way we write it ``by hand''. However, there is a simple rule that should be kept in mind when the model is written. Let us consider a variable $x$:
This step is done in a straightforward way. It starts with the instruction {\tt model;} and ends with {\tt end;}, in between all equilibrium conditions are written exactly the way we write it ``by hand''. However, there is a simple rule that should be kept in mind when the model is written. Let us consider a variable $x$:
\begin{itemize}
\item If $x$ is decided in period $t$ then we simply write ${\tt x}$.
\item If $x$ is decided in period $t$ then we simply write ${\tt x}$.
\item When the variable is decided in $t-1$, such as the capital stock in our simple model, we write ${\tt x(-1)}$. \item Finally, when a variable is decided in the next period, $t+1$, such as consumption in the Euler equation, we write ${\tt x(+1)}$.
\end{itemize}
Hence the required code to declare our model in {\sc Dynare} will be:
@ -164,7 +164,7 @@ end;
\end{verbatim}
so that the level of consumption is actually given by ${\tt exp(c)}$.
\paragraph{Solving the model}
\begin{enumerate}
\begin{enumerate}
\item Now we need to provide numerical initial conditions for the computation of the deterministic steady state. This is done with the sequence between {\tt initval;} and {\tt end;}. Each variable, endogenous or exogenous, should be initialized. In our example, we give the exact values of the deterministic equilibrium in absence of shocks. This takes the form
\begin{verbatim}
initval;
@ -206,12 +206,12 @@ Number of periods on which to compute the IRFs (default = 40)
\item{\tt nofunctions}:
Doesn't print the coefficients of the approximated solution
\item{\tt nomoments}:
Doesn't print moments of the endogenous variables
Doesn't print moments of the endogenous variables
\item{\tt order} = [1,2,3]:
Order of Taylor approximation (default = 2)
\item{\tt replic} = Integer:
Number of simulated series used to compute the IRFs (default = 1, if order = 1, and 50 otherwise)
<pathstyle="stroke:none;"d="M 3.09375 -14.140625 L 3.6875 -13.203125 C 3.78125 -13.015625 3.921875 -12.921875 4.140625 -12.921875 C 4.21875 -12.921875 4.328125 -12.953125 4.453125 -13.03125 C 4.5625 -13.109375 4.703125 -13.1875 4.875 -13.28125 C 5.03125 -13.375 5.234375 -13.453125 5.46875 -13.53125 C 5.6875 -13.609375 5.96875 -13.640625 6.3125 -13.640625 C 6.796875 -13.640625 7.171875 -13.515625 7.46875 -13.265625 C 7.765625 -13.015625 7.9375 -12.6875 7.9375 -12.265625 C 7.9375 -11.9375 7.859375 -11.640625 7.734375 -11.40625 C 7.59375 -11.15625 7.4375 -10.953125 7.234375 -10.765625 C 7.03125 -10.5625 6.8125 -10.390625 6.59375 -10.234375 C 6.375 -10.0625 6.15625 -9.890625 5.96875 -9.71875 C 5.78125 -9.546875 5.640625 -9.34375 5.53125 -9.125 C 5.421875 -8.921875 5.390625 -8.671875 5.421875 -8.40625 L 5.578125 -6.953125 L 7.09375 -6.953125 L 7.296875 -8.25 C 7.328125 -8.4375 7.40625 -8.609375 7.5625 -8.765625 C 7.703125 -8.90625 7.875 -9.0625 8.078125 -9.234375 C 8.28125 -9.375 8.484375 -9.546875 8.703125 -9.734375 C 8.9375 -9.90625 9.125 -10.109375 9.3125 -10.359375 C 9.5 -10.609375 9.671875 -10.890625 9.78125 -11.21875 C 9.90625 -11.546875 9.96875 -11.9375 9.96875 -12.40625 C 9.96875 -12.859375 9.890625 -13.28125 9.71875 -13.65625 C 9.546875 -14.03125 9.3125 -14.34375 9.015625 -14.625 C 8.703125 -14.875 8.34375 -15.078125 7.921875 -15.234375 C 7.5 -15.375 7.03125 -15.453125 6.5 -15.453125 C 6.125 -15.453125 5.765625 -15.40625 5.4375 -15.34375 C 5.125 -15.265625 4.8125 -15.171875 4.53125 -15.046875 C 4.25 -14.9375 3.984375 -14.796875 3.75 -14.640625 C 3.515625 -14.484375 3.296875 -14.3125 3.09375 -14.140625 Z M 4.90625 -3.625 C 4.90625 -3.21875 5.03125 -2.90625 5.296875 -2.640625 C 5.53125 -2.375 5.875 -2.25 6.265625 -2.25 C 6.4375 -2.25 6.609375 -2.28125 6.796875 -2.359375 C 6.953125 -2.421875 7.09375 -2.53125 7.21875 -2.65625 C 7.328125 -2.78125 7.421875 -2.90625 7.5 -3.078125 C 7.578125 -3.25 7.609375 -3.421875 7.609375 -3.625 C 7.609375 -3.796875 7.578125 -3.984375 7.5 -4.15625 C 7.421875 -4.328125 7.328125 -4.46875 7.21875 -4.59375 C 7.09375 -4.71875 6.953125 -4.8125 6.796875 -4.875 C 6.609375 -4.953125 6.4375 -5 6.265625 -5 C 5.875 -5 5.53125 -4.859375 5.296875 -4.59375 C 5.03125 -4.328125 4.90625 -4 4.90625 -3.625 Z M 0.5625 -17.75 L 0.5625 0 L 12.625 0 L 12.625 -17.75 Z M 1.171875 -0.671875 L 1.171875 -17.078125 L 11.921875 -17.078125 L 11.921875 -0.671875 Z M 1.171875 -0.671875 "/>
<pathstyle="stroke:none;"d="M 3.09375 -14.140625 L 3.6875 -13.203125 C 3.78125 -13.015625 3.921875 -12.921875 4.140625 -12.921875 C 4.21875 -12.921875 4.34375 -12.953125 4.453125 -13.03125 C 4.5625 -13.109375 4.703125 -13.203125 4.875 -13.28125 C 5.03125 -13.375 5.234375 -13.453125 5.46875 -13.53125 C 5.703125 -13.609375 5.984375 -13.640625 6.3125 -13.640625 C 6.796875 -13.640625 7.171875 -13.515625 7.484375 -13.265625 C 7.78125 -13.015625 7.9375 -12.6875 7.9375 -12.265625 C 7.9375 -11.9375 7.875 -11.640625 7.734375 -11.40625 C 7.59375 -11.171875 7.4375 -10.953125 7.234375 -10.765625 C 7.03125 -10.578125 6.828125 -10.390625 6.59375 -10.234375 C 6.375 -10.078125 6.171875 -9.90625 5.96875 -9.71875 C 5.796875 -9.546875 5.65625 -9.34375 5.53125 -9.140625 C 5.421875 -8.921875 5.390625 -8.6875 5.421875 -8.40625 L 5.578125 -6.953125 L 7.09375 -6.953125 L 7.296875 -8.25 C 7.328125 -8.4375 7.421875 -8.609375 7.5625 -8.765625 C 7.703125 -8.921875 7.875 -9.0625 8.078125 -9.234375 C 8.28125 -9.390625 8.484375 -9.546875 8.703125 -9.734375 C 8.9375 -9.90625 9.140625 -10.125 9.3125 -10.359375 C 9.515625 -10.609375 9.671875 -10.890625 9.78125 -11.21875 C 9.90625 -11.5625 9.96875 -11.9375 9.96875 -12.40625 C 9.96875 -12.859375 9.890625 -13.28125 9.71875 -13.65625 C 9.546875 -14.03125 9.3125 -14.359375 9.015625 -14.625 C 8.703125 -14.875 8.34375 -15.09375 7.9375 -15.234375 C 7.5 -15.375 7.03125 -15.453125 6.5 -15.453125 C 6.125 -15.453125 5.78125 -15.40625 5.453125 -15.34375 C 5.125 -15.28125 4.8125 -15.171875 4.53125 -15.0625 C 4.25 -14.9375 3.984375 -14.8125 3.765625 -14.640625 C 3.515625 -14.484375 3.3125 -14.328125 3.09375 -14.140625 Z M 4.90625 -3.625 C 4.90625 -3.234375 5.03125 -2.90625 5.296875 -2.65625 C 5.546875 -2.375 5.875 -2.25 6.265625 -2.25 C 6.453125 -2.25 6.625 -2.296875 6.796875 -2.359375 C 6.953125 -2.421875 7.09375 -2.53125 7.21875 -2.65625 C 7.328125 -2.78125 7.4375 -2.921875 7.515625 -3.078125 C 7.578125 -3.25 7.609375 -3.4375 7.609375 -3.625 C 7.609375 -3.796875 7.578125 -3.984375 7.515625 -4.15625 C 7.4375 -4.328125 7.328125 -4.46875 7.21875 -4.59375 C 7.09375 -4.71875 6.953125 -4.8125 6.796875 -4.875 C 6.625 -4.953125 6.453125 -5 6.265625 -5 C 5.875 -5 5.546875 -4.859375 5.296875 -4.59375 C 5.03125 -4.34375 4.90625 -4 4.90625 -3.625 Z M 0.5625 -17.75 L 0.5625 0 L 12.625 0 L 12.625 -17.75 Z M 1.171875 -0.671875 L 1.171875 -17.078125 L 11.921875 -17.078125 L 11.921875 -0.671875 Z M 1.171875 -0.671875 "/>
</symbol>
<symboloverflow="visible"id="glyph0-1">
<pathstyle="stroke:none;"d="M 17.65625 -8.875 C 17.65625 -10.203125 17.453125 -11.40625 17.03125 -12.5 C 16.609375 -13.59375 16.015625 -14.515625 15.234375 -15.296875 C 14.46875 -16.078125 13.546875 -16.6875 12.46875 -17.109375 C 11.390625 -17.53125 10.203125 -17.75 8.890625 -17.75 L 2.265625 -17.75 L 2.265625 0 L 8.890625 0 C 10.203125 0 11.390625 -0.203125 12.46875 -0.625 C 13.546875 -1.046875 14.46875 -1.65625 15.234375 -2.4375 C 16.015625 -3.203125 16.609375 -4.15625 17.03125 -5.234375 C 17.453125 -6.328125 17.65625 -7.53125 17.65625 -8.875 Z M 15.1875 -8.875 C 15.1875 -7.78125 15.046875 -6.796875 14.75 -5.953125 C 14.453125 -5.078125 14.03125 -4.359375 13.484375 -3.765625 C 12.9375 -3.171875 12.265625 -2.71875 11.5 -2.421875 C 10.71875 -2.09375 9.84375 -1.953125 8.890625 -1.953125 L 4.671875 -1.953125 L 4.671875 -15.8125 L 8.890625 -15.8125 C 9.84375 -15.8125 10.71875 -15.65625 11.5 -15.34375 C 12.265625 -15.015625 12.9375 -14.578125 13.484375 -13.984375 C 14.03125 -13.375 14.453125 -12.65625 14.75 -11.796875 C 15.046875 -10.921875 15.1875 -9.96875 15.1875 -8.875 Z M 15.1875 -8.875 "/>
<pathstyle="stroke:none;"d="M 17.546875 -8.875 C 17.546875 -10.203125 17.328125 -11.40625 16.90625 -12.5 C 16.484375 -13.59375 15.890625 -14.515625 15.125 -15.3125 C 14.359375 -16.078125 13.4375 -16.6875 12.359375 -17.125 C 11.28125 -17.546875 10.09375 -17.75 8.796875 -17.75 L 2.15625 -17.75 L 2.15625 0 L 8.796875 0 C 10.09375 0 11.28125 -0.203125 12.359375 -0.640625 C 13.4375 -1.0625 14.359375 -1.65625 15.125 -2.4375 C 15.890625 -3.21875 16.484375 -4.15625 16.90625 -5.234375 C 17.328125 -6.328125 17.546875 -7.546875 17.546875 -8.875 Z M 15.078125 -8.875 C 15.078125 -7.78125 14.9375 -6.796875 14.640625 -5.953125 C 14.34375 -5.09375 13.921875 -4.359375 13.375 -3.765625 C 12.828125 -3.1875 12.171875 -2.71875 11.390625 -2.421875 C 10.609375 -2.109375 9.75 -1.953125 8.796875 -1.953125 L 4.578125 -1.953125 L 4.578125 -15.8125 L 8.796875 -15.8125 C 9.75 -15.8125 10.609375 -15.65625 11.390625 -15.34375 C 12.171875 -15.03125 12.828125 -14.578125 13.375 -13.984375 C 13.921875 -13.375 14.34375 -12.65625 14.640625 -11.796875 C 14.9375 -10.9375 15.078125 -9.96875 15.078125 -8.875 Z M 15.078125 -8.875 "/>
</symbol>
<symboloverflow="visible"id="glyph0-2">
<pathstyle="stroke:none;"d="M 12.578125 -12.546875 L 10.828125 -12.546875 C 10.6875 -12.546875 10.546875 -12.5 10.421875 -12.421875 C 10.296875 -12.328125 10.21875 -12.21875 10.171875 -12.09375 L 6.90625 -4.203125 C 6.78125 -3.859375 6.65625 -3.484375 6.546875 -3.09375 C 6.4375 -3.46875 6.328125 -3.84375 6.203125 -4.1875 L 2.84375 -12.09375 C 2.796875 -12.203125 2.71875 -12.296875 2.609375 -12.40625 C 2.5 -12.5 2.359375 -12.546875 2.171875 -12.546875 L 0.265625 -12.546875 L 5.4375 -0.734375 L 3.140625 4.25 L 4.78125 4.25 C 5 4.25 5.171875 4.203125 5.296875 4.09375 C 5.40625 4 5.5 3.875 5.578125 3.703125 Z M 12.578125 -12.546875 "/>
<pathstyle="stroke:none;"d="M 5.484375 3.703125 L 12.484375 -12.546875 L 10.734375 -12.546875 C 10.59375 -12.546875 10.453125 -12.515625 10.328125 -12.421875 C 10.21875 -12.34375 10.140625 -12.234375 10.09375 -12.09375 L 6.828125 -4.203125 C 6.75 -4.015625 6.6875 -3.828125 6.625 -3.640625 C 6.5625 -3.453125 6.515625 -3.265625 6.453125 -3.078125 C 6.421875 -3.265625 6.375 -3.453125 6.3125 -3.640625 C 6.25 -3.828125 6.1875 -4 6.125 -4.1875 L 2.765625 -12.09375 C 2.71875 -12.203125 2.640625 -12.3125 2.53125 -12.421875 C 2.421875 -12.5 2.265625 -12.546875 2.078125 -12.546875 L 0.171875 -12.546875 L 5.359375 -0.734375 L 3.0625 4.25 L 4.703125 4.25 C 4.9375 4.25 5.109375 4.203125 5.203125 4.09375 C 5.328125 4 5.421875 3.859375 5.484375 3.703125 Z M 5.484375 3.703125 "/>
</symbol>
<symboloverflow="visible"id="glyph0-3">
<pathstyle="stroke:none;"d="M 3.828125 -10.734375 L 3.65625 -12.09375 C 3.578125 -12.390625 3.375 -12.546875 3.078125 -12.546875 L 1.75 -12.546875 L 1.75 0 L 3.96875 0 L 3.96875 -9.25 C 4.4375 -9.78125 4.953125 -10.203125 5.53125 -10.515625 C 6.09375 -10.828125 6.703125 -10.984375 7.359375 -10.984375 C 8.234375 -10.984375 8.890625 -10.71875 9.328125 -10.203125 C 9.765625 -9.671875 9.984375 -8.9375 9.984375 -7.984375 L 9.984375 0 L 12.203125 0 L 12.203125 -7.984375 C 12.203125 -8.703125 12.109375 -9.34375 11.9375 -9.9375 C 11.75 -10.515625 11.46875 -11.015625 11.125 -11.4375 C 10.78125 -11.859375 10.328125 -12.1875 9.8125 -12.40625 C 9.296875 -12.625 8.6875 -12.75 8 -12.75 C 7.5625 -12.75 7.140625 -12.703125 6.75 -12.59375 C 6.375 -12.5 6.015625 -12.359375 5.65625 -12.1875 C 5.3125 -12.015625 5 -11.8125 4.703125 -11.5625 C 4.390625 -11.3125 4.09375 -11.03125 3.828125 -10.734375 Z M 3.828125 -10.734375 "/>
<pathstyle="stroke:none;"d="M 1.8125 0 L 4.015625 0 L 4.015625 -9.25 C 4.5 -9.78125 5.015625 -10.203125 5.578125 -10.515625 C 6.140625 -10.828125 6.75 -10.984375 7.40625 -10.984375 C 8.296875 -10.984375 8.96875 -10.734375 9.390625 -10.203125 C 9.84375 -9.671875 10.046875 -8.953125 10.046875 -7.984375 L 10.046875 0 L 12.25 0 L 12.25 -7.984375 C 12.25 -8.703125 12.171875 -9.359375 11.984375 -9.9375 C 11.796875 -10.515625 11.53125 -11.03125 11.171875 -11.453125 C 10.828125 -11.859375 10.390625 -12.1875 9.859375 -12.421875 C 9.34375 -12.640625 8.734375 -12.75 8.046875 -12.75 C 7.171875 -12.75 6.390625 -12.5625 5.71875 -12.1875 C 5.046875 -11.828125 4.4375 -11.34375 3.890625 -10.734375 L 3.71875 -12.09375 C 3.625 -12.40625 3.4375 -12.546875 3.125 -12.546875 L 1.8125 -12.546875 Z M 1.8125 0 "/>
</symbol>
<symboloverflow="visible"id="glyph0-4">
<pathstyle="stroke:none;"d="M 8.546875 -5.65625 L 8.546875 -3.046875 C 8.296875 -2.78125 8.046875 -2.546875 7.78125 -2.34375 C 7.515625 -2.125 7.25 -1.953125 6.96875 -1.8125 C 6.671875 -1.65625 6.375 -1.53125 6.0625 -1.46875 C 5.734375 -1.390625 5.375 -1.34375 5 -1.34375 C 4.703125 -1.34375 4.421875 -1.375 4.171875 -1.453125 C 3.921875 -1.53125 3.703125 -1.640625 3.515625 -1.78125 C 3.328125 -1.9375 3.1875 -2.125 3.078125 -2.375 C 2.96875 -2.609375 2.921875 -2.90625 2.921875 -3.234375 C 2.921875 -3.578125 3.015625 -3.890625 3.21875 -4.171875 C 3.421875 -4.453125 3.75 -4.703125 4.203125 -4.90625 C 4.640625 -5.109375 5.234375 -5.28125 5.953125 -5.40625 C 6.671875 -5.53125 7.53125 -5.609375 8.546875 -5.65625 Z M 1.421875 -10.78125 L 1.828125 -10.078125 C 1.890625 -9.953125 1.984375 -9.84375 2.09375 -9.78125 C 2.1875 -9.703125 2.328125 -9.671875 2.484375 -9.671875 C 2.65625 -9.671875 2.84375 -9.734375 3.046875 -9.859375 C 3.25 -10 3.46875 -10.140625 3.734375 -10.328125 C 4.015625 -10.5 4.328125 -10.640625 4.703125 -10.78125 C 5.0625 -10.921875 5.53125 -10.984375 6.078125 -10.984375 C 6.875 -10.984375 7.5 -10.734375 7.921875 -10.234375 C 8.34375 -9.734375 8.546875 -9 8.546875 -8.03125 L 8.546875 -7.046875 C 7.109375 -7.015625 5.90625 -6.875 4.9375 -6.65625 C 3.9375 -6.4375 3.140625 -6.140625 2.546875 -5.78125 C 1.921875 -5.421875 1.484375 -5.015625 1.21875 -4.5625 C 0.9375 -4.09375 0.8125 -3.625 0.8125 -3.140625 C 0.8125 -2.5625 0.890625 -2.0625 1.078125 -1.640625 C 1.265625 -1.234375 1.515625 -0.890625 1.828125 -0.625 C 2.15625 -0.34375 2.53125 -0.140625 2.96875 0 C 3.375 0.140625 3.84375 0.203125 4.34375 0.203125 C 4.8125 0.203125 5.234375 0.15625 5.640625 0.078125 C 6.03125 -0.015625 6.40625 -0.140625 6.75 -0.296875 C 7.09375 -0.453125 7.421875 -0.65625 7.75 -0.890625 C 8.046875 -1.125 8.375 -1.40625 8.703125 -1.703125 L 8.953125 -0.515625 C 9.015625 -0.3125 9.109375 -0.171875 9.234375 -0.09375 C 9.34375 -0.03125 9.5 0 9.734375 0 L 10.703125 0 L 10.703125 -8.03125 C 10.703125 -8.71875 10.609375 -9.375 10.421875 -9.96875 C 10.21875 -10.546875 9.953125 -11.046875 9.578125 -11.46875 C 9.203125 -11.875 8.75 -12.1875 8.203125 -12.421875 C 7.65625 -12.65625 7.03125 -12.78125 6.328125 -12.78125 C 5.359375 -12.78125 4.453125 -12.59375 3.671875 -12.28125 C 2.859375 -11.9375 2.125 -11.453125 1.421875 -10.78125 Z M 1.421875 -10.78125 "/>
<pathstyle="stroke:none;"d="M 11.03125 0 L 11.03125 -8.03125 C 11.03125 -8.734375 10.921875 -9.375 10.75 -9.96875 C 10.5625 -10.546875 10.265625 -11.046875 9.90625 -11.46875 C 9.53125 -11.875 9.0625 -12.1875 8.53125 -12.421875 C 7.984375 -12.65625 7.359375 -12.78125 6.65625 -12.78125 C 5.671875 -12.78125 4.796875 -12.609375 3.984375 -12.28125 C 3.1875 -11.9375 2.4375 -11.453125 1.75 -10.78125 L 2.140625 -10.078125 C 2.203125 -9.96875 2.296875 -9.859375 2.40625 -9.78125 C 2.53125 -9.703125 2.65625 -9.671875 2.796875 -9.671875 C 2.984375 -9.671875 3.1875 -9.734375 3.375 -9.859375 C 3.5625 -10.015625 3.796875 -10.15625 4.0625 -10.328125 C 4.34375 -10.5 4.65625 -10.65625 5.03125 -10.78125 C 5.390625 -10.921875 5.84375 -10.984375 6.375 -10.984375 C 7.203125 -10.984375 7.8125 -10.75 8.234375 -10.234375 C 8.65625 -9.734375 8.859375 -9.015625 8.859375 -8.03125 L 8.859375 -7.046875 C 7.4375 -7.015625 6.234375 -6.890625 5.25 -6.671875 C 4.28125 -6.4375 3.46875 -6.140625 2.875 -5.78125 C 2.25 -5.421875 1.828125 -5.03125 1.546875 -4.5625 C 1.28125 -4.109375 1.140625 -3.625 1.140625 -3.140625 C 1.140625 -2.5625 1.234375 -2.0625 1.40625 -1.65625 C 1.609375 -1.234375 1.859375 -0.890625 2.171875 -0.625 C 2.484375 -0.34375 2.84375 -0.15625 3.265625 0 C 3.703125 0.125 4.15625 0.203125 4.640625 0.203125 C 5.125 0.203125 5.5625 0.15625 5.953125 0.078125 C 6.34375 -0.015625 6.71875 -0.125 7.0625 -0.296875 C 7.40625 -0.453125 7.75 -0.640625 8.046875 -0.890625 C 8.359375 -1.109375 8.6875 -1.390625 9.015625 -1.6875 L 9.265625 -0.515625 C 9.3125 -0.3125 9.390625 -0.15625 9.53125 -0.09375 C 9.671875 -0.03125 9.84375 0 10.046875 0 Z M 5.296875 -1.34375 C 5.015625 -1.34375 4.75 -1.390625 4.5 -1.46875 C 4.25 -1.53125 4.046875 -1.640625 3.859375 -1.78125 C 3.671875 -1.953125 3.53125 -2.140625 3.421875 -2.375 C 3.3125 -2.609375 3.265625 -2.90625 3.265625 -3.234375 C 3.265625 -3.578125 3.359375 -3.890625 3.5625 -4.171875 C 3.765625 -4.453125 4.09375 -4.703125 4.53125 -4.90625 C 4.984375 -5.125 5.5625 -5.28125 6.265625 -5.40625 C 6.96875 -5.53125 7.84375 -5.609375 8.859375 -5.65625 L 8.859375 -3.03125 C 8.609375 -2.78125 8.34375 -2.546875 8.109375 -2.328125 C 7.828125 -2.125 7.5625 -1.953125 7.28125 -1.8125 C 6.984375 -1.65625 6.6875 -1.546875 6.375 -1.46875 C 6.046875 -1.390625 5.6875 -1.34375 5.296875 -1.34375 Z M 5.296875 -1.34375 "/>
</symbol>
<symboloverflow="visible"id="glyph0-5">
<pathstyle="stroke:none;"d="M 3.84375 -10.03125 L 3.6875 -11.9375 C 3.65625 -12.171875 3.59375 -12.3125 3.5 -12.421875 C 3.40625 -12.5 3.25 -12.546875 3.015625 -12.546875 L 1.75 -12.546875 L 1.75 0 L 3.96875 0 L 3.96875 -7.9375 C 4.109375 -8.34375 4.28125 -8.734375 4.484375 -9.0625 C 4.6875 -9.40625 4.890625 -9.6875 5.140625 -9.90625 C 5.390625 -10.140625 5.65625 -10.3125 5.96875 -10.4375 C 6.28125 -10.546875 6.640625 -10.609375 7.03125 -10.609375 C 7.3125 -10.609375 7.578125 -10.578125 7.796875 -10.53125 C 8.015625 -10.484375 8.171875 -10.453125 8.296875 -10.453125 C 8.5 -10.453125 8.625 -10.5625 8.671875 -10.765625 L 8.828125 -12.421875 C 8.640625 -12.546875 8.421875 -12.625 8.171875 -12.6875 C 7.9375 -12.734375 7.6875 -12.78125 7.421875 -12.78125 C 6.578125 -12.78125 5.875 -12.53125 5.296875 -12.046875 C 4.71875 -11.5625 4.234375 -10.890625 3.84375 -10.03125 Z M 3.84375 -10.03125 "/>
<pathstyle="stroke:none;"d="M 1.8125 0 L 4.015625 0 L 4.015625 -7.984375 C 4.359375 -8.84375 4.796875 -9.484375 5.296875 -9.9375 C 5.828125 -10.390625 6.46875 -10.609375 7.234375 -10.609375 C 7.671875 -10.609375 8 -10.5625 8.234375 -10.484375 C 8.46875 -10.40625 8.65625 -10.375 8.765625 -10.375 C 8.96875 -10.375 9.09375 -10.46875 9.15625 -10.6875 L 9.4375 -12.328125 C 9.203125 -12.46875 8.953125 -12.578125 8.65625 -12.65625 C 8.375 -12.734375 8.0625 -12.78125 7.71875 -12.78125 C 6.859375 -12.78125 6.125 -12.53125 5.5 -12.046875 C 4.859375 -11.546875 4.34375 -10.859375 3.90625 -9.984375 L 3.75 -11.9375 C 3.71875 -12.171875 3.65625 -12.328125 3.5625 -12.421875 C 3.484375 -12.5 3.3125 -12.546875 3.078125 -12.546875 L 1.8125 -12.546875 Z M 1.8125 0 "/>
</symbol>
<symboloverflow="visible"id="glyph0-6">
<pathstyle="stroke:none;"d="M 10.140625 -7.640625 L 3.28125 -7.640625 C 3.4375 -8.734375 3.796875 -9.578125 4.421875 -10.203125 C 5.046875 -10.8125 5.875 -11.125 6.9375 -11.125 C 7.4375 -11.125 7.890625 -11.046875 8.296875 -10.859375 C 8.6875 -10.6875 9.015625 -10.453125 9.296875 -10.140625 C 9.5625 -9.84375 9.78125 -9.46875 9.921875 -9.046875 C 10.078125 -8.625 10.140625 -8.15625 10.140625 -7.640625 Z M 11.9375 -1.765625 L 11.3125 -2.5625 C 11.21875 -2.703125 11.0625 -2.78125 10.890625 -2.78125 C 10.75 -2.78125 10.578125 -2.703125 10.390625 -2.578125 C 10.1875 -2.453125 9.953125 -2.3125 9.671875 -2.171875 C 9.375 -2.015625 9.015625 -1.875 8.625 -1.75 C 8.234375 -1.625 7.75 -1.5625 7.203125 -1.5625 C 6.609375 -1.5625 6.0625 -1.640625 5.59375 -1.84375 C 5.109375 -2.046875 4.703125 -2.328125 4.34375 -2.71875 C 4 -3.125 3.734375 -3.609375 3.53125 -4.203125 C 3.328125 -4.78125 3.234375 -5.484375 3.203125 -6.265625 L 11.59375 -6.265625 C 11.796875 -6.265625 11.9375 -6.3125 12.015625 -6.4375 C 12.09375 -6.546875 12.125 -6.796875 12.125 -7.140625 C 12.125 -8.03125 12 -8.828125 11.734375 -9.515625 C 11.46875 -10.203125 11.109375 -10.796875 10.625 -11.28125 C 10.15625 -11.75 9.609375 -12.125 8.96875 -12.359375 C 8.328125 -12.609375 7.625 -12.75 6.890625 -12.75 C 5.96875 -12.75 5.15625 -12.59375 4.4375 -12.265625 C 3.703125 -11.9375 3.078125 -11.515625 2.59375 -10.953125 C 2.078125 -10.390625 1.703125 -9.734375 1.421875 -8.984375 C 1.15625 -8.21875 1.03125 -7.390625 1.03125 -6.53125 C 1.03125 -5.4375 1.171875 -4.484375 1.46875 -3.65625 C 1.765625 -2.8125 2.1875 -2.125 2.71875 -1.546875 C 3.25 -0.984375 3.875 -0.5625 4.609375 -0.265625 C 5.34375 0.03125 6.140625 0.171875 7.015625 0.171875 C 7.453125 0.171875 7.921875 0.140625 8.390625 0.0625 C 8.84375 -0.015625 9.296875 -0.140625 9.734375 -0.296875 C 10.15625 -0.453125 10.5625 -0.640625 10.953125 -0.890625 C 11.328125 -1.140625 11.65625 -1.421875 11.9375 -1.765625 Z M 11.9375 -1.765625 "/>
<pathstyle="stroke:none;"d="M 6.78125 -12.75 C 5.875 -12.75 5.0625 -12.59375 4.328125 -12.265625 C 3.59375 -11.953125 2.984375 -11.515625 2.484375 -10.953125 C 1.96875 -10.40625 1.59375 -9.734375 1.3125 -8.984375 C 1.046875 -8.234375 0.921875 -7.40625 0.921875 -6.53125 C 0.921875 -5.453125 1.0625 -4.484375 1.359375 -3.65625 C 1.65625 -2.828125 2.078125 -2.125 2.609375 -1.5625 C 3.140625 -0.984375 3.765625 -0.5625 4.515625 -0.265625 C 5.234375 0.03125 6.03125 0.171875 6.90625 0.171875 C 7.359375 0.171875 7.8125 0.140625 8.28125 0.046875 C 8.734375 -0.03125 9.1875 -0.140625 9.609375 -0.296875 C 10.0625 -0.453125 10.453125 -0.65625 10.84375 -0.890625 C 11.21875 -1.140625 11.546875 -1.421875 11.828125 -1.765625 L 11.203125 -2.5625 C 11.109375 -2.703125 10.96875 -2.78125 10.78125 -2.78125 C 10.640625 -2.78125 10.46875 -2.71875 10.28125 -2.578125 C 10.09375 -2.453125 9.84375 -2.3125 9.546875 -2.171875 C 9.265625 -2.015625 8.921875 -1.890625 8.53125 -1.765625 C 8.109375 -1.625 7.640625 -1.5625 7.09375 -1.5625 C 6.5 -1.5625 5.953125 -1.65625 5.484375 -1.859375 C 5 -2.046875 4.578125 -2.34375 4.234375 -2.71875 C 3.890625 -3.125 3.625 -3.625 3.421875 -4.203125 C 3.21875 -4.78125 3.109375 -5.484375 3.09375 -6.265625 L 11.453125 -6.265625 C 11.65625 -6.265625 11.796875 -6.328125 11.875 -6.4375 C 11.9375 -6.546875 11.984375 -6.796875 11.984375 -7.140625 C 11.984375 -8.03125 11.84375 -8.828125 11.59375 -9.515625 C 11.328125 -10.21875 10.96875 -10.796875 10.5 -11.28125 C 10.046875 -11.765625 9.484375 -12.125 8.859375 -12.359375 C 8.234375 -12.625 7.53125 -12.75 6.78125 -12.75 Z M 6.828125 -11.125 C 7.328125 -11.125 7.78125 -11.046875 8.171875 -10.875 C 8.5625 -10.703125 8.890625 -10.453125 9.171875 -10.15625 C 9.4375 -9.84375 9.65625 -9.484375 9.78125 -9.046875 C 9.921875 -8.625 10 -8.15625 10 -7.640625 L 3.171875 -7.640625 C 3.328125 -8.734375 3.703125 -9.59375 4.3125 -10.203125 C 4.921875 -10.8125 5.765625 -11.125 6.828125 -11.125 Z M 6.828125 -11.125 "/>
</symbol>
</g>
<clipPathid="clip1">
<pathd="M 0 6 L 21 6 L 21 34.183594 L 0 34.183594 Z M 0 6 "/>
<pathd="M 0 6 L 22 6 L 22 34.183594 L 0 34.183594 Z M 0 6 "/>
* Adjemian, Stéphane, Matthieu Darracq Parriès and Stéphane Moyen (2008): “Towards a monetary policy evaluation framework”, *European Central Bank Working Paper*, 942.
* Aguiar, Mark and Gopinath, Gita (2004): “Emerging Market Business Cycles: The Cycle is the Trend,” *NBER* Working Paper, 10734.
* Amisano, Gianni and Tristani, Oreste (2010): “Euro area inflation persistence in an estimated nonlinear DSGE model”, *Journal of Economic Dynamics and Control*, 34(10), 1837–1858.
* Andreasen, Martin M., Jesús Fernández-Villaverde, and Juan Rubio-Ramírez (2018): “The Pruned State-Space System for Non-Linear DSGE Models: Theory and Empirical Applications,” *Review of Economic Studies*, 85(1), pp. 1-49.
* Andreasen, Martin M., Jesús Fernández-Villaverde, and Juan Rubio-Ramírez (2018): “The Pruned State-Space System for Non-Linear DSGE Models: Theory and Empirical Applications,” *Review of Economic Studies*, 85(1), 1-49.
* Andrle, Michal and Miroslav Plašil (2018): “Econometrics with system priors,” *Economics Letters*, 172, 134-137.
* Andrews, Donald W.K (1991): “Heteroskedasticity and autocorrelation consistent covariance matrix estimation”, *Econometrica*, 59(3), 817–858.
* Backus, David K., Patrick J. Kehoe, and Finn E. Kydland (1992): “International Real Business Cycles,” *Journal of Political Economy*, 100(4), 745–775.
* Baxter, Marianne and Robert G. King (1999): “Measuring Business Cycles: Approximate Band-pass Filters for Economic Time Series,” *Review of Economics and Statistics*, 81(4), 575–593.
* Bini, Dario A., Guy Latouche, and Beatrice Meini (2002): “Solving matrix polynomial equations arising in queueing problems,” *Linear Algebra and its Applications*, 340, 225–244.
* Born, Benjamin and Johannes Pfeifer (2014): “Policy risk and the business cycle”, *Journal of Monetary Economics*, 68, 68-85.
* Boucekkine, Raouf (1995): “An alternative methodology for solving nonlinear forward-looking models,” *Journal of Economic Dynamics and Control*, 19, 711–734.
* Brayton, Flint and Peter Tinsley (1996): “A Guide to FRB/US: A Macroeconomic Model of the United States,” *Finance and Economics Discussion Series*, 1996-42.
* Brayton, Flint, Morris Davis and Peter Tulip (2000): “Polynomial Adjustment Costs in FRB/US,” *Unpublished manuscript*.
* Brooks, Stephen P., and Andrew Gelman (1998): “General methods for monitoring convergence of iterative simulations,” *Journal of Computational and Graphical Statistics*, 7, pp. 434–455.
* Cardoso, Margarida F., R. L. Salcedo and S. Feyo de Azevedo (1996): “The simplex simulated annealing approach to continuous non-linear optimization,” *Computers & Chemical Engineering*, 20(9), 1065-1080.
* Chib, Siddhartha and Srikanth Ramamurthy (2010): “Tailored randomized block MCMC methods with application to DSGE models,” *Journal of Econometrics*, 155, 19–38.
* Christiano, Lawrence J., Martin Eichenbaum and Charles L. Evans (2005): “Nominal Rigidities and the Dynamic Effects of a Shock to Monetary Policy,” *Journal of Political Economy*, 113(1), 1–45.
* Christiano, Lawrence J., Mathias Trabandt, and Karl Walentin (2010): “DSGE Models for Monetary Policy Analysis,” In: *Handbook of Monetary Economics 3*, 285–367.
* 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.
* Christoffel, Kai, Günter Coenen and Anders Warne (2010): “Forecasting with DSGE models,” *ECB Working Paper Series*, 1185.
* Collard, Fabrice (2001): “Stochastic simulations with Dynare: A practical guide”.
* Collard, Fabrice and Michel Juillard (2001a): “Accuracy of stochastic perturbation methods: The case of asset pricing models,” *Journal of Economic Dynamics and Control*, 25, 979–999.
* Collard, Fabrice and Michel Juillard (2001b): “A Higher-Order Taylor Expansion Approach to Simulation of Stochastic Forward-Looking Models with an Application to a Non-Linear Phillips Curve,” *Computational Economics*, 17, 125–139.
* Corona, Angelo, M. Marchesi, Claudio Martini, and Sandro Ridella (1987): “Minimizing multimodal functions of continuous variables with the “simulated annealing” algorithm”, *ACM Transactions on Mathematical Software*, 13(3), 262–280.
* Del Negro, Marco and Franck Schorfheide (2004): “Priors from General Equilibrium Models for VARs”, *International Economic Review*, 45(2), 643–673.
* Corana, Angelo, M. Marchesi, Claudio Martini, and Sandro Ridella (1987): “Minimizing multimodal functions of continuous variables with the “simulated annealing” algorithm”, *ACM Transactions on Mathematical Software*, 13(3), 262–280.
* Cuba-Borda, Pablo, Luca Guerrieri, Matteo Iacoviello, and Molin Zhong (2019): “Likelihood evaluation of models with occasionally binding constraints,” Journal of Applied Econometrics, 34(7), 1073-1085
* Del Negro, Marco and Frank Schorfheide (2004): “Priors from General Equilibrium Models for VARs”, *International Economic Review*, 45(2), 643–673.
* Dennis, Richard (2007): “Optimal Policy In Rational Expectations Models: New Solution Algorithms”, *Macroeconomic Dynamics*, 11(1), 31–55.
* Duffie, Darrel and Kenneth J. Singleton (1993): “Simulated Moments Estimation of Markov Models of Asset Prices”, *Econometrica*, 61(4), 929-952.
* Durbin, J. and S. J. Koopman (2012), *Time Series Analysis by State Space Methods*, Second Revised Edition, Oxford University Press.
* Fair, Ray and John Taylor (1983): “Solution and Maximum Likelihood Estimation of Dynamic Nonlinear Rational Expectation Models,” *Econometrica*, 51, 1169–1185.
* Fernández-Villaverde, Jesús (2010): “The econometrics of DSGE models,” *SERIEs*, 1, 3–49.
* Fernández-Villaverde, Jesús and Juan Rubio-Ramírez (2004): “Comparing Dynamic Equilibrium Economies to Data: A Bayesian Approach,” *Journal of Econometrics*, 123, 153–187.
* 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 (2010): “The econometrics of DSGE models,” *SERIEs*, 1, 3–49.
* Ferris, Michael C. and Todd S. Munson (1999): “Interfaces to PATH 3.0: Design, Implementation and Usage”, *Computational Optimization and Applications*, 12(1), 207–227.
* Galí, Jordi (2015): “Monetary Policy, Inflation, and the Business Cycle,” 2nd Edition, Princeton University Press, Princeton.
* 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 Press.
* Geweke, John (1999): “Using simulation methods for Bayesian econometric models: Inference, development and communication,” *Econometric Reviews*, 18(1), 1–73.
* Giovannini, Massimo, Philipp Pfeiffer, and Marco Ratto (2021), “Efficient and robust inference of models with occasionally binding constraints,” Working Papers 2021-03, Joint Research Centre, European Commission
* Giordani, Paolo, Michael Pitt, and Robert Kohn (2011): “Bayesian Inference for Time Series State Space Models” in: *The Oxford Handbook of Bayesian Econometrics*, ed. by John Geweke, Gary Koop, and Herman van Dijk, Oxford University Press, 61–124.
* Guerrieri, Luca and Matteo Iacoviello (2015): “OccBin: A toolkit for solving dynamic models with occasionally binding constraints easily,” *Journal of Monetary Economics*, 70, 22–38.
* Goffe, William L., Gary D. Ferrier, and John Rogers (1994): “Global Optimization of Statistical Functions with Simulated Annealing,” *Journal of Econometrics*, 60(1/2), 65–100.
* Hansen, Lars P. (1982): “Large sample properties of generalized method of moments estimators,” Econometrica, 50(4), 1029–1054.
* Hansen, Nikolaus and Stefan Kern (2004): “Evaluating the CMA Evolution Strategy on Multimodal Test Functions”. In: *Eighth International Conference on Parallel Problem Solving from Nature PPSN VIII*, Proceedings, Berlin: Springer, 282–291.
* Harvey, Andrew C. and Garry D.A. Phillips (1979): “Maximum likelihood estimation of regression models with autoregressive-moving average disturbances,” *Biometrika*, 66(1), 49–58.
* Herbst, Edward and Schorfheide, Frank (2014): “Sequential Monte Carlo Sampling for DSGE Models,” *Journal of Applied Econometrics*, 29, 1073-1098.
* Herbst, Edward (2015): “Using the “Chandrasekhar Recursions” for Likelihood Evaluation of DSGE Models,” *Computational Economics*, 45(4), 693–705.
* Ireland, Peter (2004): “A Method for Taking Models to the Data,” *Journal of Economic Dynamics and Control*, 28, 1205–26.
* Iskrev, Nikolay (2010): “Local identification in DSGE models,” *Journal of Monetary Economics*, 57(2), 189–202.
* Judd, Kenneth (1996): “Approximation, Perturbation, and Projection Methods in Economic Analysis”, in *Handbook of Computational Economics*, ed. by Hans Amman, David Kendrick, and John Rust, North Holland Press, 511–585.
* Juillard, Michel (1996): “Dynare: A program for the resolution and simulation of dynamic models with forward variables through the use of a relaxation algorithm,” CEPREMAP, *Couverture Orange*, 9602.
* 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 and Sunghyun Kim (2003): “Spurious welfare reversals in international business cycle models,” *Journal of International Economics*, 60, 471–500.
* 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.
@ -51,25 +65,26 @@ Bibliography
* Kuntsevich, Alexei V. and Franz Kappel (1997): “SolvOpt - The solver for local nonlinear optimization problems (version 1.1, Matlab, C, FORTRAN)”, University of Graz, Graz, Austria.
* Laffargue, Jean-Pierre (1990): “Résolution d’un modèle macroéconomique avec anticipations rationnelles”, *Annales d’Économie et Statistique*, 17, 97–119.
* Liu, Jane and Mike West (2001): “Combined parameter and state estimation in simulation-based filtering”, in *Sequential Monte Carlo Methods in Practice*, Eds. Doucet, Freitas and Gordon, Springer Verlag.
* 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.
* Mutschler, Willi (2018): “Higher-order statistics for DSGE models”, *Econometrics and Statistics*, 6(C), 44-56.
* 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.
* Rabanal, Pau and Juan Rubio-Ramírez (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.
* Ruge-Murcia, Francisco J. (2012): “Estimating nonlinear DSGE models by the simulated method of moments: With an application to business cycles“, *Journal of Economic Dynamics and Control*, 36, 914-938.
* 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.
* Schorfheide, Frank (2000): “Loss Function-based evaluation of DSGE models,” *Journal of Applied Econometrics*, 15(6), 645–670.
* 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.
* Skoeld, Martin and Gareth O. Roberts (2003): “Density Estimation for the Metropolis-Hastings Algorithm,” *Scandinavian Journal of Statistics*, 30, 699–718.
* Smets, Frank and Rafael Wouters (2003): “An Estimated Dynamic Stochastic General Equilibrium Model of the Euro Area,” *Journal of the European Economic Association*, 1(5), 1123–1175.
* 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.
* U.S. Census Bureau (2017): “X-13 ARIMA-SEATSReference Manual”.
* U.S. Census Bureau (2020): “X-13 ARIMA-SEATS Reference Manual, Version 1.1”, Center for Statistical Research and Methodology, U.S. Census Bureau, https://www.census.gov/data/software/x13as.html
* Villemot, Sébastien (2011): “Solving rational expectations models at first order: what Dynare does,” *Dynare Working Papers*, 2, CEPREMAP.
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.