New upstream version 4.6.1
Sébastien Villemot
4 years ago
35 | 35 | mkdir -p $(abs_srcdir)/matlab/preprocessor$$ARCH && \ |
36 | 36 | $(LN_S) -f $(abs_builddir)/preprocessor/src/dynare_m$(EXEEXT) $(abs_srcdir)/matlab/preprocessor$$ARCH |
37 | 37 | |
38 | clean-local: | |
39 | rm -rf $(abs_srcdir)/matlab/preprocessor32 $(abs_srcdir)/matlab/preprocessor64 | |
40 | ||
38 | 41 | dist-hook: |
39 | 42 | rm -rf `find $(distdir)/matlab $(distdir)/examples -name *~` |
40 | 43 | rm -rf $(distdir)/matlab/preprocessor* $(distdir)/matlab/dynare_version.m |
746 | 746 | @echo "it deletes files that may require special tools to rebuild." |
747 | 747 | clean: clean-recursive |
748 | 748 | |
749 | clean-am: clean-generic mostlyclean-am | |
749 | clean-am: clean-generic clean-local mostlyclean-am | |
750 | 750 | |
751 | 751 | distclean: distclean-recursive |
752 | 752 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) |
817 | 817 | |
818 | 818 | .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ |
819 | 819 | am--refresh check check-am clean clean-cscope clean-generic \ |
820 | cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ | |
821 | dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ | |
822 | dist-zip distcheck distclean distclean-generic distclean-tags \ | |
823 | distcleancheck distdir distuninstallcheck dvi dvi-am html \ | |
824 | html-am info info-am install install-am install-data \ | |
825 | install-data-am install-dvi install-dvi-am install-exec \ | |
826 | install-exec-am install-exec-local install-html \ | |
820 | clean-local cscope cscopelist-am ctags ctags-am dist dist-all \ | |
821 | dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar dist-tarZ \ | |
822 | dist-xz dist-zip distcheck distclean distclean-generic \ | |
823 | distclean-tags distcleancheck distdir distuninstallcheck dvi \ | |
824 | dvi-am html html-am info info-am install install-am \ | |
825 | install-data install-data-am install-dvi install-dvi-am \ | |
826 | install-exec install-exec-am install-exec-local install-html \ | |
827 | 827 | install-html-am install-info install-info-am install-man \ |
828 | 828 | install-pdf install-pdf-am install-ps install-ps-am \ |
829 | 829 | install-strip installcheck installcheck-am installdirs \ |
842 | 842 | fi; \ |
843 | 843 | mkdir -p $(abs_srcdir)/matlab/preprocessor$$ARCH && \ |
844 | 844 | $(LN_S) -f $(abs_builddir)/preprocessor/src/dynare_m$(EXEEXT) $(abs_srcdir)/matlab/preprocessor$$ARCH |
845 | ||
846 | clean-local: | |
847 | rm -rf $(abs_srcdir)/matlab/preprocessor32 $(abs_srcdir)/matlab/preprocessor64 | |
845 | 848 | |
846 | 849 | dist-hook: |
847 | 850 | rm -rf `find $(distdir)/matlab $(distdir)/examples -name *~` |
0 | Announcement for Dynare 4.6.0 (in February 2020) | |
1 | ================================================ | |
0 | Announcement for Dynare 4.6.1 (on 2020-03-13) | |
1 | ============================================= | |
2 | ||
3 | We are pleased to announce the release of Dynare 4.6.1. | |
4 | ||
5 | This maintenance release fixes various bugs. | |
6 | ||
7 | The Windows, macOS and source packages are already available for download at | |
8 | [the Dynare website](https://www.dynare.org/download/). | |
9 | ||
10 | All users are strongly encouraged to upgrade. | |
11 | ||
12 | This release is compatible with MATLAB versions ranging from 7.9 (R2009b) to | |
13 | 9.7 (R2019b), and with GNU Octave versions 5.2.0 (under Windows) and 4.4.1 | |
14 | (under macOS). | |
15 | ||
16 | Here is a list of the problems identified in version 4.6.0 and that have been | |
17 | fixed in version 4.6.1: | |
18 | ||
19 | * Installation on macOS would fail if the GCC compiler was supposed to be | |
20 | installed and `www.google.com` was not reachable or blocked | |
21 | * Dynare++ was missing the `dynare_simul.m` file | |
22 | * The parameter vector `M_.params` would not be correctly updated after calls | |
23 | to `stoch_simul` and `discretionary_policy` if parameters had been modified | |
24 | in a steady state file | |
25 | * The `stoch_simul` command with both the `nograph` and `TeX` options would | |
26 | crash | |
27 | * The `stoch_simul` command with the `noprint` option would crash | |
28 | * The `prior moments` command would crash if the used parameter vector | |
29 | triggered an error code | |
30 | * In case of problem, the `discretionary_policy` command would crash instead of | |
31 | aborting with a proper error code | |
32 | * Computing of prior/posterior statistics would not work in parallel | |
33 | * Closing of parallel estimation on GNU/Linux could crash | |
34 | * The `histval` command would not work in combination with the | |
35 | `predetermined_variables` command | |
36 | * Ramsey optimal policy with multiple instruments would crash if a steady state | |
37 | file returned complex values, instead of providing an error message | |
38 | * The `model_diagnostics` command would not correctly update the parameter | |
39 | vector if the latter was set in a steady state file | |
40 | * The `model_diagnostics` command would ignore the `nocheck` steady state flag | |
41 | ||
42 | ||
43 | Announcement for Dynare 4.6.0 (on 2020-02-20) | |
44 | ============================================= | |
2 | 45 | |
3 | 46 | We are pleased to announce the release of Dynare 4.6.0. |
4 | 47 | |
161 | 204 | |
162 | 205 | - `@#for` loops can iterate over several variables at the same time (*e.g.* |
163 | 206 | `@#for (i,j) in X`, where `X` is an array containing tuples of size 2). |
207 | ||
208 | - Added the possibility to exclude some elements when iterating over `@#for` | |
209 | loops (*e.g.* `@#for i in 1:5 when mod(i,2) == 0` iterates over all even | |
210 | numbers between 1 and 5). | |
164 | 211 | |
165 | 212 | - A `defined()` function allows testing whether macro variables have been |
166 | 213 | defined. |
283 | 283 | ``` |
284 | 284 | where the path and version of MATLAB are specified. Note that you should use |
285 | 285 | the MSYS2 notation and not put spaces in the MATLAB path, so you probably want |
286 | to use something like `/c/Progra~1/MATLAB/…`. | |
286 | to use something like `/c/Progra~1/MATLAB/…`. Alternatively, if your filesystem | |
287 | does not have short filenames (8dot3), then you can run `mkdir -p | |
288 | /usr/local/MATLAB && mount c:/Program\ Files/MATLAB /usr/local/MATLAB`, and | |
289 | then pass `/usr/local/MATLAB/…` as MATLAB path to the configure script. | |
287 | 290 | - Compile: |
288 | 291 | ``` |
289 | 292 | make |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for dynare 4.6.0. | |
2 | # Generated by GNU Autoconf 2.69 for dynare 4.6.1. | |
3 | 3 | # |
4 | 4 | # |
5 | 5 | # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. |
576 | 576 | # Identity of this package. |
577 | 577 | PACKAGE_NAME='dynare' |
578 | 578 | PACKAGE_TARNAME='dynare' |
579 | PACKAGE_VERSION='4.6.0' | |
580 | PACKAGE_STRING='dynare 4.6.0' | |
579 | PACKAGE_VERSION='4.6.1' | |
580 | PACKAGE_STRING='dynare 4.6.1' | |
581 | 581 | PACKAGE_BUGREPORT='' |
582 | 582 | PACKAGE_URL='' |
583 | 583 | |
1347 | 1347 | # Omit some internal or obsolete options to make the list less imposing. |
1348 | 1348 | # This message is too long to be a string in the A/UX 3.1 sh. |
1349 | 1349 | cat <<_ACEOF |
1350 | \`configure' configures dynare 4.6.0 to adapt to many kinds of systems. | |
1350 | \`configure' configures dynare 4.6.1 to adapt to many kinds of systems. | |
1351 | 1351 | |
1352 | 1352 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1353 | 1353 | |
1418 | 1418 | |
1419 | 1419 | if test -n "$ac_init_help"; then |
1420 | 1420 | case $ac_init_help in |
1421 | short | recursive ) echo "Configuration of dynare 4.6.0:";; | |
1421 | short | recursive ) echo "Configuration of dynare 4.6.1:";; | |
1422 | 1422 | esac |
1423 | 1423 | cat <<\_ACEOF |
1424 | 1424 | |
1529 | 1529 | test -n "$ac_init_help" && exit $ac_status |
1530 | 1530 | if $ac_init_version; then |
1531 | 1531 | cat <<\_ACEOF |
1532 | dynare configure 4.6.0 | |
1532 | dynare configure 4.6.1 | |
1533 | 1533 | generated by GNU Autoconf 2.69 |
1534 | 1534 | |
1535 | 1535 | Copyright (C) 2012 Free Software Foundation, Inc. |
2024 | 2024 | This file contains any messages produced by compilers while |
2025 | 2025 | running configure, to aid debugging if configure makes a mistake. |
2026 | 2026 | |
2027 | It was created by dynare $as_me 4.6.0, which was | |
2027 | It was created by dynare $as_me 4.6.1, which was | |
2028 | 2028 | generated by GNU Autoconf 2.69. Invocation command line was |
2029 | 2029 | |
2030 | 2030 | $ $0 $@ |
2888 | 2888 | |
2889 | 2889 | # Define the identity of the package. |
2890 | 2890 | PACKAGE='dynare' |
2891 | VERSION='4.6.0' | |
2891 | VERSION='4.6.1' | |
2892 | 2892 | |
2893 | 2893 | |
2894 | 2894 | cat >>confdefs.h <<_ACEOF |
11153 | 11153 | # report actual input values of CONFIG_FILES etc. instead of their |
11154 | 11154 | # values after options handling. |
11155 | 11155 | ac_log=" |
11156 | This file was extended by dynare $as_me 4.6.0, which was | |
11156 | This file was extended by dynare $as_me 4.6.1, which was | |
11157 | 11157 | generated by GNU Autoconf 2.69. Invocation command line was |
11158 | 11158 | |
11159 | 11159 | CONFIG_FILES = $CONFIG_FILES |
11210 | 11210 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
11211 | 11211 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
11212 | 11212 | ac_cs_version="\\ |
11213 | dynare config.status 4.6.0 | |
11213 | dynare config.status 4.6.1 | |
11214 | 11214 | configured by $0, generated by GNU Autoconf 2.69, |
11215 | 11215 | with options \\"\$ac_cs_config\\" |
11216 | 11216 |
17 | 17 | dnl along with Dynare. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | |
19 | 19 | AC_PREREQ([2.62]) |
20 | AC_INIT([dynare], [4.6.0]) | |
20 | AC_INIT([dynare], [4.6.1]) | |
21 | 21 | AC_CONFIG_SRCDIR([preprocessor/src/DynareMain.cc]) |
22 | 22 | AM_INIT_AUTOMAKE([1.11 -Wall -Wno-portability foreign no-dist-gzip dist-xz tar-pax]) |
23 | 23 |
467 | 467 | |
468 | 468 | clean-local: |
469 | 469 | rm -rf build |
470 | rm -rf utils/__pycache__ | |
470 | 471 | |
471 | 472 | # Tell versions [3.59,3.63) of GNU make to not export all variables. |
472 | 473 | # Otherwise a system limit (for SysV at least) may be exceeded. |
30 | 30 | |
31 | 31 | html_static_path = ['_static'] |
32 | 32 | |
33 | mathjax_path = 'mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML' | |
34 | 33 | |
35 | 34 | master_doc = 'index' |
36 | 35 |
103 | 103 | Octave, it also means that the ``.mod`` file cannot be named |
104 | 104 | ``test.mod`` or ``example.mod``. |
105 | 105 | |
106 | .. _quote-note: | |
107 | ||
108 | .. note:: | |
109 | Note on Quotes | |
110 | ||
111 | When passing command line options that contains a space (or, under | |
112 | Octave, a double quote), you must surround the entire option (keyword | |
113 | and argument) with single quotes, as in the following example. | |
114 | ||
115 | *Example* | |
116 | ||
117 | Call Dynare with options containing spaces | |
118 | ||
119 | .. code-block:: matlab | |
120 | ||
121 | >> dynare <<modfile.mod>> '-DA=[ i in [1,2,3] when i > 1 ]' 'conffile=C:\User\My Documents\config.txt' | |
122 | ||
106 | 123 | *Options* |
107 | 124 | |
108 | 125 | .. option:: noclearall |
139 | 156 | |
140 | 157 | .. option:: savemacro[=FILENAME] |
141 | 158 | |
142 | Instructs ``dynare`` to save the intermediary file which is | |
143 | obtained after macro processing (see :ref:`macro-proc-lang`); | |
144 | the saved output will go in the file specified, or if no file | |
145 | is specified in ``FILENAME-macroexp.mod`` | |
159 | Instructs ``dynare`` to save the intermediary file which is obtained | |
160 | after macro processing (see :ref:`macro-proc-lang`); the saved output | |
161 | will go in the file specified, or if no file is specified in | |
162 | ``FILENAME-macroexp.mod``. See the :ref:`note on quotes<quote-note>` | |
163 | for info on passing a ``FILENAME`` argument containing spaces. | |
146 | 164 | |
147 | 165 | .. option:: onlymacro |
148 | 166 | |
297 | 315 | |
298 | 316 | .. option:: matlabroot=<<path>> |
299 | 317 | |
300 | The path to the MATLAB installation for use with | |
301 | :opt:`use_dll`. Dynare is able to set this automatically, | |
302 | so you should not need to set it yourself. | |
318 | The path to the MATLAB installation for use with :opt:`use_dll`. Dynare | |
319 | is able to set this automatically, so you should not need to set it | |
320 | yourself. See the :ref:`note on quotes<quote-note>` for info on | |
321 | passing a ``<<path>>`` argument containing spaces. | |
303 | 322 | |
304 | 323 | .. option:: parallel[=CLUSTER_NAME] |
305 | 324 | |
312 | 331 | |
313 | 332 | .. option:: conffile=FILENAME |
314 | 333 | |
315 | Specifies the location of the configuration file if it differs | |
316 | from the default. See :ref:`conf-file`, for more information | |
317 | about the configuration file and its default location. | |
334 | Specifies the location of the configuration file if it differs from the | |
335 | default. See :ref:`conf-file`, for more information about the | |
336 | configuration file and its default location. See the :ref:`note on | |
337 | quotes<quote-note>` for info on passing a ``FILENAME`` argument | |
338 | containing spaces. | |
318 | 339 | |
319 | 340 | .. option:: parallel_slave_open_mode |
320 | 341 | |
332 | 353 | |
333 | 354 | Defines a macro-variable from the command line (the same effect as |
334 | 355 | using the Macro directive ``@#define`` in a model file, see |
335 | :ref:`macro-proc-lang`). Note that when passing a MACRO_EXPRESSION that | |
336 | contains a space (or, under Octave, a double quote), you must surround | |
337 | the entire ``-D`` flag with single quotes, as in the following example. | |
338 | Also note that an expression passed on the command line can reference | |
339 | variables defined before it. | |
356 | :ref:`macro-proc-lang`). See the :ref:`note on quotes<quote-note>` for | |
357 | info on passing a ``MACRO_EXPRESSION`` argument containing spaces. Note | |
358 | that an expression passed on the command line can reference variables | |
359 | defined before it. | |
340 | 360 | |
341 | 361 | *Example* |
342 | 362 | |
348 | 368 | |
349 | 369 | .. option:: -I<<path>> |
350 | 370 | |
351 | Defines a path to search for files to be included by the | |
352 | macro processor (using the ``@#include`` command). Multiple | |
353 | ``-I`` flags can be passed on the command line. The paths will | |
354 | be searched in the order that the ``-I`` flags are passed and | |
355 | the first matching file will be used. The flags passed here | |
356 | take priority over those passed to ``@#includepath``. | |
371 | Defines a path to search for files to be included by the macro | |
372 | processor (using the ``@#include`` command). Multiple ``-I`` flags can | |
373 | be passed on the command line. The paths will be searched in the order | |
374 | that the ``-I`` flags are passed and the first matching file will be | |
375 | used. The flags passed here take priority over those passed to | |
376 | ``@#includepath``. See the :ref:`note on quotes<quote-note>` for info | |
377 | on passing a ``<<path>>`` argument containing spaces. | |
357 | 378 | |
358 | 379 | .. option:: nostrict |
359 | 380 |
0 | 0 | SUBDIRS = utils/cc sylv parser/cc tl doc integ kord src tests |
1 | ||
2 | EXTRA_DIST = dynare_simul | |
3 | ||
4 | install-exec-local: | |
5 | $(MKDIR_P) $(DESTDIR)$(pkglibdir)/dynare++ | |
6 | cp -r dynare_simul/* $(DESTDIR)$(pkglibdir)/dynare++ | |
7 | ||
8 | uninstall-local: | |
9 | rm -rf $(DESTDIR)$(pkglibdir)/dynare++ | |
10 |
323 | 323 | top_builddir = @top_builddir@ |
324 | 324 | top_srcdir = @top_srcdir@ |
325 | 325 | SUBDIRS = utils/cc sylv parser/cc tl doc integ kord src tests |
326 | EXTRA_DIST = dynare_simul | |
326 | 327 | all: all-recursive |
327 | 328 | |
328 | 329 | .SUFFIXES: |
574 | 575 | |
575 | 576 | install-dvi-am: |
576 | 577 | |
577 | install-exec-am: | |
578 | install-exec-am: install-exec-local | |
578 | 579 | |
579 | 580 | install-html: install-html-recursive |
580 | 581 | |
612 | 613 | |
613 | 614 | ps-am: |
614 | 615 | |
615 | uninstall-am: | |
616 | uninstall-am: uninstall-local | |
616 | 617 | |
617 | 618 | .MAKE: $(am__recursive_targets) install-am install-strip |
618 | 619 | |
621 | 622 | distclean distclean-generic distclean-tags distdir dvi dvi-am \ |
622 | 623 | html html-am info info-am install install-am install-data \ |
623 | 624 | install-data-am install-dvi install-dvi-am install-exec \ |
624 | install-exec-am install-html install-html-am install-info \ | |
625 | install-info-am install-man install-pdf install-pdf-am \ | |
626 | install-ps install-ps-am install-strip installcheck \ | |
627 | installcheck-am installdirs installdirs-am maintainer-clean \ | |
628 | maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ | |
629 | pdf-am ps ps-am tags tags-am uninstall uninstall-am | |
625 | install-exec-am install-exec-local install-html \ | |
626 | install-html-am install-info install-info-am install-man \ | |
627 | install-pdf install-pdf-am install-ps install-ps-am \ | |
628 | install-strip installcheck installcheck-am installdirs \ | |
629 | installdirs-am maintainer-clean maintainer-clean-generic \ | |
630 | mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ | |
631 | tags-am uninstall uninstall-am uninstall-local | |
630 | 632 | |
631 | 633 | .PRECIOUS: Makefile |
632 | 634 | |
635 | ||
636 | install-exec-local: | |
637 | $(MKDIR_P) $(DESTDIR)$(pkglibdir)/dynare++ | |
638 | cp -r dynare_simul/* $(DESTDIR)$(pkglibdir)/dynare++ | |
639 | ||
640 | uninstall-local: | |
641 | rm -rf $(DESTDIR)$(pkglibdir)/dynare++ | |
633 | 642 | |
634 | 643 | # Tell versions [3.59,3.63) of GNU make to not export all variables. |
635 | 644 | # Otherwise a system limit (for SysV at least) may be exceeded. |
0 | % | |
1 | % SYNOPSIS | |
2 | % | |
3 | % r = dynare_simul(name, shocks) | |
4 | % r = dynare_simul(name, prefix, shocks) | |
5 | % r = dynare_simul(name, shocks, start) | |
6 | % r = dynare_simul(name, prefix, shocks, start) | |
7 | % | |
8 | % name name of MAT-file produced by dynare++ | |
9 | % prefix prefix of variables in the MAT-file | |
10 | % shocks matrix of shocks | |
11 | % start zero period value | |
12 | % | |
13 | % Note that this file requires the dynare_simul_ DLL to be in the path. | |
14 | % This DLL is distributed with Dynare, under the mex/matlab or mex/octave | |
15 | % subdirectory. | |
16 | % | |
17 | % SEMANTICS | |
18 | % | |
19 | % The command reads a decision rule from the MAT-file having the given | |
20 | % prefix. Then it starts simulating the decision rule with zero time value | |
21 | % equal to the given start. It uses the given shocks for the simulation. If | |
22 | % the start is not given, the state about which the decision rule is | |
23 | % centralized is taken (called fix point, or stochastic steady state, take | |
24 | % your pick). | |
25 | % | |
26 | % prefix Use the prefix with which you called dynare++, the default | |
27 | % prefix in dynare++ is 'dyn'. | |
28 | % shocks Number of rows must be a number of exogenous shocks, | |
29 | % number of columns gives the number of simulated | |
30 | % periods. NaNs and Infs in the matrix are substitued by | |
31 | % draws from the normal distribution using the covariance | |
32 | % matrix given in the model file. | |
33 | % start Vector of endogenous variables in the ordering given by | |
34 | % <prefix>_vars. | |
35 | % | |
36 | % Seed for random generator is derived from calling rand(1,1). Therefore, | |
37 | % seeding can be controlled with rand('state') and rand('state',some_seed). | |
38 | % | |
39 | % EXAMPLES | |
40 | % | |
41 | % All examples suppose that the prefix is 'dyn' and that your_model.mat | |
42 | % has been loaded into Matlab. | |
43 | % | |
44 | % 1. response to permanent negative shock to the third exo var EPS3 for | |
45 | % 100 periods | |
46 | % | |
47 | % shocks = zeros(4,100); % 4 exogenous variables in the model | |
48 | % shocks(dyn_i_EPS3,:) = -0.1; % the permanent shock to EPS3 | |
49 | % r = dynare_simul('your_model.mat',shocks); | |
50 | % | |
51 | % 2. one stochastic simulation for 100 periods | |
52 | % | |
53 | % shocks = zeros(4,100)./0; % put NaNs everywhere | |
54 | % r = dynare_simul('your_model.mat',shocks); | |
55 | % | |
56 | % 3. one stochastic simulation starting at 75% undercapitalized economy | |
57 | % | |
58 | % shocks = zeros(4,100)./0; % put NaNs everywhere | |
59 | % ystart = dyn_ss; % get copy of DR fix point | |
60 | % ystart(dyn_i_K) = 0.75*dyn_ss(dyn_i_K); % scale down the capital | |
61 | % r = dynare_simul('your_model.mat',shocks,ystart); | |
62 | % | |
63 | % | |
64 | % SEE ALSO | |
65 | % | |
66 | % "DSGE Models with Dynare++. A Tutorial.", Ondra Kamenik, 2005 | |
67 | ||
68 | % Copyright (C) 2005-2011, Ondra Kamenik | |
69 | % Copyright (C) 2020, Dynare Team | |
70 | ||
71 | ||
72 | function r = dynare_simul(varargin) | |
73 | ||
74 | if ~exist('dynare_simul_','file') | |
75 | error('Can''t find dynare_simul_ DLL in the path. The simplest way to add it is to run Dynare once in this session.') | |
76 | end | |
77 | ||
78 | % get the file name and load data | |
79 | fname = varargin{1}; | |
80 | load(fname); | |
81 | ||
82 | % set prefix, shocks, ystart | |
83 | if ischar(varargin{2}) | |
84 | prefix = varargin{2}; | |
85 | if length(varargin) == 3 | |
86 | shocks = varargin{3}; | |
87 | ystart = NaN; | |
88 | elseif length(varargin) == 4 | |
89 | shocks = varargin{3}; | |
90 | ystart = varargin{4}; | |
91 | else | |
92 | error('Wrong number of parameters.'); | |
93 | end | |
94 | else | |
95 | prefix = 'dyn'; | |
96 | if length(varargin) == 2 | |
97 | shocks = varargin{2}; | |
98 | ystart = NaN; | |
99 | elseif length(varargin) == 3 | |
100 | shocks = varargin{2}; | |
101 | ystart = varargin{3}; | |
102 | else | |
103 | error('Wrong number of parameters.'); | |
104 | end | |
105 | end | |
106 | ||
107 | % load all needed variables but prefix_g_* | |
108 | if exist([prefix '_nstat'],'var') | |
109 | nstat = eval([prefix '_nstat']); | |
110 | else | |
111 | error(['Could not find variable ' prefix '_nstat in workspace']); | |
112 | end | |
113 | if exist([prefix '_npred'],'var') | |
114 | npred = eval([prefix '_npred']); | |
115 | else | |
116 | error(['Could not find variable ' prefix '_npred in workspace']); | |
117 | end | |
118 | if exist([prefix '_nboth'],'var') | |
119 | nboth = eval([prefix '_nboth']); | |
120 | else | |
121 | error(['Could not find variable ' prefix '_nboth in workspace']); | |
122 | end | |
123 | if exist([prefix '_nforw'],'var') | |
124 | nforw = eval([prefix '_nforw']); | |
125 | else | |
126 | error(['Could not find variable ' prefix '_nforw in workspace']); | |
127 | end | |
128 | if exist([prefix '_ss'],'var') | |
129 | ss = eval([prefix '_ss']); | |
130 | else | |
131 | error(['Could not find variable ' prefix '_ss in workspace']); | |
132 | end | |
133 | if exist([prefix '_vcov_exo'],'var') | |
134 | vcov_exo = eval([prefix '_vcov_exo']); | |
135 | else | |
136 | error(['Could not find variable ' prefix '_vcov_exo in workspace']); | |
137 | end | |
138 | nexog = size(vcov_exo,1); | |
139 | ||
140 | if isnan(ystart) | |
141 | ystart = ss; | |
142 | end | |
143 | ||
144 | % newer version of dynare++ doesn't return prefix_g_0, we make it here if | |
145 | % it does not exist in workspace | |
146 | g_zero = [prefix '_g_0']; | |
147 | if ~exist(g_zero,'var') | |
148 | dr.g_0=zeros(nstat+npred+nboth+nforw,1); | |
149 | else | |
150 | dr.g_0=eval(g_zero); | |
151 | end | |
152 | ||
153 | % make derstr a string of comma seperated existing prefix_g_* | |
154 | order = 1; | |
155 | cont = 1; | |
156 | while cont == 1 | |
157 | g_ord = [prefix '_g_' num2str(order)]; | |
158 | if exist(g_ord,'var') | |
159 | dr.(['g_' num2str(order)])=eval(g_ord); | |
160 | order = order + 1; | |
161 | else | |
162 | cont = 0; | |
163 | end | |
164 | end | |
165 | ||
166 | % set seed | |
167 | seed = ceil(10000*rand(1,1)); | |
168 | ||
169 | % call dynare_simul_ | |
170 | [err,r]=dynare_simul_(order-1,nstat,npred,nboth,nforw,... | |
171 | nexog,ystart,shocks,vcov_exo,seed,ss,dr); | |
172 | ||
173 | if err | |
174 | error('Simulation failed') | |
175 | end⏎ |
28 | 28 | * |
29 | 29 | * Please note that the following copyright notice only applies to this Dynare |
30 | 30 | * implementation of the model. |
31 | ||
32 | 31 | */ |
33 | 32 | |
34 | 33 | /* |
35 | * Copyright (C) 2013-2016 Dynare Team | |
34 | * Copyright (C) 2013-2020 Dynare Team | |
36 | 35 | * |
37 | 36 | * This file is part of Dynare. |
38 | 37 | * |
50 | 49 | * along with Dynare. If not, see <http://www.gnu.org/licenses/>. |
51 | 50 | */ |
52 | 51 | |
53 | var d //preference shock | |
54 | c //consumption | |
55 | mu_z //trend growth rate of the economy (from neutral and investment specific technology) | |
56 | mu_I //growth rate of investment-specific technology growth | |
57 | mu_A //growth rate of neutral technology | |
58 | lambda //Lagrange multiplier | |
59 | R //Nominal Interest rate | |
60 | PI //Inflation | |
61 | r //rental rate of capital | |
62 | x //investment | |
63 | u //capacity utilization | |
64 | q //Tobin's marginal q | |
65 | f //variable for recursive formulation of wage setting | |
66 | ld //aggregate labor demand | |
67 | w //real wage | |
68 | wstar //optimal real wage | |
69 | PIstarw //optimal wage inflation | |
70 | PIstar //optimal price inflation | |
71 | g1 //variable 1 for recursive formulation of price setting | |
72 | g2 //variable 2 for recursive formulation of price setting | |
73 | yd //aggregate output | |
74 | mc //marginal costs | |
75 | k //capital | |
76 | vp //price dispersion term | |
77 | vw //wage dispersion term | |
78 | l //aggregate labor bundle | |
79 | phi //labor disutility shock | |
80 | F; //firm profits | |
52 | var d (long_name='preference shock') | |
53 | c (long_name='consumption') | |
54 | mu_z (long_name='trend growth rate of the economy (from neutral and investment specific technology)') | |
55 | mu_I (long_name='growth rate of investment-specific technology growth') | |
56 | mu_A (long_name='growth rate of neutral technology') | |
57 | lambda (long_name='Lagrange multiplier') | |
58 | R (long_name='Nominal Interest rate') | |
59 | PI (long_name='Inflation') | |
60 | r (long_name='rental rate of capital') | |
61 | x (long_name='investment') | |
62 | u (long_name='capacity utilization') | |
63 | q (long_name='Tobin marginal q') | |
64 | f (long_name='variable for recursive formulation of wage setting') | |
65 | ld (long_name='aggregate labor demand') | |
66 | w (long_name='real wage') | |
67 | wstar (long_name='optimal real wage') | |
68 | PIstarw (long_name='optimal wage inflation') | |
69 | PIstar (long_name='optimal price inflation') | |
70 | g1 (long_name='variable 1 for recursive formulation of price setting') | |
71 | g2 (long_name='variable 2 for recursive formulation of price setting') | |
72 | yd (long_name='aggregate output') | |
73 | mc (long_name='marginal costs') | |
74 | k (long_name='capital') | |
75 | vp (long_name='price dispersion term') | |
76 | vw (long_name='wage dispersion term') | |
77 | l (long_name='aggregate labor bundle') | |
78 | phi (long_name='labor disutility shock') | |
79 | F (long_name='firm profits') | |
80 | ; | |
81 | 81 | |
82 | varexo epsd epsphi epsmu_I epsA epsm; | |
82 | varexo epsd (long_name='Innovation preference shock') | |
83 | epsphi (long_name='Innovation labor disutility shock') | |
84 | epsmu_I (long_name='Innovation investment-specific technology') | |
85 | epsA (long_name='Innovation neutral technology') | |
86 | epsm (long_name='Innovation monetary policy shock') | |
87 | ; | |
83 | 88 | |
84 | 89 | predetermined_variables k; |
85 | 90 | |
86 | parameters h //consumption habits | |
87 | betta //discount factor | |
88 | gammma1 //capital utilization, linear term | |
89 | gammma2 //capital utilization, quadratic term | |
90 | delta //depreciation rate | |
91 | kappa //capital adjustment costs parameter | |
92 | eta //elasticity of substitution between labor varieties | |
93 | epsilon //elasticity of substitution between goods varieties | |
94 | varpsi //labor disutility parameter | |
95 | gammma //inverse Frisch elasticity | |
96 | chiw //wage indexation parameter | |
97 | chi //price indexation | |
98 | thetap //Calvo parameter prices | |
99 | thetaw //Calvo parameter wages | |
100 | alppha //capital share | |
101 | Rbar //steady state interest rate | |
102 | PIbar //steady state inflation | |
103 | gammmaR //interest smoothing coefficient Taylor rule | |
104 | gammmaPI //feedback coefficient to inflation monetary policy rule | |
105 | gammmay //feedback coefficient to output growth deviation in monetary policy rule | |
106 | Phi //firms fixed costs | |
107 | rhod //autocorrelation preference shock | |
108 | rhophi //autocorrelation labor disutility shock | |
109 | Lambdamu //steady state growth rate of investmentment-specific technology | |
110 | LambdaA //steady state neutral technology growth | |
111 | Lambdax //steady state growth rate of investment | |
112 | LambdaYd //steady state growth rate of output | |
113 | sigma_d //standard deviation preference shock | |
114 | sigma_phi //standard deviation labor disutility shock | |
115 | sigma_mu //standard deviation investment-specific technology | |
116 | sigma_A //standard deviation neutral technology | |
117 | sigma_m; //standard deviation preference shock | |
118 | ||
91 | parameters h (long_name='consumption habits') | |
92 | betta (long_name='discount factor') | |
93 | gammma1 (long_name='capital utilization, linear term') | |
94 | gammma2 (long_name='capital utilization, quadratic term') | |
95 | delta (long_name='depreciation rate') | |
96 | kappa (long_name='capital adjustment costs parameter') | |
97 | eta (long_name='elasticity of substitution between labor varieties') | |
98 | epsilon (long_name='elasticity of substitution between goods varieties') | |
99 | varpsi (long_name='labor disutility parameter') | |
100 | gammma (long_name='inverse Frisch elasticity') | |
101 | chiw (long_name='wage indexation parameter') | |
102 | chi (long_name='price indexation') | |
103 | thetap (long_name='Calvo parameter prices') | |
104 | thetaw (long_name='Calvo parameter wages') | |
105 | alppha (long_name='capital share') | |
106 | Rbar (long_name='steady state interest rate') | |
107 | PIbar (long_name='steady state inflation') | |
108 | gammmaR (long_name='interest smoothing coefficient Taylor rule') | |
109 | gammmaPI (long_name='feedback coefficient to inflation monetary policy rule') | |
110 | gammmay (long_name='feedback coefficient to output growth deviation in monetary policy rule') | |
111 | Phi (long_name='firms fixed costs') | |
112 | rhod (long_name='autocorrelation preference shock') | |
113 | rhophi (long_name='autocorrelation labor disutility shock') | |
114 | Lambdamu (long_name='steady state growth rate of investmentment-specific technology') | |
115 | LambdaA (long_name='steady state neutral technology growth') | |
116 | Lambdax (long_name='steady state growth rate of investment') | |
117 | LambdaYd (long_name='steady state growth rate of output') | |
118 | sigma_d (long_name='standard deviation preference shock') | |
119 | sigma_phi (long_name='standard deviation labor disutility shock') | |
120 | sigma_mu (long_name='standard deviation investment-specific technology') | |
121 | sigma_A (long_name='standard deviation neutral technology') | |
122 | sigma_m (long_name='standard deviation monetary policy shock') | |
123 | ; | |
119 | 124 | |
120 | 125 | //Note that the parameter naming in FV(2010) differs from FV(2006) |
121 | 126 | //Fixed parameters, taken from FV(2010), Table 2, p. 37 |
176 | 181 | */ |
177 | 182 | |
178 | 183 | model; |
179 | //1. FOC consumption | |
184 | [name='FOC consumption'] | |
180 | 185 | d*(c-h*c(-1)*mu_z^(-1))^(-1)-h*betta*d(+1)*(c(+1)*mu_z(+1)-h*c)^(-1)=lambda; |
181 | //2. Euler equation | |
186 | [name='Euler equation'] | |
182 | 187 | lambda=betta*lambda(+1)*mu_z(+1)^(-1)/PI(+1)*R; |
183 | //3. FOC capital utilization | |
188 | [name='FOC capital utilization'] | |
184 | 189 | r=gammma1+gammma2*(u-1); |
185 | //4. FOC capital | |
190 | [name='FOC capital'] | |
186 | 191 | q=betta*lambda(+1)/lambda*mu_z(+1)^(-1)*mu_I(+1)^(-1)*((1-delta)*q(+1)+r(+1)*u(+1)-(gammma1*(u(+1)-1)+gammma2/2*(u(+1)-1)^2)); |
187 | //5. FOC investment | |
192 | [name='FOC investment'] | |
188 | 193 | 1=q*(1-(kappa/2*(x/x(-1)*mu_z-Lambdax)^2)-(kappa*(x/x(-1)*mu_z-Lambdax)*x/x(-1)*mu_z)) |
189 | 194 | +betta*q(+1)*lambda(+1)/lambda*mu_z(+1)^(-1)*kappa*(x(+1)/x*mu_z(+1)-Lambdax)*(x(+1)/x*mu_z(+1))^2; |
190 | //6-7. Wage setting | |
195 | [name='Wage setting 1'] | |
191 | 196 | f=(eta-1)/eta*wstar^(1-eta)*lambda*w^eta*ld+betta*thetaw*(PI^chiw/PI(+1))^(1-eta)*(wstar(+1)/wstar*mu_z(+1))^(eta-1)*f(+1); |
197 | [name='Wage setting 2'] | |
192 | 198 | f=varpsi*d*phi*PIstarw^(-eta*(1+gammma))*ld^(1+gammma)+betta*thetaw*(PI^chiw/PI(+1))^(-eta*(1+gammma))*(wstar(+1)/wstar*mu_z(+1))^(eta*(1+gammma))*f(+1); |
193 | 199 | |
194 | //8-10. firm's price setting | |
200 | [name='Firm price setting 1'] | |
195 | 201 | g1=lambda*mc*yd+betta*thetap*(PI^chi/PI(+1))^(-epsilon)*g1(+1); |
202 | [name='Firm price setting 2'] | |
196 | 203 | g2=lambda*PIstar*yd+betta*thetap*(PI^chi/PI(+1))^(1-epsilon)*PIstar/PIstar(+1)*g2(+1); |
204 | [name='Firm price setting 3'] | |
197 | 205 | epsilon*g1=(epsilon-1)*g2; |
198 | //11-12. optimal inputs | |
206 | [name='Optimal capital labor ratio'] | |
199 | 207 | u*k/ld=alppha/(1-alppha)*w/r*mu_z*mu_I; |
208 | [name='Marginal costs'] | |
200 | 209 | mc=(1/(1-alppha))^(1-alppha)*(1/alppha)^alppha*w^(1-alppha)*r^alppha; |
201 | //13. law of motion wages | |
210 | [name='law of motion wages'] | |
202 | 211 | 1=thetaw*(PI(-1)^chiw/PI)^(1-eta)*(w(-1)/w*mu_z^(-1))^(1-eta)+(1-thetaw)*PIstarw^(1-eta); |
203 | //14. law of motion prices | |
212 | [name='law of motion prices'] | |
204 | 213 | 1=thetap*(PI(-1)^chi/PI)^(1-epsilon)+(1-thetap)*PIstar^(1-epsilon); |
205 | 214 | |
206 | //15. Taylor Rule | |
215 | [name='Taylor Rule'] | |
207 | 216 | R/Rbar=(R(-1)/Rbar)^gammmaR*((PI/PIbar)^gammmaPI*((yd/yd(-1)*mu_z)/exp(LambdaYd))^gammmay)^(1-gammmaR)*exp(epsm); |
208 | 217 | |
209 | //16-17. Market clearing | |
218 | [name='Resource constraint'] | |
210 | 219 | yd=c+x+mu_z^(-1)*mu_I^(-1)*(gammma1*(u-1)+gammma2/2*(u-1)^2)*k; |
220 | [name='Aggregate production'] | |
211 | 221 | yd=(mu_A*mu_z^(-1)*(u*k)^alppha*ld^(1-alppha)-Phi)/vp; |
212 | //18-20. Price and wage dispersion terms | |
222 | [name='Aggregate labor market'] | |
213 | 223 | l=vw*ld; |
224 | [name='LOM Price dispersion term'] | |
214 | 225 | vp=thetap*(PI(-1)^chi/PI)^(-epsilon)*vp(-1)+(1-thetap)*PIstar^(-epsilon); |
226 | [name='LOM Wage dispersion term'] | |
215 | 227 | vw=thetaw*(w(-1)/w*mu_z^(-1)*PI(-1)^chiw/PI)^(-eta)*vw(-1)+(1-thetaw)*(PIstarw)^(-eta); |
216 | //21. Law of motion for capital | |
228 | [name='Law of motion for capital'] | |
217 | 229 | k(+1)*mu_z*mu_I-(1-delta)*k-mu_z*mu_I*(1-kappa/2*(x/x(-1)*mu_z-Lambdax)^2)*x=0; |
218 | //22. Profits | |
230 | [name='Profits'] | |
219 | 231 | F=yd-1/(1-alppha)*w*ld; |
220 | //23. definition optimal wage inflation | |
232 | [name='definition optimal wage inflation'] | |
221 | 233 | PIstarw=wstar/w; |
222 | 234 | |
223 | 235 | //exogenous processes |
224 | //24. Preference Shock | |
236 | [name='Preference Shock'] | |
225 | 237 | log(d)=rhod*log(d(-1))+epsd; |
226 | //25. Labor disutility Shock | |
238 | [name='Labor disutility Shock'] | |
227 | 239 | log(phi)=rhophi*log(phi(-1))+epsphi; |
228 | //26. Investment specific technology | |
240 | [name='Investment specific technology'] | |
229 | 241 | log(mu_I)=Lambdamu+epsmu_I; |
230 | //27. Neutral technology | |
242 | [name='Neutral technology'] | |
231 | 243 | log(mu_A)=LambdaA+epsA; |
232 | //28. Defininition composite technology | |
244 | [name='Defininition composite technology'] | |
233 | 245 | mu_z=mu_A^(1/(1-alppha))*mu_I^(alppha/(1-alppha)); |
234 | 246 | |
235 | 247 | end; |
13 | 13 | % - params [vector] vector of parameter values |
14 | 14 | % - check [scalar] set to 0 if steady state computation worked and to |
15 | 15 | % 1 of not (allows to impose restrictions on parameters) |
16 | ||
17 | % Copyright (C) 2013-2020 Dynare Team | |
18 | % | |
19 | % This file is part of Dynare. | |
20 | % | |
21 | % Dynare is free software: you can redistribute it and/or modify | |
22 | % it under the terms of the GNU General Public License as published by | |
23 | % the Free Software Foundation, either version 3 of the License, or | |
24 | % (at your option) any later version. | |
25 | % | |
26 | % Dynare is distributed in the hope that it will be useful, | |
27 | % but WITHOUT ANY WARRANTY; without even the implied warranty of | |
28 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
29 | % GNU General Public License for more details. | |
30 | % | |
31 | % You should have received a copy of the GNU General Public License | |
32 | % along with Dynare. If not, see <http://www.gnu.org/licenses/>. | |
16 | 33 | |
17 | 34 | % read out parameters to access them with their name |
18 | 35 | NumberOfParameters = M_.param_nbr; |
246 | 246 | Copyright: 1996-2020 Dynare Team |
247 | 247 | License: GFDL-NIV-1.3+ |
248 | 248 | |
249 | Files: doc/dr.tex doc/dr.bib doc/bvar_a_la_sims.tex | |
249 | Files: doc/dr.tex doc/dr.bib doc/bvar-a-la-sims.tex | |
250 | 250 | Copyright: 2007-2011 Sébastien Villemot |
251 | 251 | License: GFDL-NIV-1.3+ |
252 | 252 | |
308 | 308 | License: BSD-2-clause |
309 | 309 | |
310 | 310 | Files: preprocessor/m4/ax_boost_base.m4 |
311 | preprocessor/m4/ax_boost_system.m4 | |
312 | preprocessor/m4/ax_boost_filesystem.m4 | |
313 | 311 | Copyright: 2008-2009 Thomas Porschberg <thomas@randspringer.de> |
314 | 312 | 2009 Peter Adolphs |
315 | 2008-2009 Michael Tindal | |
316 | 2008 Daniel Casimiro <dan.casimiro@gmail.com> | |
317 | 2009 Roman Rybalko <libtorrent@romanr.info> | |
318 | 313 | License: FSFAP |
319 | 314 | |
320 | 315 | Files: preprocessor/m4/ax_cxx_compile_stdcxx.m4 |
343 | 338 | Copyright: 2007-2019 Dynare Team |
344 | 339 | License: CC-BY-SA-4.0 |
345 | 340 | |
346 | Files: contrib/jsonlab | |
341 | Files: contrib/jsonlab/* | |
347 | 342 | Copyright: 2011-2018 Qianqian Fang <q.fang at neu.edu> |
348 | 343 | License: BSD-2-clause or GPL-3+ |
349 | 344 | |
613 | 608 | material not subject to the license. This includes other CC- |
614 | 609 | licensed material, or material used under an exception or |
615 | 610 | limitation to copyright. More considerations for licensors: |
616 | wiki.creativecommons.org/Considerations_for_licensors | |
611 | wiki.creativecommons.org/Considerations_for_licensors | |
617 | 612 | . |
618 | 613 | Considerations for the public: By using one of our public |
619 | 614 | licenses, a licensor grants the public permission to use the |
629 | 624 | such as asking that all changes be marked or described. |
630 | 625 | Although not required by our licenses, you are encouraged to |
631 | 626 | respect those requests where reasonable. More_considerations |
632 | for the public: | |
633 | wiki.creativecommons.org/Considerations_for_licensees | |
627 | for the public: | |
628 | wiki.creativecommons.org/Considerations_for_licensees | |
634 | 629 | . |
635 | 630 | ======================================================================= |
636 | 631 | . |
0 | 0 | #!/usr/bin/env bash |
1 | 1 | |
2 | # Copyright © 2019 Dynare Team | |
2 | # Copyright © 2019-2020 Dynare Team | |
3 | 3 | # |
4 | 4 | # This file is part of Dynare. |
5 | 5 | # |
124 | 124 | cp "$ROOTDIR"/dynare++/doc/*.pdf "$PKGFILES"/doc/dynare++ |
125 | 125 | |
126 | 126 | cp "$ROOTDIR"/dynare++/src/dynare++ "$PKGFILES"/dynare++ |
127 | cp "$ROOTDIR"/dynare++/dynare_simul/dynare_simul.m "$PKGFILES"/dynare++ | |
127 | 128 | |
128 | 129 | mkdir -p "$PKGFILES"/matlab/modules/dseries/externals/x13/macOS/64 |
129 | 130 | cp -p "$ROOTDIR"/macOS/deps/lib64/x13as/x13as "$PKGFILES"/matlab/modules/dseries/externals/x13/macOS/64 |
13 | 13 | <choice id="org.dynare" title="Dynare" description="Dynare Required Files" start_enabled="false" enabled="false"> |
14 | 14 | <pkg-ref id="org.dynare" /> |
15 | 15 | </choice> |
16 | <choice id="org.dynare.gcc" title="GCC compiler for use_dll" description="This is necessary for the use of Dynare with the `use_dll` option. NB: This takes a few minutes and requires an active internet connection"> | |
16 | <choice id="org.dynare.gcc" title="GCC for `use_dll`" description="This is necessary for the use of Dynare with the `use_dll` option. NB: This takes a few minutes and requires an active internet connection."> | |
17 | 17 | <pkg-ref id="org.dynare.gcc" /> |
18 | 18 | </choice> |
19 | 19 | <pkg-ref id="org.dynare" version="VERSION_NO_SPACE">dynare-VERSION_NO_SPACE.pkg</pkg-ref> |
0 | 0 | #!/usr/bin/env bash |
1 | 1 | |
2 | # Copyright © 2019 Dynare Team | |
2 | # Copyright © 2019-2020 Dynare Team | |
3 | 3 | # |
4 | 4 | # This file is part of Dynare. |
5 | 5 | # |
28 | 28 | rm -f "$2"/dummy |
29 | 29 | |
30 | 30 | # Test for Internet connection |
31 | [[ -z $(curl -s -m 4 www.google.com) ]] && { echo "No internet connection found"; exit 1; } | |
31 | [[ -z $(curl -s -m 4 https://github.com) ]] && \ | |
32 | { \ | |
33 | osascript -e 'display alert "Dynare Installation Error" message "Not able to connect to github.com. Either you are not connected to the internet or github.com is blocked where you are.\n\nAccess to GitHub is necessary to make Dynare work with the `use_dll` option on macOS.\n\nIf you cannot establish this connection or do not want to use the `use_dll` option of Dynare, please run the installer again and choose \"Customize\" from the \"Installation Type\" screen and uncheck the `GCC` option." as critical'; \ | |
34 | echo "No internet connection to github.com"; \ | |
35 | exit 1; \ | |
36 | } | |
32 | 37 | |
33 | 38 | # Install Command Line Tools |
34 | 39 | if [[ -z $(/usr/bin/xcode-select -print-path) ]]; then |
48 | 53 | |
49 | 54 | # If CLT installation didn't work, exit |
50 | 55 | [[ -z $(/usr/bin/xcode-select -print-path) ]] && \ |
51 | { echo "You must install Command Line Tools to proceed with installation of GCC"; exit 1; } | |
56 | { \ | |
57 | osascript -e 'display alert "Dynare Installation Error" message "Not able to find Command Line Tools.\n\nCommand Line Tools is necessary to make Dynare work with the `use_dll` option on macOS.\n\nIf you cannot establish this connection or do not want to use the `use_dll` option of Dynare, please run the installer again and choose \"Customize\" from the \"Installation Type\" screen and uncheck the `GCC` option." as critical'; \ | |
58 | echo "Command Line Tools not installed"; \ | |
59 | exit 1; \ | |
60 | } | |
61 | ||
62 | # Ensure git is in the path | |
63 | [[ -z $(which git) ]] && \ | |
64 | { \ | |
65 | osascript -e 'display alert "Dynare Installation Error" message "Not able to find Git even though the Command Line Tools have already been installed. This is likely a problem with your PATH environment variable.\n\nGit is necessary to make Dynare work with the `use_dll` option on macOS.\n\nIf you cannot establish this connection or do not want to use the `use_dll` option of Dynare, please run the installer again and choose \"Customize\" from the \"Installation Type\" screen and uncheck the `GCC` option." as critical'; \ | |
66 | echo $PATH; \ | |
67 | echo "Git not found in PATH"; \ | |
68 | exit 1; \ | |
69 | } | |
52 | 70 | |
53 | 71 | # Install Homebrew |
54 | 72 | BREWDIR="$2"/.brew |
3 | 3 | <p style="text-align: center;">Version VERSION_NO_SPACE</p> |
4 | 4 | <p style="text-align: center;">DATE</p> |
5 | 5 | |
6 | <p><b>Just a few things to note</b>. This installation can be customized as you can choose not to install the GNU C Compiler (GCC). Installing GCC is necessary if you want to use the <tt>use_dll</tt> option in Dynare, but otherwise unnecessary.</p> | |
6 | <p><b>Just a few things to note</b>. This installation can be customized as you can choose not to install the GNU Compiler Collection (GCC). Installing GCC is necessary if you want to use the <tt>use_dll</tt> option in Dynare, but otherwise unnecessary.</p> | |
7 | 7 | |
8 | 8 | <p>To install GCC we run a script that first installs the XCode Command Line Tools (an Apple product). The script then installs Homebrew, a package manager for macOS and, finally, GCC itself. Both Homebrew and GCC will be installed in your Dynare installation folder. So, when you delete this folder, they too will be deleted.</p> |
9 | 9 | |
10 | <p>Installing GCC will require an active internet connection and will take a few minutes to a half an hour during the <i>Running package scripts</i> phase of Installation. The time it takes depends on your internet speed, the speed of your computer, and whether or not you already have XCode Command Line Tools installed. The progress bar will not advance during this phase. Please be patient.</p> | |
10 | <p>Installing GCC will require an active internet connection with the ability to connect to the Apple servers and GitHub. The installation will take anywhere from a few minutes to a half an hour during the <i>Running package scripts</i> phase of Installation. The time it takes depends on your internet speed, the speed of your computer, and whether or not you already have XCode Command Line Tools installed. The progress bar will not advance during this phase. Please be patient.</p> | |
11 | 11 | |
12 | 12 | <p> You can choose not to install GCC by choosing <i>Customize</i> from the <i>Installation Type</i> screen and deselecting <i>GCC compiler</i>. If you already have <tt>GCC_BINARY</tt> installed under <tt>/usr/local</tt>, you can forgo the installation of GCC here as Dynare will find your system compiler when you use <tt>use_dll</tt>.</p> |
13 | 13 | </body> |
142 | 142 | end |
143 | 143 | if info |
144 | 144 | skipline() |
145 | message = get_error_message(info); | |
145 | message = get_error_message(info,options_); | |
146 | 146 | fprintf('Cannot solve the model on the prior mode (info = %d, %s)\n', info(1), message); |
147 | 147 | skipline() |
148 | 148 | return |
0 | function [info, oo_, options_] = discretionary_policy(M_, options_, oo_, var_list) | |
1 | % function [info, oo_, options_] = discretionary_policy(M_, options_, oo_, var_list) | |
0 | function [info, oo_, options_, M_] = discretionary_policy(M_, options_, oo_, var_list) | |
1 | % function [info, oo_, options_, M_] = discretionary_policy(M_, options_, oo_, var_list) | |
2 | 2 | % INPUTS |
3 | 3 | % - M_ [structure] Matlab's structure describing the model (M_). |
4 | 4 | % - options_ [structure] Matlab's structure describing the current options (options_). |
9 | 9 | % - info [integer] scalar or vector, error code. |
10 | 10 | % - oo_ [structure] Matlab's structure containing the results (oo_). |
11 | 11 | % - options_ [structure] Matlab's structure describing the current options (options_). |
12 | % - M_ [structure] Matlab's structure describing the model (M_). | |
12 | 13 | |
13 | % Copyright (C) 2007-2019 Dynare Team | |
14 | % Copyright (C) 2007-2020 Dynare Team | |
14 | 15 | % |
15 | 16 | % This file is part of Dynare. |
16 | 17 | % |
32 | 33 | origorder = options_.order; |
33 | 34 | options_.discretionary_policy = 1; |
34 | 35 | options_.order = 1; |
35 | [info, oo_] = stoch_simul(M_, options_, oo_, var_list); | |
36 | [info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list); | |
36 | 37 | |
37 | 38 | if ~options_.noprint |
38 | 39 | disp_steady_state(M_,oo_) |
32 | 32 | persistent Hold |
33 | 33 | |
34 | 34 | info = 0; |
35 | ||
36 | dr=oo_.dr; %initialize output argument | |
35 | 37 | |
36 | 38 | beta = get_optimal_policy_discount_factor(M_.params, M_.param_names); |
37 | 39 | |
105 | 107 | [H,G,info]=discretionary_policy_engine(A.lag,A.contemp,A.lead,B,W,M_.instr_id,beta,options_.dp.maxit,options_.discretionary_tol,options_.qz_criterium); |
106 | 108 | end |
107 | 109 | |
108 | ||
109 | 110 | if info |
110 | 111 | return |
111 | 112 | else |
114 | 115 | end |
115 | 116 | |
116 | 117 | %write back solution to dr |
117 | dr=oo_.dr; | |
118 | 118 | dr.ys =zeros(M_.endo_nbr,1); |
119 | 119 | dr=set_state_space(dr,M_,options_); |
120 | 120 | T=H(dr.order_var,dr.order_var); |
18 | 18 | % vartan [char] array of characters (with nvar rows). |
19 | 19 | % NumberOfConditionalDecompFiles [integer] scalar, number of prior or posterior data files (for covariance). |
20 | 20 | |
21 | % Copyright (C) 2009-2015 Dynare Team | |
21 | % Copyright (C) 2009-2020 Dynare Team | |
22 | 22 | % |
23 | 23 | % This file is part of Dynare. |
24 | 24 | % |
38 | 38 | |
39 | 39 | % Get informations about the _posterior_draws files. |
40 | 40 | if strcmpi(type,'posterior') |
41 | DrawsFiles = dir([M_.dname '/metropolis/' M_.fname '_' type '_draws*' ]); | |
41 | NumberOfDrawsFiles = length(dir([M_.dname '/metropolis/' M_.fname '_' type '_draws*' ])); | |
42 | 42 | posterior = 1; |
43 | 43 | elseif strcmpi(type,'prior') |
44 | DrawsFiles = dir([M_.dname '/prior/draws/' type '_draws*' ]); | |
44 | NumberOfDrawsFiles = length(dir([M_.dname '/prior/draws/' type '_draws*' ])); | |
45 | 45 | CheckPath('prior/moments',M_.dname); |
46 | 46 | posterior = 0; |
47 | 47 | else |
77 | 77 | nar = options_.ar; |
78 | 78 | options_.ar = 0; |
79 | 79 | |
80 | NumberOfDrawsFiles = rows(DrawsFiles); | |
81 | 80 | NumberOfSavedElementsPerSimulation = nvar*M_.exo_nbr*length(Steps); |
82 | 81 | MaXNumberOfConditionalDecompLines = ceil(options_.MaxNumberOfBytes/NumberOfSavedElementsPerSimulation/8); |
83 | 82 | |
131 | 130 | linea_ME = 0; |
132 | 131 | for file = 1:NumberOfDrawsFiles |
133 | 132 | if posterior |
134 | load([M_.dname '/metropolis/' DrawsFiles(file).name ]); | |
133 | load([M_.dname '/metropolis/' M_.fname '_' type '_draws' num2str(file) ]); | |
135 | 134 | else |
136 | load([M_.dname '/prior/draws/' DrawsFiles(file).name ]); | |
135 | load([M_.dname '/prior/draws/' type '_draws' num2str(file) ]); | |
137 | 136 | end |
138 | 137 | isdrsaved = columns(pdraws)-1; |
139 | 138 | NumberOfDraws = rows(pdraws); |
16 | 16 | % vartan [char] array of characters (with nvar rows). |
17 | 17 | % CorrFileNumber [integer] scalar, number of prior or posterior data files (for correlation). |
18 | 18 | |
19 | % Copyright (C) 2007-2017 Dynare Team | |
19 | % Copyright (C) 2007-2020 Dynare Team | |
20 | 20 | % |
21 | 21 | % This file is part of Dynare. |
22 | 22 | % |
37 | 37 | |
38 | 38 | % Get informations about the _posterior_draws files. |
39 | 39 | if strcmpi(type,'posterior') |
40 | DrawsFiles = dir([M_.dname '/metropolis/' M_.fname '_' type '_draws*' ]); | |
40 | NumberOfDrawsFiles = length(dir([M_.dname '/metropolis/' M_.fname '_' type '_draws*' ])); | |
41 | 41 | posterior = 1; |
42 | 42 | elseif strcmpi(type,'prior') |
43 | DrawsFiles = dir([M_.dname '/prior/draws/' type '_draws*' ]); | |
43 | NumberOfDrawsFiles = length(dir([M_.dname '/prior/draws/' type '_draws*' ])); | |
44 | 44 | CheckPath('prior/moments',M_.dname); |
45 | 45 | posterior = 0; |
46 | 46 | else |
47 | 47 | disp('dsge_simulated_theoretical_correlation:: Unknown type!'); |
48 | 48 | error() |
49 | 49 | end |
50 | NumberOfDrawsFiles = length(DrawsFiles); | |
51 | 50 | |
52 | 51 | %delete old stale files before creating new ones |
53 | 52 | if posterior |
94 | 93 | linea = 0; |
95 | 94 | for file = 1:NumberOfDrawsFiles |
96 | 95 | if posterior |
97 | load([M_.dname '/metropolis/' DrawsFiles(file).name ]); | |
96 | load([M_.dname '/metropolis/' M_.fname '_' type '_draws' num2str(file) ]); | |
98 | 97 | else |
99 | load([M_.dname '/prior/draws/' DrawsFiles(file).name]); | |
98 | load([M_.dname '/prior/draws/' type '_draws' num2str(file) ]); | |
100 | 99 | end |
101 | 100 | NumberOfDraws = rows(pdraws); |
102 | 101 | isdrsaved = columns(pdraws)-1; |
135 | 134 | end |
136 | 135 | end |
137 | 136 | |
138 | options_.ar = oldnar;⏎ | |
137 | options_.ar = oldnar; |
15 | 15 | % vartan [char] array of characters (with nvar rows). |
16 | 16 | % CovarFileNumber [integer] scalar, number of prior or posterior data files (for covariance). |
17 | 17 | |
18 | % Copyright (C) 2007-2017 Dynare Team | |
18 | % Copyright (C) 2007-2020 Dynare Team | |
19 | 19 | % |
20 | 20 | % This file is part of Dynare. |
21 | 21 | % |
36 | 36 | |
37 | 37 | % Get informations about the _posterior_draws files. |
38 | 38 | if strcmpi(type,'posterior') |
39 | DrawsFiles = dir([M_.dname '/metropolis/' M_.fname '_' type '_draws*' ]); | |
39 | NumberOfDrawsFiles = length(dir([M_.dname '/metropolis/' M_.fname '_' type '_draws*' ])); | |
40 | 40 | posterior = 1; |
41 | 41 | elseif strcmpi(type,'prior') |
42 | DrawsFiles = dir([M_.dname '/prior/draws/' type '_draws*' ]); | |
42 | NumberOfDrawsFiles = length(dir([M_.dname '/prior/draws/' type '_draws*' ])); | |
43 | 43 | CheckPath('prior/moments',M_.dname); |
44 | 44 | posterior = 0; |
45 | 45 | else |
46 | 46 | disp('dsge_simulated_theoretical_covariance:: Unknown type!') |
47 | 47 | error(); |
48 | 48 | end |
49 | NumberOfDrawsFiles = length(DrawsFiles); | |
50 | 49 | |
51 | 50 | %delete old stale files before creating new ones |
52 | 51 | if posterior |
93 | 92 | linea = 0; |
94 | 93 | for file = 1:NumberOfDrawsFiles |
95 | 94 | if posterior |
96 | load([M_.dname '/metropolis/' DrawsFiles(file).name ],'pdraws'); | |
95 | load([M_.dname '/metropolis/' M_.fname '_' type '_draws' num2str(file) ]); | |
97 | 96 | else |
98 | load([M_.dname '/prior/draws/' DrawsFiles(file).name ],'pdraws'); | |
97 | load([M_.dname '/prior/draws/' type '_draws' num2str(file) ]); | |
99 | 98 | end |
100 | 99 | NumberOfDraws = rows(pdraws); |
101 | 100 | isdrsaved = columns(pdraws)-1; |
135 | 134 | end |
136 | 135 | end |
137 | 136 | |
138 | options_.ar = nar;⏎ | |
137 | options_.ar = nar; |
17 | 17 | % vartan [char] array of characters (with nvar rows). |
18 | 18 | % CovarFileNumber [integer] scalar, number of prior or posterior data files (for covariance). |
19 | 19 | |
20 | % Copyright (C) 2007-2017 Dynare Team | |
20 | % Copyright (C) 2007-2020 Dynare Team | |
21 | 21 | % |
22 | 22 | % This file is part of Dynare. |
23 | 23 | % |
38 | 38 | |
39 | 39 | % Get informations about the _posterior_draws files. |
40 | 40 | if strcmpi(type,'posterior') |
41 | DrawsFiles = dir([M_.dname '/metropolis/' M_.fname '_' type '_draws*' ]); | |
41 | NumberOfDrawsFiles = length(dir([M_.dname '/metropolis/' M_.fname '_' type '_draws*' ])); | |
42 | 42 | posterior = 1; |
43 | 43 | elseif strcmpi(type,'prior') |
44 | DrawsFiles = dir([M_.dname '/prior/draws/' type '_draws*' ]); | |
44 | NumberOfDrawsFiles = length(dir([M_.dname '/prior/draws/' type '_draws*' ])); | |
45 | 45 | CheckPath('prior/moments',M_.dname); |
46 | 46 | posterior = 0; |
47 | 47 | else |
80 | 80 | |
81 | 81 | nexo = M_.exo_nbr; |
82 | 82 | |
83 | NumberOfDrawsFiles = rows(DrawsFiles); | |
84 | 83 | NumberOfSavedElementsPerSimulation = nvar*(nexo+1); |
85 | 84 | MaXNumberOfDecompLines = ceil(options_.MaxNumberOfBytes/NumberOfSavedElementsPerSimulation/8); |
86 | 85 | |
130 | 129 | only_non_stationary_vars=0; |
131 | 130 | for file = 1:NumberOfDrawsFiles |
132 | 131 | if posterior |
133 | load([M_.dname '/metropolis/' DrawsFiles(file).name ]); | |
132 | load([M_.dname '/metropolis/' M_.fname '_' type '_draws' num2str(file) ]); | |
134 | 133 | else |
135 | load([M_.dname '/prior/draws/' DrawsFiles(file).name ]); | |
134 | load([M_.dname '/prior/draws/' type '_draws' num2str(file) ]); | |
136 | 135 | end |
137 | 136 | isdrsaved = columns(pdraws)-1; |
138 | 137 | NumberOfDraws = rows(pdraws); |
120 | 120 | oo.exo_det_steady_state], ... |
121 | 121 | M,options_,~options_.steadystate.nocheck); |
122 | 122 | if any(imag(x(1:M.orig_endo_nbr))) %return with penalty |
123 | resids=1+sum(abs(imag(x(1:M.orig_endo_nbr)))); %return with penalty | |
123 | resids=ones(inst_nbr,1)+sum(abs(imag(x(1:M.orig_endo_nbr)))); %return with penalty | |
124 | 124 | steady_state=NaN(endo_nbr,1); |
125 | 125 | return |
126 | end | |
127 | if check %return | |
128 | resids=ones(inst_nbr,1)+sum(abs(x(1:M.orig_endo_nbr))); %return with penalty | |
129 | steady_state=NaN(endo_nbr,1); | |
130 | return | |
126 | 131 | end |
127 | 132 | |
128 | 133 | end |
11 | 11 | % SPECIAL REQUIREMENTS |
12 | 12 | % none |
13 | 13 | |
14 | % Copyright (C) 2003-2018 Dynare Team | |
14 | % Copyright (C) 2003-2020 Dynare Team | |
15 | 15 | % |
16 | 16 | % This file is part of Dynare. |
17 | 17 | % |
213 | 213 | end |
214 | 214 | options_.mode_file = mode_file0; |
215 | 215 | %reset stored mode-file to user defined one (and in case it was only set by the recursive estimation) |
216 | oo_.gui.ran_estimation = true; | |
217 |
438 | 438 | end |
439 | 439 | % Tunes the jumping distribution's scale parameter |
440 | 440 | if options_.mh_tune_jscale.status |
441 | if options_.posterior_sampler_options.posterior_sampling_method=='random_walk_metropolis_hastings' | |
441 | if strcmp(options_.posterior_sampler_options.posterior_sampling_method, 'random_walk_metropolis_hastings') | |
442 | 442 | options = options_.mh_tune_jscale; |
443 | 443 | options.rwmh = options_.posterior_sampler_options.rwmh; |
444 | 444 | options_.mh_jscale = calibrate_mh_scale_parameter(objective_function, ... |
460 | 460 | identification_analysis(params, indpmodel, indpstderr, indpcorr, options_ident, dataset_info, prior_exist, 1); %the 1 at the end implies initialization of persistent variables |
461 | 461 | if info(1)~=0 |
462 | 462 | % there are errors in the solution algorithm |
463 | message = get_error_message(info,0,options_); | |
463 | message = get_error_message(info,options_); | |
464 | 464 | fprintf('-----------\n'); |
465 | 465 | fprintf('The model does not solve for %s (info = %d: %s)\n', parameters, info(1), message); |
466 | 466 | fprintf('-----------\n'); |
36 | 36 | % [1] This function use persistent variables for the dataset and the description of the missing observations. Consequently, if this function |
37 | 37 | % is called more than once (by changing the value of parameters) the sample *must not* change. |
38 | 38 | |
39 | % Copyright (C) 2010-2017 Dynare Team | |
39 | % Copyright (C) 2010-2020 Dynare Team | |
40 | 40 | % |
41 | 41 | % This file is part of Dynare. |
42 | 42 | % |
110 | 110 | |
111 | 111 | %reset qz_criterium |
112 | 112 | options_.qz_criterium=qz_criterium_old; |
113 | oo_.gui.ran_calib_smoother = true; |
58 | 58 | % there are errors in the solution algorithm |
59 | 59 | probl_par = get_the_name(j,varargin{5}.TeX,varargin{3},varargin{2},varargin{5}); |
60 | 60 | skipline() |
61 | message = get_error_message(info,0,varargin{5}); | |
61 | message = get_error_message(info,varargin{5}); | |
62 | 62 | fprintf('Parameter error in numerical two-sided difference method:\n') |
63 | 63 | fprintf('Cannot solve the model for %s (info = %d, %s)\n', probl_par, info(1), message); |
64 | 64 | fprintf('Possible solutions:\n') |
0 | function message = get_error_message(info, noprint, DynareOptions) | |
0 | function message = get_error_message(info, DynareOptions) | |
1 | 1 | % Returns error messages |
2 | 2 | % |
3 | 3 | % INPUTS |
4 | 4 | % info [double] vector returned by resol.m |
5 | % noprint [integer] equal to 0 if the error message has to be printed. | |
6 | 5 | % DynareOptions [structure] --> options_ |
7 | 6 | % OUTPUTS |
8 | 7 | % message [string] corresponding error message |
10 | 9 | % SPECIAL REQUIREMENTS |
11 | 10 | % none |
12 | 11 | |
13 | % Copyright (C) 2005-2019 Dynare Team | |
12 | % Copyright (C) 2005-2020 Dynare Team | |
14 | 13 | % |
15 | 14 | % This file is part of Dynare. |
16 | 15 | % |
27 | 26 | % You should have received a copy of the GNU General Public License |
28 | 27 | % along with Dynare. If not, see <http://www.gnu.org/licenses/>. |
29 | 28 | |
30 | if ~noprint | |
31 | switch info(1) | |
32 | case 0 | |
33 | message = ''; | |
34 | case 1 | |
35 | message = 'The model doesn''t determine the current variable uniquely.'; | |
36 | case 2 | |
37 | message = sprintf('The generalized Schur (QZ) decomposition failed. For more information, see the documentation for Lapack function dgges: info=%d, n=%d. You can also run model_diagnostics to get more information on what may cause this problem.', info(2), info(3)); | |
38 | case 3 | |
39 | message = 'Blanchard & Kahn conditions are not satisfied: no stable equilibrium.'; | |
40 | case 4 | |
41 | message = 'Blanchard & Kahn conditions are not satisfied: indeterminacy.'; | |
42 | case 5 | |
43 | message = 'Blanchard & Kahn conditions are not satisfied: indeterminacy due to rank failure.'; | |
44 | case 6 | |
45 | message = 'The Jacobian matrix evaluated at the steady state contains elements that are not real or are infinite.'; | |
46 | case 7 | |
47 | message = sprintf('One of the eigenvalues is close to 0/0 (the absolute value of numerator and denominator is smaller than %5.4f!\n If you believe that the model has a unique solution you can try to reduce the value of qz_zero_threshold.',DynareOptions.qz_zero_threshold); | |
48 | case 8 | |
49 | if size(info,2)>=2 | |
50 | global M_; | |
51 | disp_string = M_.param_names{info(2)}; | |
52 | for ii=1:length(info)-2 | |
53 | disp_string = [disp_string, ', ', M_.param_names{info(2+ii)}]; | |
54 | end | |
55 | message = ['The Jacobian contains NaNs because the following parameters are NaN: ' disp_string]; | |
56 | else | |
57 | message = 'The Jacobian contains NaNs. For more information, use options_.debug.'; | |
29 | switch info(1) | |
30 | case 0 | |
31 | message = ''; | |
32 | case 1 | |
33 | message = 'The model doesn''t determine the current variable uniquely.'; | |
34 | case 2 | |
35 | message = sprintf('The generalized Schur (QZ) decomposition failed. For more information, see the documentation for Lapack function dgges: info=%d, n=%d. You can also run model_diagnostics to get more information on what may cause this problem.', info(2), info(3)); | |
36 | case 3 | |
37 | message = 'Blanchard & Kahn conditions are not satisfied: no stable equilibrium.'; | |
38 | case 4 | |
39 | message = 'Blanchard & Kahn conditions are not satisfied: indeterminacy.'; | |
40 | case 5 | |
41 | message = 'Blanchard & Kahn conditions are not satisfied: indeterminacy due to rank failure.'; | |
42 | case 6 | |
43 | message = 'The Jacobian matrix evaluated at the steady state contains elements that are not real or are infinite.'; | |
44 | case 7 | |
45 | message = sprintf('One of the eigenvalues is close to 0/0 (the absolute value of numerator and denominator is smaller than %5.4f!\n If you believe that the model has a unique solution you can try to reduce the value of qz_zero_threshold.',DynareOptions.qz_zero_threshold); | |
46 | case 8 | |
47 | if size(info,2)>=2 | |
48 | global M_; | |
49 | disp_string = M_.param_names{info(2)}; | |
50 | for ii=1:length(info)-2 | |
51 | disp_string = [disp_string, ', ', M_.param_names{info(2+ii)}]; | |
58 | 52 | end |
59 | case 9 | |
60 | message = 'k_order_pert was unable to compute the solution'; | |
61 | case 10 | |
62 | message = 'The Jacobian of the dynamic model contains Inf. For more information, use options_.debug.'; | |
63 | case 11 | |
64 | message = 'The Hessian of the dynamic model used for second order solutions must not contain Inf'; | |
65 | case 12 | |
66 | message = 'The Hessian of the dynamic model used for second order solutions must not contain NaN'; | |
67 | case 19 | |
68 | message = 'The steadystate file did not compute the steady state'; | |
69 | case 20 | |
70 | if DynareOptions.linear | |
71 | message = sprintf('Impossible to find the steady state (the sum of square residuals of the static equations is %5.4f). Either the model doesn''t have a steady state or there are an infinity of steady states Check whether your model is truly linear or whether there is a mistake in linearization.', info(2)); | |
72 | else | |
73 | message = sprintf('Impossible to find the steady state (the sum of square residuals of the static equations is %5.4f). Either the model doesn''t have a steady state, there are an infinity of steady states, or the guess values are too far from the solution', info(2)); | |
74 | end | |
75 | case 21 | |
76 | message = sprintf('The steady state is complex (the sum of square residuals of imaginary parts of the steady state is %5.4f)', info(2)); | |
77 | case 22 | |
78 | message = 'The steady state has NaNs or Inf.'; | |
79 | case 23 | |
80 | message = 'Parameters have been updated in the steadystate routine and some have complex values.'; | |
81 | case 24 | |
82 | message = 'Parameters have been updated in the steadystate routine and some are NaNs or Inf.'; | |
83 | case 25 | |
84 | message = 'The solution to the static equations is not a steady state of the dynamic model: verify that the equations tagged by [static] and [dynamic] are consistent'; | |
85 | case 26 | |
86 | message = 'The loglinearization of the model cannot be performed, because the steady state is not strictly positive.'; | |
87 | case 30 | |
88 | message = 'Ergodic variance can''t be computed.'; | |
89 | case 41 | |
90 | message = 'one (many) parameter(s) do(es) not satisfy the lower bound'; | |
91 | case 42 | |
92 | message = 'one (many) parameter(s) do(es) not satisfy the upper bound'; | |
93 | case 43 | |
94 | message = 'Covariance matrix of structural shocks is not positive definite'; | |
95 | case 44 %DsgeLikelihood_hh / dsge_likelihood | |
96 | message = 'The covariance matrix of the measurement errors is not positive definite.'; | |
97 | case 45 %DsgeLikelihood_hh / dsge_likelihood | |
98 | message = 'Likelihood is not a number (NaN) or a complex number'; | |
99 | case 46 %DsgeLikelihood_hh / dsge_likelihood | |
100 | message = 'Likelihood is a complex number'; | |
101 | case 47 %DsgeLikelihood_hh / dsge_likelihood | |
102 | message = 'Prior density is not a number (NaN)'; | |
103 | case 48 %DsgeLikelihood_hh / dsge_likelihood | |
104 | message = 'Prior density is a complex number'; | |
105 | case 49 | |
106 | message = 'The model violates one (many) endogenous prior restriction(s)'; | |
107 | case 50 | |
108 | message = 'Likelihood is Inf'; | |
109 | case 51 | |
110 | message = sprintf('\n The dsge_prior_weight is dsge_var=%5.4f, but must be at least %5.4f for the prior to be proper.\n You are estimating a DSGE-VAR model, but the value of the dsge prior weight is too low!', info(2), info(3)); | |
111 | case 52 %dsge_var_likelihood | |
112 | message = 'You are estimating a DSGE-VAR model, but the implied covariance matrix of the VAR''s innovations, based on artificial and actual sample is not positive definite!'; | |
113 | case 53 %dsge_var_likelihood | |
114 | message = 'You are estimating a DSGE-VAR model, but the implied covariance matrix of the VAR''s innovations, based on the artificial sample, is not positive definite!'; | |
115 | case 55 | |
116 | message = 'Fast Kalman filter only works with stationary models [lik_init=1] or stationary observables for non-stationary models [lik_init=3]'; | |
117 | case 61 %Discretionary policy | |
118 | message = 'Discretionary policy: maximum number of iterations has been reached. Procedure failed.'; | |
119 | case 62 | |
120 | message = 'Discretionary policy: some eigenvalues greater than options_.qz_criterium. Model potentially unstable.'; | |
121 | case 63 | |
122 | message = 'Discretionary policy: NaN elements are present in the solution. Procedure failed.'; | |
123 | case 64 | |
124 | message = 'discretionary_policy: the derivatives of the objective function contain NaN.'; | |
125 | case 65 | |
126 | message = 'discretionary_policy: the model must be written in deviation form and not have constant terms.'; | |
127 | case 66 | |
128 | message = 'discretionary_policy: the objective function must have zero first order derivatives.'; | |
129 | case 71 | |
130 | message = 'Calibrated covariance of the structural errors implies correlation larger than +-1.'; | |
131 | case 72 | |
132 | message = 'Calibrated covariance of the measurement errors implies correlation larger than +-1.'; | |
133 | % Aim Code Conversions by convertAimCodeToInfo.m | |
134 | case 81 | |
135 | message = ['Ramsey: The solution to the static first order conditions for optimal policy could not be found. Either the model' ... | |
136 | ' doesn''t have a steady state, there are an infinity of steady states, ' ... | |
137 | ' or the guess values are too far from the solution']; | |
138 | case 82 | |
139 | message = 'Ramsey: The steady state computation resulted in NaN in the static first order conditions for optimal policy'; | |
140 | case 83 | |
141 | message = 'Ramsey: The steady state computation resulted in NaN in the auxiliary equations for optimal policy'; | |
142 | case 84 | |
143 | message = 'Ramsey: The steady state file computation for the Ramsey problem resulted in NaNs at the initial values of the instruments'; | |
144 | case 85 | |
145 | message = 'Ramsey: The steady state file does not solve the static first order conditions conditional on the instruments.'; | |
146 | case 86 | |
147 | message = 'Ramsey: The steady state file provides complex numbers conditional on the instruments.'; | |
148 | case 87 | |
149 | message = 'Ramsey: The maximum number of iterations has been reached. Try increasing maxit.'; | |
150 | case 102 | |
151 | message = 'Aim: roots not correctly computed by real_schur'; | |
152 | case 103 | |
153 | message = 'Aim: too many explosive roots: no stable equilibrium'; | |
154 | case 135 | |
155 | message = 'Aim: too many explosive roots, and q(:,right) is singular'; | |
156 | case 104 | |
157 | message = 'Aim: too few explosive roots: indeterminacy'; | |
158 | case 145 | |
159 | message = 'Aim: too few explosive roots, and q(:,right) is singular'; | |
160 | case 105 | |
161 | message = 'Aim: q(:,right) is singular'; | |
162 | case 161 | |
163 | message = 'Aim: too many exact shiftrights'; | |
164 | case 162 | |
165 | message = 'Aim: too many numeric shiftrights'; | |
166 | case 163 | |
167 | message = 'Aim: A is NAN or INF.'; | |
168 | case 164 | |
169 | message = 'Aim: Problem in SPEIG.'; | |
170 | otherwise | |
171 | message = 'This case shouldn''t happen. Contact the authors of Dynare'; | |
172 | end | |
53 | message = ['The Jacobian contains NaNs because the following parameters are NaN: ' disp_string]; | |
54 | else | |
55 | message = 'The Jacobian contains NaNs. For more information, use options_.debug.'; | |
56 | end | |
57 | case 9 | |
58 | message = 'k_order_pert was unable to compute the solution'; | |
59 | case 10 | |
60 | message = 'The Jacobian of the dynamic model contains Inf. For more information, use options_.debug.'; | |
61 | case 11 | |
62 | message = 'The Hessian of the dynamic model used for second order solutions must not contain Inf'; | |
63 | case 12 | |
64 | message = 'The Hessian of the dynamic model used for second order solutions must not contain NaN'; | |
65 | case 19 | |
66 | message = 'The steadystate file did not compute the steady state'; | |
67 | case 20 | |
68 | if DynareOptions.linear | |
69 | message = sprintf('Impossible to find the steady state (the sum of square residuals of the static equations is %5.4f). Either the model doesn''t have a steady state or there are an infinity of steady states Check whether your model is truly linear or whether there is a mistake in linearization.', info(2)); | |
70 | else | |
71 | message = sprintf('Impossible to find the steady state (the sum of square residuals of the static equations is %5.4f). Either the model doesn''t have a steady state, there are an infinity of steady states, or the guess values are too far from the solution', info(2)); | |
72 | end | |
73 | case 21 | |
74 | message = sprintf('The steady state is complex (the sum of square residuals of imaginary parts of the steady state is %5.4f)', info(2)); | |
75 | case 22 | |
76 | message = 'The steady state has NaNs or Inf.'; | |
77 | case 23 | |
78 | message = 'Parameters have been updated in the steadystate routine and some have complex values.'; | |
79 | case 24 | |
80 | message = 'Parameters have been updated in the steadystate routine and some are NaNs or Inf.'; | |
81 | case 25 | |
82 | message = 'The solution to the static equations is not a steady state of the dynamic model: verify that the equations tagged by [static] and [dynamic] are consistent'; | |
83 | case 26 | |
84 | message = 'The loglinearization of the model cannot be performed, because the steady state is not strictly positive.'; | |
85 | case 30 | |
86 | message = 'Ergodic variance can''t be computed.'; | |
87 | case 41 | |
88 | message = 'one (many) parameter(s) do(es) not satisfy the lower bound'; | |
89 | case 42 | |
90 | message = 'one (many) parameter(s) do(es) not satisfy the upper bound'; | |
91 | case 43 | |
92 | message = 'Covariance matrix of structural shocks is not positive definite'; | |
93 | case 44 %DsgeLikelihood_hh / dsge_likelihood | |
94 | message = 'The covariance matrix of the measurement errors is not positive definite.'; | |
95 | case 45 %DsgeLikelihood_hh / dsge_likelihood | |
96 | message = 'Likelihood is not a number (NaN) or a complex number'; | |
97 | case 46 %DsgeLikelihood_hh / dsge_likelihood | |
98 | message = 'Likelihood is a complex number'; | |
99 | case 47 %DsgeLikelihood_hh / dsge_likelihood | |
100 | message = 'Prior density is not a number (NaN)'; | |
101 | case 48 %DsgeLikelihood_hh / dsge_likelihood | |
102 | message = 'Prior density is a complex number'; | |
103 | case 49 | |
104 | message = 'The model violates one (many) endogenous prior restriction(s)'; | |
105 | case 50 | |
106 | message = 'Likelihood is Inf'; | |
107 | case 51 | |
108 | message = sprintf('\n The dsge_prior_weight is dsge_var=%5.4f, but must be at least %5.4f for the prior to be proper.\n You are estimating a DSGE-VAR model, but the value of the dsge prior weight is too low!', info(2), info(3)); | |
109 | case 52 %dsge_var_likelihood | |
110 | message = 'You are estimating a DSGE-VAR model, but the implied covariance matrix of the VAR''s innovations, based on artificial and actual sample is not positive definite!'; | |
111 | case 53 %dsge_var_likelihood | |
112 | message = 'You are estimating a DSGE-VAR model, but the implied covariance matrix of the VAR''s innovations, based on the artificial sample, is not positive definite!'; | |
113 | case 55 | |
114 | message = 'Fast Kalman filter only works with stationary models [lik_init=1] or stationary observables for non-stationary models [lik_init=3]'; | |
115 | case 61 %Discretionary policy | |
116 | message = 'Discretionary policy: maximum number of iterations has been reached. Procedure failed.'; | |
117 | case 62 | |
118 | message = 'Discretionary policy: some eigenvalues greater than options_.qz_criterium. Model potentially unstable.'; | |
119 | case 63 | |
120 | message = 'Discretionary policy: NaN elements are present in the solution. Procedure failed.'; | |
121 | case 64 | |
122 | message = 'discretionary_policy: the derivatives of the objective function contain NaN.'; | |
123 | case 65 | |
124 | message = 'discretionary_policy: the model must be written in deviation form and not have constant terms.'; | |
125 | case 66 | |
126 | message = 'discretionary_policy: the objective function must have zero first order derivatives.'; | |
127 | case 71 | |
128 | message = 'Calibrated covariance of the structural errors implies correlation larger than +-1.'; | |
129 | case 72 | |
130 | message = 'Calibrated covariance of the measurement errors implies correlation larger than +-1.'; | |
131 | % Aim Code Conversions by convertAimCodeToInfo.m | |
132 | case 81 | |
133 | message = ['Ramsey: The solution to the static first order conditions for optimal policy could not be found. Either the model' ... | |
134 | ' doesn''t have a steady state, there are an infinity of steady states, ' ... | |
135 | ' or the guess values are too far from the solution']; | |
136 | case 82 | |
137 | message = 'Ramsey: The steady state computation resulted in NaN in the static first order conditions for optimal policy'; | |
138 | case 83 | |
139 | message = 'Ramsey: The steady state computation resulted in NaN in the auxiliary equations for optimal policy'; | |
140 | case 84 | |
141 | message = 'Ramsey: The steady state file computation for the Ramsey problem resulted in NaNs at the initial values of the instruments'; | |
142 | case 85 | |
143 | message = 'Ramsey: The steady state file does not solve the static first order conditions conditional on the instruments.'; | |
144 | case 86 | |
145 | message = 'Ramsey: The steady state file provides complex numbers conditional on the instruments.'; | |
146 | case 87 | |
147 | message = 'Ramsey: The maximum number of iterations has been reached. Try increasing maxit.'; | |
148 | case 102 | |
149 | message = 'Aim: roots not correctly computed by real_schur'; | |
150 | case 103 | |
151 | message = 'Aim: too many explosive roots: no stable equilibrium'; | |
152 | case 135 | |
153 | message = 'Aim: too many explosive roots, and q(:,right) is singular'; | |
154 | case 104 | |
155 | message = 'Aim: too few explosive roots: indeterminacy'; | |
156 | case 145 | |
157 | message = 'Aim: too few explosive roots, and q(:,right) is singular'; | |
158 | case 105 | |
159 | message = 'Aim: q(:,right) is singular'; | |
160 | case 161 | |
161 | message = 'Aim: too many exact shiftrights'; | |
162 | case 162 | |
163 | message = 'Aim: too many numeric shiftrights'; | |
164 | case 163 | |
165 | message = 'Aim: A is NAN or INF.'; | |
166 | case 164 | |
167 | message = 'Aim: Problem in SPEIG.'; | |
168 | otherwise | |
169 | message = 'This case shouldn''t happen. Contact the authors of Dynare'; | |
173 | 170 | end⏎ |
92 | 92 | oo_.exo_det_steady_state = []; |
93 | 93 | oo_.exo_det_simul = []; |
94 | 94 | |
95 | oo_.gui.ran_estimation = false; | |
96 | oo_.gui.ran_stoch_simul = false; | |
97 | oo_.gui.ran_calib_smoother = false; | |
98 | oo_.gui.ran_perfect_foresight = false; | |
99 | oo_.gui.ran_shock_decomposition = false; | |
100 | oo_.gui.ran_realtime_shock_decomposition = false; | |
101 | ||
95 | 102 | M_.params = []; |
96 | 103 | M_.endo_histval = []; |
97 | 104 | M_.exo_histval = []; |
282 | 282 | end |
283 | 283 | analytic_derivation = options_.analytic_derivation; |
284 | 284 | options_.analytic_derivation = -2; %this sets asy_Hess=1 in dsge_likelihood.m |
285 | [info, oo_, options_] = stoch_simul(M_, options_, oo_, options_.varobs); | |
285 | [info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, options_.varobs); | |
286 | 286 | dataset_ = dseries(oo_.endo_simul(options_.varobs_id,100+1:end)',dates('1Q1'), options_.varobs); %get information on moments |
287 | 287 | derivatives_info.no_DLIK = 1; |
288 | 288 | bounds = prior_bounds(bayestopt_, options_.prior_trunc); %reset bounds as lb and ub must only be operational during mode-finding |
70 | 70 | |
71 | 71 | % check if ys is steady state |
72 | 72 | options.debug=1; %locally set debug option to 1 |
73 | [dr.ys,params,check1]=evaluate_steady_state(oo.steady_state,M,options,oo,1); | |
73 | [dr.ys,M.params,check1]=evaluate_steady_state(oo.steady_state,M,options,oo,options.steadystate.nocheck); | |
74 | 74 | |
75 | 75 | % testing for problem |
76 | 76 | if check1(1) |
61 | 61 | end |
62 | 62 | osr_res = osr1(i_params,i_var,W); |
63 | 63 | |
64 | [~, oo_, options_] = stoch_simul(M_, options_, oo_, var_list); | |
64 | [~, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list); |
10 | 10 | % None |
11 | 11 | % |
12 | 12 | % |
13 | % Copyright (C) 2009-2017 Dynare Team | |
13 | % Copyright (C) 2009-2020 Dynare Team | |
14 | 14 | % |
15 | 15 | % This file is part of Dynare. |
16 | 16 | % |
27 | 27 | % You should have received a copy of the GNU General Public License |
28 | 28 | % along with Dynare. If not, see <http://www.gnu.org/licenses/>. |
29 | 29 | |
30 | if nargin ==0 | |
31 | disp('dynareParallelDelete(fname)') | |
30 | if nargin ~= 3 | |
31 | disp('dynareParallelDelete(fname,pname,Parallel)') | |
32 | 32 | return |
33 | 33 | end |
34 | 34 | |
35 | if nargin ==1 | |
36 | pname=''; | |
37 | else | |
35 | if ~isempty(pname) | |
38 | 36 | pname=[pname,filesep]; |
39 | 37 | end |
40 | 38 | |
41 | 39 | for indPC=1:length(Parallel) |
42 | 40 | if ~ispc || strcmpi('unix',Parallel(indPC).OperatingSystem) |
43 | 41 | if ~isempty(Parallel(indPC).Port) |
44 | ssh_token = ['-p ',Parallel(indPC).Port]; | |
42 | ssh_token = ['-p ',Parallel(indPC).Port ' ']; | |
45 | 43 | else |
46 | ssh_token = ''; | |
44 | ssh_token = ' '; | |
47 | 45 | end |
48 | [NonServeS NonServeD]=system(['ssh ',ssh_token,' ',Parallel(indPC).UserName,'@',Parallel(indPC).ComputerName,' rm -f ',Parallel(indPC).RemoteDirectory,'/',pname,fname]); | |
46 | username = Parallel(indPC).UserName; | |
47 | if ~isempty(username) | |
48 | username = [username '@']; | |
49 | end | |
50 | directory = Parallel(indPC).RemoteDirectory; | |
51 | if ~isempty(directory) | |
52 | directory = [directory '/']; | |
53 | end | |
54 | [~, ~] = system(['ssh ',ssh_token,username,Parallel(indPC).ComputerName,' ''/bin/bash --norc -c "rm -f ',directory,pname,fname,'"''']); | |
49 | 55 | else |
50 | 56 | fname_temp=['\\',Parallel(indPC).ComputerName,'\',Parallel(indPC).RemoteDrive,'$\',Parallel(indPC).RemoteDirectory,'\',pname,fname]; |
51 | 57 | if exist(fname_temp,'file') |
11 | 11 | % SPECIAL REQUIREMENTS |
12 | 12 | % none |
13 | 13 | |
14 | % Copyright (C) 1996-2019 Dynare Team | |
14 | % Copyright (C) 1996-2020 Dynare Team | |
15 | 15 | % |
16 | 16 | % This file is part of Dynare. |
17 | 17 | % |
225 | 225 | |
226 | 226 | ts = dseries(transpose(oo_.endo_simul), initial_period, M_.endo_names); |
227 | 227 | assignin('base', 'Simulated_time_series', ts); |
228 | if oo_.deterministic_simulation.status | |
229 | oo_.gui.ran_perfect_foresight = true; | |
230 | end |
10 | 10 | % SPECIAL REQUIREMENTS |
11 | 11 | % none |
12 | 12 | |
13 | % Copyright (C) 2005-2019 Dynare Team | |
13 | % Copyright (C) 2005-2020 Dynare Team | |
14 | 14 | % |
15 | 15 | % This file is part of Dynare. |
16 | 16 | % |
26 | 26 | % |
27 | 27 | % You should have received a copy of the GNU General Public License |
28 | 28 | % along with Dynare. If not, see <http://www.gnu.org/licenses/>. |
29 | ||
30 | message = get_error_message(info, noprint, DynareOptions); | |
31 | error(message); | |
29 | if ~noprint | |
30 | message = get_error_message(info, DynareOptions); | |
31 | error(message); | |
32 | end⏎ |
18 | 18 | % See the comments in the posterior_sampler.m funtion. |
19 | 19 | |
20 | 20 | |
21 | % Copyright (C) 2005-2018 Dynare Team | |
21 | % Copyright (C) 2005-2020 Dynare Team | |
22 | 22 | % |
23 | 23 | % This file is part of Dynare. |
24 | 24 | % |
293 | 293 | % which files have to be copied to run remotely |
294 | 294 | NamFileInput(1,:) = {'',[M_.fname '.static.m']}; |
295 | 295 | NamFileInput(2,:) = {'',[M_.fname '.dynamic.m']}; |
296 | if M.set_auxiliary_variables | |
296 | if M_.set_auxiliary_variables | |
297 | 297 | NamFileInput(3,:) = {'',[M_.fname '.set_auxiliary_variables.m']}; |
298 | 298 | end |
299 | 299 | if options_.steadystate_flag |
38 | 38 | end |
39 | 39 | end |
40 | 40 | |
41 | [info, oo_, options_] = stoch_simul(M_, options_, oo_, var_list); | |
41 | [info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list); | |
42 | 42 | |
43 | 43 | oo_.steady_state = oo_.dr.ys; |
44 | 44 |
21 | 21 | % SPECIAL REQUIREMENTS |
22 | 22 | % none |
23 | 23 | |
24 | % Copyright (C) 2009-2019 Dynare Team | |
24 | % Copyright (C) 2009-2020 Dynare Team | |
25 | 25 | % |
26 | 26 | % This file is part of Dynare. |
27 | 27 | % |
356 | 356 | if forecast_ |
357 | 357 | oo_.realtime_forecast_shock_decomposition.pool = zfrcst; |
358 | 358 | end |
359 | oo_.gui.ran_realtime_shock_decomposition = true; | |
359 | 360 | |
360 | 361 | skipline() |
22 | 22 | % SPECIAL REQUIREMENTS |
23 | 23 | % none |
24 | 24 | |
25 | % Copyright (C) 2009-2019 Dynare Team | |
25 | % Copyright (C) 2009-2020 Dynare Team | |
26 | 26 | % |
27 | 27 | % This file is part of Dynare. |
28 | 28 | % |
140 | 140 | if ~options_.no_graph.shock_decomposition |
141 | 141 | oo_ = plot_shock_decomposition(M_,oo_,options_,varlist); |
142 | 142 | end |
143 | ||
144 | oo_.gui.ran_shock_decomposition = true; |
0 | function [info, oo_, options_] = stoch_simul(M_, options_, oo_, var_list) | |
0 | function [info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list) | |
1 | 1 | |
2 | 2 | % Copyright (C) 2001-2020 Dynare Team |
3 | 3 | % |
200 | 200 | |
201 | 201 | if options_.irf |
202 | 202 | var_listTeX = M_.endo_names_tex(i_var); |
203 | if ~options_.nograph | |
203 | if ~options_.nograph || (TeX && any(strcmp('eps',cellstr(options_.graph_format)))) | |
204 | 204 | if ~exist([M_.fname '/graphs'],'dir') |
205 | 205 | mkdir(M_.fname,'graphs'); |
206 | 206 | end |
392 | 392 | options_ = options_old; |
393 | 393 | % temporary fix waiting for local options |
394 | 394 | options_.partial_information = 0; |
395 | ||
396 | oo_.gui.ran_stoch_simul = true; |
725 | 725 | maintainer-clean-generic: |
726 | 726 | @echo "This command is intended for maintainers to use" |
727 | 727 | @echo "it deletes files that may require special tools to rebuild." |
728 | @HAVE_M2HTML_FALSE@clean-local: | |
728 | 729 | @HAVE_M2HTML_FALSE@html-local: |
729 | @HAVE_M2HTML_FALSE@clean-local: | |
730 | 730 | clean: clean-recursive |
731 | 731 | |
732 | 732 | clean-am: clean-generic clean-local mostlyclean-am |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for dynare 4.6.0. | |
2 | # Generated by GNU Autoconf 2.69 for dynare 4.6.1. | |
3 | 3 | # |
4 | 4 | # |
5 | 5 | # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. |
576 | 576 | # Identity of this package. |
577 | 577 | PACKAGE_NAME='dynare' |
578 | 578 | PACKAGE_TARNAME='dynare' |
579 | PACKAGE_VERSION='4.6.0' | |
580 | PACKAGE_STRING='dynare 4.6.0' | |
579 | PACKAGE_VERSION='4.6.1' | |
580 | PACKAGE_STRING='dynare 4.6.1' | |
581 | 581 | PACKAGE_BUGREPORT='' |
582 | 582 | PACKAGE_URL='' |
583 | 583 | |
1341 | 1341 | # Omit some internal or obsolete options to make the list less imposing. |
1342 | 1342 | # This message is too long to be a string in the A/UX 3.1 sh. |
1343 | 1343 | cat <<_ACEOF |
1344 | \`configure' configures dynare 4.6.0 to adapt to many kinds of systems. | |
1344 | \`configure' configures dynare 4.6.1 to adapt to many kinds of systems. | |
1345 | 1345 | |
1346 | 1346 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1347 | 1347 | |
1412 | 1412 | |
1413 | 1413 | if test -n "$ac_init_help"; then |
1414 | 1414 | case $ac_init_help in |
1415 | short | recursive ) echo "Configuration of dynare 4.6.0:";; | |
1415 | short | recursive ) echo "Configuration of dynare 4.6.1:";; | |
1416 | 1416 | esac |
1417 | 1417 | cat <<\_ACEOF |
1418 | 1418 | |
1522 | 1522 | test -n "$ac_init_help" && exit $ac_status |
1523 | 1523 | if $ac_init_version; then |
1524 | 1524 | cat <<\_ACEOF |
1525 | dynare configure 4.6.0 | |
1525 | dynare configure 4.6.1 | |
1526 | 1526 | generated by GNU Autoconf 2.69 |
1527 | 1527 | |
1528 | 1528 | Copyright (C) 2012 Free Software Foundation, Inc. |
1896 | 1896 | This file contains any messages produced by compilers while |
1897 | 1897 | running configure, to aid debugging if configure makes a mistake. |
1898 | 1898 | |
1899 | It was created by dynare $as_me 4.6.0, which was | |
1899 | It was created by dynare $as_me 4.6.1, which was | |
1900 | 1900 | generated by GNU Autoconf 2.69. Invocation command line was |
1901 | 1901 | |
1902 | 1902 | $ $0 $@ |
2760 | 2760 | |
2761 | 2761 | # Define the identity of the package. |
2762 | 2762 | PACKAGE='dynare' |
2763 | VERSION='4.6.0' | |
2763 | VERSION='4.6.1' | |
2764 | 2764 | |
2765 | 2765 | |
2766 | 2766 | cat >>confdefs.h <<_ACEOF |
9916 | 9916 | # report actual input values of CONFIG_FILES etc. instead of their |
9917 | 9917 | # values after options handling. |
9918 | 9918 | ac_log=" |
9919 | This file was extended by dynare $as_me 4.6.0, which was | |
9919 | This file was extended by dynare $as_me 4.6.1, which was | |
9920 | 9920 | generated by GNU Autoconf 2.69. Invocation command line was |
9921 | 9921 | |
9922 | 9922 | CONFIG_FILES = $CONFIG_FILES |
9973 | 9973 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
9974 | 9974 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
9975 | 9975 | ac_cs_version="\\ |
9976 | dynare config.status 4.6.0 | |
9976 | dynare config.status 4.6.1 | |
9977 | 9977 | configured by $0, generated by GNU Autoconf 2.69, |
9978 | 9978 | with options \\"\$ac_cs_config\\" |
9979 | 9979 |
17 | 17 | dnl along with Dynare. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | |
19 | 19 | AC_PREREQ([2.62]) |
20 | AC_INIT([dynare], [4.6.0]) | |
20 | AC_INIT([dynare], [4.6.1]) | |
21 | 21 | AC_CONFIG_SRCDIR([configure.ac]) |
22 | 22 | AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign]) |
23 | 23 |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for dynare 4.6.0. | |
2 | # Generated by GNU Autoconf 2.69 for dynare 4.6.1. | |
3 | 3 | # |
4 | 4 | # |
5 | 5 | # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. |
576 | 576 | # Identity of this package. |
577 | 577 | PACKAGE_NAME='dynare' |
578 | 578 | PACKAGE_TARNAME='dynare' |
579 | PACKAGE_VERSION='4.6.0' | |
580 | PACKAGE_STRING='dynare 4.6.0' | |
579 | PACKAGE_VERSION='4.6.1' | |
580 | PACKAGE_STRING='dynare 4.6.1' | |
581 | 581 | PACKAGE_BUGREPORT='' |
582 | 582 | PACKAGE_URL='' |
583 | 583 | |
1325 | 1325 | # Omit some internal or obsolete options to make the list less imposing. |
1326 | 1326 | # This message is too long to be a string in the A/UX 3.1 sh. |
1327 | 1327 | cat <<_ACEOF |
1328 | \`configure' configures dynare 4.6.0 to adapt to many kinds of systems. | |
1328 | \`configure' configures dynare 4.6.1 to adapt to many kinds of systems. | |
1329 | 1329 | |
1330 | 1330 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1331 | 1331 | |
1396 | 1396 | |
1397 | 1397 | if test -n "$ac_init_help"; then |
1398 | 1398 | case $ac_init_help in |
1399 | short | recursive ) echo "Configuration of dynare 4.6.0:";; | |
1399 | short | recursive ) echo "Configuration of dynare 4.6.1:";; | |
1400 | 1400 | esac |
1401 | 1401 | cat <<\_ACEOF |
1402 | 1402 | |
1502 | 1502 | test -n "$ac_init_help" && exit $ac_status |
1503 | 1503 | if $ac_init_version; then |
1504 | 1504 | cat <<\_ACEOF |
1505 | dynare configure 4.6.0 | |
1505 | dynare configure 4.6.1 | |
1506 | 1506 | generated by GNU Autoconf 2.69 |
1507 | 1507 | |
1508 | 1508 | Copyright (C) 2012 Free Software Foundation, Inc. |
1876 | 1876 | This file contains any messages produced by compilers while |
1877 | 1877 | running configure, to aid debugging if configure makes a mistake. |
1878 | 1878 | |
1879 | It was created by dynare $as_me 4.6.0, which was | |
1879 | It was created by dynare $as_me 4.6.1, which was | |
1880 | 1880 | generated by GNU Autoconf 2.69. Invocation command line was |
1881 | 1881 | |
1882 | 1882 | $ $0 $@ |
2740 | 2740 | |
2741 | 2741 | # Define the identity of the package. |
2742 | 2742 | PACKAGE='dynare' |
2743 | VERSION='4.6.0' | |
2743 | VERSION='4.6.1' | |
2744 | 2744 | |
2745 | 2745 | |
2746 | 2746 | cat >>confdefs.h <<_ACEOF |
9354 | 9354 | # report actual input values of CONFIG_FILES etc. instead of their |
9355 | 9355 | # values after options handling. |
9356 | 9356 | ac_log=" |
9357 | This file was extended by dynare $as_me 4.6.0, which was | |
9357 | This file was extended by dynare $as_me 4.6.1, which was | |
9358 | 9358 | generated by GNU Autoconf 2.69. Invocation command line was |
9359 | 9359 | |
9360 | 9360 | CONFIG_FILES = $CONFIG_FILES |
9411 | 9411 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
9412 | 9412 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
9413 | 9413 | ac_cs_version="\\ |
9414 | dynare config.status 4.6.0 | |
9414 | dynare config.status 4.6.1 | |
9415 | 9415 | configured by $0, generated by GNU Autoconf 2.69, |
9416 | 9416 | with options \\"\$ac_cs_config\\" |
9417 | 9417 |
17 | 17 | dnl along with Dynare. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | |
19 | 19 | AC_PREREQ([2.62]) |
20 | AC_INIT([dynare], [4.6.0]) | |
20 | AC_INIT([dynare], [4.6.1]) | |
21 | 21 | AC_CONFIG_SRCDIR([configure.ac]) |
22 | 22 | AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign]) |
23 | 23 |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for dynare-preprocessor 4.6.0. | |
2 | # Generated by GNU Autoconf 2.69 for dynare-preprocessor 4.6.1. | |
3 | 3 | # |
4 | 4 | # |
5 | 5 | # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. |
576 | 576 | # Identity of this package. |
577 | 577 | PACKAGE_NAME='dynare-preprocessor' |
578 | 578 | PACKAGE_TARNAME='dynare-preprocessor' |
579 | PACKAGE_VERSION='4.6.0' | |
580 | PACKAGE_STRING='dynare-preprocessor 4.6.0' | |
579 | PACKAGE_VERSION='4.6.1' | |
580 | PACKAGE_STRING='dynare-preprocessor 4.6.1' | |
581 | 581 | PACKAGE_BUGREPORT='' |
582 | 582 | PACKAGE_URL='' |
583 | 583 | |
1315 | 1315 | # Omit some internal or obsolete options to make the list less imposing. |
1316 | 1316 | # This message is too long to be a string in the A/UX 3.1 sh. |
1317 | 1317 | cat <<_ACEOF |
1318 | \`configure' configures dynare-preprocessor 4.6.0 to adapt to many kinds of systems. | |
1318 | \`configure' configures dynare-preprocessor 4.6.1 to adapt to many kinds of systems. | |
1319 | 1319 | |
1320 | 1320 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1321 | 1321 | |
1387 | 1387 | |
1388 | 1388 | if test -n "$ac_init_help"; then |
1389 | 1389 | case $ac_init_help in |
1390 | short | recursive ) echo "Configuration of dynare-preprocessor 4.6.0:";; | |
1390 | short | recursive ) echo "Configuration of dynare-preprocessor 4.6.1:";; | |
1391 | 1391 | esac |
1392 | 1392 | cat <<\_ACEOF |
1393 | 1393 | |
1494 | 1494 | test -n "$ac_init_help" && exit $ac_status |
1495 | 1495 | if $ac_init_version; then |
1496 | 1496 | cat <<\_ACEOF |
1497 | dynare-preprocessor configure 4.6.0 | |
1497 | dynare-preprocessor configure 4.6.1 | |
1498 | 1498 | generated by GNU Autoconf 2.69 |
1499 | 1499 | |
1500 | 1500 | Copyright (C) 2012 Free Software Foundation, Inc. |
1830 | 1830 | This file contains any messages produced by compilers while |
1831 | 1831 | running configure, to aid debugging if configure makes a mistake. |
1832 | 1832 | |
1833 | It was created by dynare-preprocessor $as_me 4.6.0, which was | |
1833 | It was created by dynare-preprocessor $as_me 4.6.1, which was | |
1834 | 1834 | generated by GNU Autoconf 2.69. Invocation command line was |
1835 | 1835 | |
1836 | 1836 | $ $0 $@ |
2694 | 2694 | |
2695 | 2695 | # Define the identity of the package. |
2696 | 2696 | PACKAGE='dynare-preprocessor' |
2697 | VERSION='4.6.0' | |
2697 | VERSION='4.6.1' | |
2698 | 2698 | |
2699 | 2699 | |
2700 | 2700 | cat >>confdefs.h <<_ACEOF |
8220 | 8220 | # report actual input values of CONFIG_FILES etc. instead of their |
8221 | 8221 | # values after options handling. |
8222 | 8222 | ac_log=" |
8223 | This file was extended by dynare-preprocessor $as_me 4.6.0, which was | |
8223 | This file was extended by dynare-preprocessor $as_me 4.6.1, which was | |
8224 | 8224 | generated by GNU Autoconf 2.69. Invocation command line was |
8225 | 8225 | |
8226 | 8226 | CONFIG_FILES = $CONFIG_FILES |
8277 | 8277 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
8278 | 8278 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
8279 | 8279 | ac_cs_version="\\ |
8280 | dynare-preprocessor config.status 4.6.0 | |
8280 | dynare-preprocessor config.status 4.6.1 | |
8281 | 8281 | configured by $0, generated by GNU Autoconf 2.69, |
8282 | 8282 | with options \\"\$ac_cs_config\\" |
8283 | 8283 |
17 | 17 | dnl along with Dynare. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | |
19 | 19 | AC_PREREQ([2.62]) |
20 | AC_INIT([dynare-preprocessor], [4.6.0]) | |
20 | AC_INIT([dynare-preprocessor], [4.6.1]) | |
21 | 21 | AC_CONFIG_AUX_DIR([build-aux]) |
22 | 22 | AC_CONFIG_SRCDIR([src/DynareMain.cc]) |
23 | 23 | AM_INIT_AUTOMAKE([1.11 -Wall -Wno-portability foreign no-dist-gzip dist-xz tar-pax]) |
667 | 667 | |
668 | 668 | options_list.writeOutput(output); |
669 | 669 | symbol_list.writeOutput("var_list_", output); |
670 | output << "[info, oo_, options_] = stoch_simul(M_, options_, oo_, var_list_);" << endl; | |
670 | output << "[info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list_);" << endl; | |
671 | 671 | } |
672 | 672 | |
673 | 673 | void |
1064 | 1064 | |
1065 | 1065 | options_list.writeOutput(output); |
1066 | 1066 | symbol_list.writeOutput("var_list_", output); |
1067 | output << "[info, oo_, options_] = discretionary_policy(M_, options_, oo_, var_list_);" << endl; | |
1067 | output << "[info, oo_, options_, M_] = discretionary_policy(M_, options_, oo_, var_list_);" << endl; | |
1068 | 1068 | } |
1069 | 1069 | |
1070 | 1070 | void |
4633 | 4633 | } |
4634 | 4634 | if (lhs.first == -1) |
4635 | 4635 | { |
4636 | cerr << "walkPacParameters: error obtaining LHS varibale." << endl; | |
4636 | cerr << "walkPacParameters: error obtaining LHS variable." << endl; | |
4637 | 4637 | exit(EXIT_FAILURE); |
4638 | 4638 | } |
4639 | 4639 | if (ec_params_and_vars.second.empty() || ar_params_and_vars.empty()) |
385 | 385 | — except substituting out variables which we know are constant (they |
386 | 386 | appear in an equation of the form: X = constant) |
387 | 387 | — except adl operators which we always want expanded |
388 | — except predetermined variables (which must be handled before the call to | |
389 | setLeadsLagsOrig(), see preprocessor#47) | |
388 | 390 | — except diff operators with a lead which have been expanded by |
389 | 391 | DataTree:AddDiff() |
390 | 392 | */ |
392 | 394 | dynamic_model.includeExcludeEquations(include_eqs, false); |
393 | 395 | dynamic_model.simplifyEquations(); |
394 | 396 | dynamic_model.substituteAdl(); |
397 | if (symbol_table.predeterminedNbr() > 0) | |
398 | dynamic_model.transformPredeterminedVariables(); | |
395 | 399 | dynamic_model.setLeadsLagsOrig(); |
396 | 400 | original_model = dynamic_model; |
397 | 401 | dynamic_model.expandEqTags(); |
500 | 504 | |
501 | 505 | dynamic_model.addEquationsForVar(); |
502 | 506 | |
503 | if (symbol_table.predeterminedNbr() > 0) | |
504 | dynamic_model.transformPredeterminedVariables(); | |
505 | ||
506 | 507 | // Create auxiliary vars for Expectation operator |
507 | 508 | dynamic_model.substituteExpectation(mod_file_struct.partial_information); |
508 | 509 |
0 | 0 | /* |
1 | * Copyright © 2003-2019 Dynare Team | |
1 | * Copyright © 2003-2020 Dynare Team | |
2 | 2 | * |
3 | 3 | * This file is part of Dynare. |
4 | 4 | * |
177 | 177 | unique_symbols.push_back(it); |
178 | 178 | else |
179 | 179 | warnings << "WARNING: In " << dynare_command << ": " << it |
180 | << " found more than once in symbol list. Removing all but first occurence." << endl; | |
180 | << " found more than once in symbol list. Removing all but first occurrence." << endl; | |
181 | 181 | symbols = unique_symbols; |
182 | 182 | } |
87 | 87 | |
88 | 88 | ;; Those keywords that makes the lexer enter the DYNARE_BLOCK start condition |
89 | 89 | ;; Also include "verbatim" in this list |
90 | (defvar dynare-blocks | |
91 | '("model" "steady_state_model" "initval" "endval" "histval" "shocks" | |
92 | "shock_groups" "init2shocks" "mshocks" "estimated_params" "epilogue" "priors" | |
93 | "estimated_params_init" "estimated_params_bounds" "osr_params_bounds" | |
94 | "observation_trends" "optim_weights" "homotopy_setup" | |
95 | "conditional_forecast_paths" "svar_identification" "moment_calibration" | |
96 | "irf_calibration" "ramsey_constraints" "restrictions" "generate_irfs" | |
97 | "verbatim") | |
98 | "Dynare block keywords.") | |
90 | ;; Needs to be enclosed within eval-when-compile, because this variable is | |
91 | ;; referenced in another eval-when-compile statement in dynare-calculate-indentation | |
92 | (eval-when-compile | |
93 | (defvar dynare-blocks | |
94 | '("model" "steady_state_model" "initval" "endval" "histval" "shocks" | |
95 | "shock_groups" "init2shocks" "mshocks" "estimated_params" "epilogue" "priors" | |
96 | "estimated_params_init" "estimated_params_bounds" "osr_params_bounds" | |
97 | "observation_trends" "optim_weights" "homotopy_setup" | |
98 | "conditional_forecast_paths" "svar_identification" "moment_calibration" | |
99 | "irf_calibration" "ramsey_constraints" "restrictions" "generate_irfs" | |
100 | "verbatim") | |
101 | "Dynare block keywords.")) | |
99 | 102 | |
100 | 103 | ;; Mathematical functions and operators used in model equations (see "hand_side" in Bison file) |
101 | 104 | (defvar dynare-functions |
228 | 231 | (add-to-list 'auto-mode-alist '("\\.mod$" . dynare-mode)) |
229 | 232 | |
230 | 233 | (provide 'dynare) |
234 | ||
235 | ;; The following line is for ELPA compatibility (in particular needed for Debian) | |
236 | ;;; dynare.el ends here |
99 | 99 | optimal_policy/Ramsey/ramsey_histval.mod \ |
100 | 100 | optimal_policy/Ramsey/Gali_commitment.mod \ |
101 | 101 | optimal_policy/RamseyConstraints/test1.mod \ |
102 | optimal_policy/Ramsey/Ramsey_Example_estimation.mod \ | |
102 | 103 | discretionary_policy/dennis_1.mod \ |
103 | 104 | discretionary_policy/dennis_1_estim.mod \ |
104 | 105 | discretionary_policy/Gali_discretion.mod \ |
112 | 113 | comments.mod \ |
113 | 114 | histval_sto.mod \ |
114 | 115 | histval_det.mod \ |
116 | histval_predetermined.mod \ | |
115 | 117 | auxiliary_variables/test1.mod \ |
116 | 118 | expectations/expectation.mod \ |
117 | 119 | expectations/expectation_ss.mod \ |
275 | 277 | ep/rbcii.mod \ |
276 | 278 | ep/linearmodel0.mod \ |
277 | 279 | ep/linearmodel1.mod \ |
280 | stochastic_simulations/example1_noprint.mod \ | |
278 | 281 | stochastic-backward-models/solow_cd.mod \ |
279 | 282 | stochastic-backward-models/solow_ces.mod \ |
280 | 283 | stochastic-backward-models/solow_cd_with_steadystate.mod \ |
364 | 364 | optimal_policy/Ramsey/ramsey_histval.mod \ |
365 | 365 | optimal_policy/Ramsey/Gali_commitment.mod \ |
366 | 366 | optimal_policy/RamseyConstraints/test1.mod \ |
367 | optimal_policy/Ramsey/Ramsey_Example_estimation.mod \ | |
367 | 368 | discretionary_policy/dennis_1.mod \ |
368 | 369 | discretionary_policy/dennis_1_estim.mod \ |
369 | 370 | discretionary_policy/Gali_discretion.mod \ |
377 | 378 | comments.mod \ |
378 | 379 | histval_sto.mod \ |
379 | 380 | histval_det.mod \ |
381 | histval_predetermined.mod \ | |
380 | 382 | auxiliary_variables/test1.mod \ |
381 | 383 | expectations/expectation.mod \ |
382 | 384 | expectations/expectation_ss.mod \ |
540 | 542 | ep/rbcii.mod \ |
541 | 543 | ep/linearmodel0.mod \ |
542 | 544 | ep/linearmodel1.mod \ |
545 | stochastic_simulations/example1_noprint.mod \ | |
543 | 546 | stochastic-backward-models/solow_cd.mod \ |
544 | 547 | stochastic-backward-models/solow_ces.mod \ |
545 | 548 | stochastic-backward-models/solow_cd_with_steadystate.mod \ |
0 | /* Check that histval and predetermined_variables interact correctly, in the | |
1 | case where no explicit lag appears in the model block (though lags appear | |
2 | implicitly via the “predetermined_variables” statement). | |
3 | ||
4 | This is a regression test for preprocessor#47. | |
5 | */ | |
6 | ||
7 | var y, c, k, a, h, b; | |
8 | varexo e, u; | |
9 | ||
10 | predetermined_variables a b k; | |
11 | ||
12 | parameters beta, rho, alpha, delta, theta, psi, tau; | |
13 | ||
14 | alpha = 0.36; | |
15 | rho = 0.95; | |
16 | tau = 0.025; | |
17 | beta = 0.99; | |
18 | delta = 0.025; | |
19 | psi = 0; | |
20 | theta = 2.95; | |
21 | ||
22 | phi = 0.1; | |
23 | ||
24 | model; | |
25 | c*theta*h^(1+psi)=(1-alpha)*y; | |
26 | k(+1) = beta*(((exp(b(+1))*c)/(exp(b(+2))*c(+1))) | |
27 | *(exp(b(+2))*alpha*y(+1)+(1-delta)*k(+1))); | |
28 | y = exp(a(+1))*(k^alpha)*(h^(1-alpha)); | |
29 | k = exp(b(+1))*(y-c)+(1-delta)*k; | |
30 | a(+1) = rho*a+ e; | |
31 | b(+1) = rho*b+ u; | |
32 | end; | |
33 | ||
34 | initval; | |
35 | y = 1.08068253095672; | |
36 | c = 0.80359242014163; | |
37 | h = 0.29175631001732; | |
38 | k = 11.08360443260358; | |
39 | a = 0; | |
40 | b = 0; | |
41 | e = 0; | |
42 | u = 0; | |
43 | end; | |
44 | ||
45 | shocks; | |
46 | var e; stderr 0.009; | |
47 | var u; stderr 0.009; | |
48 | var e, u = phi*0.009*0.009; | |
49 | end; | |
50 | ||
51 | histval; | |
52 | b(0) = 0.1; | |
53 | a(0) = 0.3; | |
54 | end; | |
55 | ||
56 | stoch_simul(nograph, periods = 200); | |
57 | ||
58 | forecast; | |
59 |
129 | 129 | |
130 | 130 | for par_iter=1:size(par.pdraws,1) |
131 | 131 | M_=set_parameters_locally(M_,par.pdraws{par_iter,1}); |
132 | [info, oo_, options_]=stoch_simul(M_, options_, oo_, var_list_); | |
132 | [info, oo_, options_, M_]=stoch_simul(M_, options_, oo_, var_list_); | |
133 | 133 | correlation(:,:,par_iter)=cell2mat(oo_.autocorr); |
134 | 134 | covariance(:,:,par_iter)=oo_.var; |
135 | 135 | conditional_variance_decomposition(:,:,:,par_iter)=oo_.conditional_variance_decomposition; |
0 | /* | |
1 | * This file replicates the model studied in: | |
2 | * Lawrence J. Christiano, Roberto Motto and Massimo Rostagno (2007): | |
3 | * "Notes on Ramsey-Optimal Monetary Policy", Section 2 | |
4 | * The paper is available at http://faculty.wcas.northwestern.edu/~lchrist/d16/d1606/ramsey.pdf | |
5 | * | |
6 | * Notes: | |
7 | * - This mod-files allows to simulate a simple New Keynesian Model with Rotemberg price | |
8 | * adjustment costs under three different monetary policy arrangements: | |
9 | * 1. a Taylor rule with a fixed inflation feedback coefficient alpha | |
10 | * -> set the Optimal_policy switch to 0 | |
11 | * 2. a Taylor rule where the inflation feedback coefficient alpha is chosen | |
12 | * optimally to minimize a quadratic loss function (optimal simple rule (OSR)) | |
13 | * -> set the Optimal_policy switch to 1 and the Ramsey switch to 0 | |
14 | * 3. fully optimal monetary under commitment (Ramsey) | |
15 | * -> set the Optimal_policy switch to 1 and the Ramsey switch to 1 | |
16 | * | |
17 | * - The Efficent_steady_state switch can be used to switch from an distorted steady state | |
18 | * due to a monopolistic distortion to one where a labor subsidy counteracts this | |
19 | * distortion. Note that the purely quadratic loss function in the OSR case does not capture | |
20 | * the full welfare losses with a distorted steady state as there would be a linear term | |
21 | * appearing. | |
22 | * | |
23 | * - This files shows how to use a conditional steady state file in the Ramsey case. It takes | |
24 | * the value of the defined instrument R as given and then computes the rest of the steady | |
25 | * state, including the steady state inflation rate, based on this value. The initial value | |
26 | * of the instrument for steady state search must then be defined in an initval-block. | |
27 | * | |
28 | * - The optim_weights in the OSR case are based on a second order approximation to the welfare function | |
29 | * as in Gali (2015). The relative weight between inflation and output gap volatility is essentially | |
30 | * given by the slope of the New Keynesian Phillips Curve. Note that the linear terms that would be | |
31 | * present in case of a distorted steady state need to be dropped for OSR. | |
32 | * | |
33 | * - Due to divine coincidence, the first best policy involves fully stabilizing inflation | |
34 | * and thereby the output gap. As a consequence, the optimal inflation feedback coefficient | |
35 | * in a Taylor rule would be infinity. The OSR command therefore estimates it to be at the | |
36 | * upper bound defined via osr_params_bounds. | |
37 | * | |
38 | * - The mod-file also allows to conduct estimation under Ramsey policy by setting the | |
39 | * Estimation_under_Ramsey switch to 1. | |
40 | * | |
41 | * This implementation was written by Johannes Pfeifer. | |
42 | * | |
43 | * If you spot mistakes, email me at jpfeifer@gmx.de | |
44 | * | |
45 | * Please note that the following copyright notice only applies to this Dynare | |
46 | * implementation of the model. | |
47 | */ | |
48 | ||
49 | /* | |
50 | * Copyright (C) 2019 Dynare Team | |
51 | * | |
52 | * This is free software: you can redistribute it and/or modify | |
53 | * it under the terms of the GNU General Public License as published by | |
54 | * the Free Software Foundation, either version 3 of the License, or | |
55 | * (at your option) any later version. | |
56 | * | |
57 | * It is distributed in the hope that it will be useful, | |
58 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
59 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
60 | * GNU General Public License for more details. | |
61 | * | |
62 | * For a copy of the GNU General Public License, | |
63 | * see <http://www.gnu.org/licenses/>. | |
64 | */ | |
65 | ||
66 | //**********Define which monetary policy setup to use *********** | |
67 | ||
68 | @#ifndef Optimal_policy | |
69 | @#define Optimal_policy=1 | |
70 | @#ifndef Ramsey | |
71 | @#define Ramsey=1 | |
72 | @#endif | |
73 | @#endif | |
74 | ||
75 | //**********Define whether to use distorted steady state*********** | |
76 | ||
77 | @#ifndef Efficent_steady_state | |
78 | @#define Efficent_steady_state=0 | |
79 | @#endif | |
80 | ||
81 | @#ifndef Estimation_under_Ramsey | |
82 | @#define Estimation_under_Ramsey=1 | |
83 | @#endif | |
84 | ||
85 | var C $C$ (long_name='Consumption') | |
86 | pi $\pi$ (long_name='Gross inflation') | |
87 | h $h$ (long_name='hours worked') | |
88 | Z $Z$ (long_name='TFP') | |
89 | R $R$ (long_name='Net nominal interest rate') | |
90 | log_C ${\ln C}$ (long_name='Log Consumption') | |
91 | log_h ${\ln h}$ (long_name='Log hours worked') | |
92 | pi_ann ${\pi^{ann}}$ (long_name='Annualized net inflation') | |
93 | R_ann ${R^{ann}}$ (long_name='Annualized net nominal interest rate') | |
94 | r_real ${r^{ann,real}}$ (long_name='Annualized net real interest rate') | |
95 | y_nat ${y^{nat}}$ (long_name='Natural (flex price) output') | |
96 | y_gap ${r^{gap}}$ (long_name='Output gap') | |
97 | ; | |
98 | ||
99 | varexo epsilon ${\varepsilon}$ (long_name='TFP shock') | |
100 | ; | |
101 | ||
102 | parameters beta ${\beta}$ (long_name='discount factor') | |
103 | theta ${\theta}$ (long_name='substitution elasticity') | |
104 | tau ${\tau}$ (long_name='labor subsidy') | |
105 | chi ${\chi}$ (long_name='labor disutility') | |
106 | phi ${\phi}$ (long_name='price adjustment costs') | |
107 | rho ${\rho}$ (long_name='TFP autocorrelation') | |
108 | @# if !defined(Ramsey) || Ramsey==0 | |
109 | pi_star ${\pi^*}$ (long_name='steady state inflation') | |
110 | alpha ${\alpha}$ (long_name='inflation feedback Taylor rule') | |
111 | @# endif | |
112 | ; | |
113 | ||
114 | beta=0.99; | |
115 | theta=5; | |
116 | phi=100; | |
117 | rho=0.9; | |
118 | @# if !defined(Ramsey) || Ramsey==0 | |
119 | alpha=1.5; | |
120 | pi_star=1; | |
121 | @# endif | |
122 | @# if Efficent_steady_state | |
123 | tau=1/(theta-1); | |
124 | @# else | |
125 | tau=0; | |
126 | @# endif | |
127 | chi=1; | |
128 | ||
129 | model; | |
130 | [name='Euler equation'] | |
131 | 1/(1+R)=beta*C/(C(+1)*pi(+1)); | |
132 | [name='Firm FOC'] | |
133 | (tau-1/(theta-1))*(1-theta)+theta*(chi*h*C/(exp(Z))-1)=phi*(pi-1)*pi-beta*phi*(pi(+1)-1)*pi(+1); | |
134 | [name='Resource constraint'] | |
135 | C*(1+phi/2*(pi-1)^2)=exp(Z)*h; | |
136 | [name='TFP process'] | |
137 | Z=rho*Z(-1)+epsilon; | |
138 | @#if !defined(Ramsey) || Ramsey==0 | |
139 | [name='Taylor rule'] | |
140 | R=pi_star/beta-1+alpha*(pi-pi_star); | |
141 | @#endif | |
142 | [name='Definition log consumption'] | |
143 | log_C=log(C); | |
144 | [name='Definition log hours worked'] | |
145 | log_h=log(h); | |
146 | [name='Definition annualized inflation rate'] | |
147 | pi_ann=4*log(pi); | |
148 | [name='Definition annualized nominal interest rate'] | |
149 | R_ann=4*R; | |
150 | [name='Definition annualized real interest rate'] | |
151 | r_real=4*log((1+R)/pi(+1)); | |
152 | [name='Definition natural output'] | |
153 | y_nat=exp(Z)*sqrt((theta-1)/theta*(1+tau)/chi); | |
154 | [name='output gap'] | |
155 | y_gap=log_C-log(y_nat); | |
156 | end; | |
157 | ||
158 | steady_state_model; | |
159 | Z=0; | |
160 | @# if !defined(Ramsey) || Ramsey==0 | |
161 | R=pi_star/beta-1; %only set this if not conditional steady state file for Ramsey | |
162 | @# endif | |
163 | pi=(R+1)*beta; | |
164 | C=sqrt((1+1/theta*((1-beta)*(pi-1)*pi-(tau-1/(theta-1))*(1-theta)))/(chi*(1+phi/2*(pi-1)^2))); | |
165 | h=C*(1+phi/2*(pi-1)^2); | |
166 | log_C=log(C); | |
167 | log_h=log(h); | |
168 | pi_ann=4*log(pi); | |
169 | R_ann=4*R; | |
170 | r_real=4*log((1+R)/pi); | |
171 | y_nat=sqrt((theta-1)/theta*(1+tau)/chi); | |
172 | y_gap=log_C-log(y_nat); | |
173 | end; | |
174 | ||
175 | @# if defined(Ramsey) && Ramsey==1 | |
176 | //define initial value of instrument for Ramsey | |
177 | initval; | |
178 | R=1/beta-1; | |
179 | end; | |
180 | @# endif | |
181 | ||
182 | shocks; | |
183 | var epsilon = 0.01^2; | |
184 | end; | |
185 | ||
186 | @#if Optimal_policy==0 | |
187 | //use Taylor rule | |
188 | stoch_simul(order=2) pi_ann log_h R_ann log_C Z r_real y_nat; | |
189 | @#else | |
190 | @# if !defined(Ramsey) || Ramsey==0 | |
191 | //use OSR Taylor rule | |
192 | ||
193 | //set weights on (co-)variances for OSR | |
194 | optim_weights; | |
195 | pi theta/((theta-1)/phi); | |
196 | y_gap 1; | |
197 | end; | |
198 | ||
199 | //define OSR parameters to be optimized | |
200 | osr_params alpha; | |
201 | ||
202 | //starting value for OSR parameter | |
203 | alpha = 1.5; | |
204 | ||
205 | //define bounds for OSR during optimization | |
206 | osr_params_bounds; | |
207 | alpha, 0, 100; | |
208 | end; | |
209 | ||
210 | //compute OSR and provide output | |
211 | osr(opt_algo=9) pi_ann log_h R_ann log_C Z r_real; | |
212 | ||
213 | @# else | |
214 | //use Ramsey optimal policy | |
215 | ||
216 | //define planner objective, which corresponds to utility function of agents | |
217 | planner_objective log(C)-chi/2*h^2; | |
218 | ||
219 | //set up Ramsey optimal policy problem with interest rate R as the instrument,... | |
220 | // defining the discount factor in the planner objective to be the one of private agents | |
221 | ramsey_model(instruments=(R),planner_discount=beta,planner_discount_latex_name=$\beta$); | |
222 | ||
223 | //conduct stochastic simulations of the Ramsey problem | |
224 | stoch_simul(order=1,irf=20,periods=500) pi_ann log_h R_ann log_C Z r_real; | |
225 | evaluate_planner_objective; | |
226 | ||
227 | @# if Estimation_under_Ramsey==1 | |
228 | datatomfile('ramsey_simulation',{'log_C'}) | |
229 | ||
230 | estimated_params; | |
231 | rho,0.5,uniform_pdf, , ,0,1; | |
232 | end; | |
233 | varobs log_C; | |
234 | ||
235 | estimation(datafile=ramsey_simulation,mode_compute=5,mh_nblocks=1,mh_replic=0); | |
236 | @# endif | |
237 | @# endif | |
238 | @# endif | |
239 | ||
240 | write_latex_static_model(write_equation_tags); | |
241 | write_latex_dynamic_model(write_equation_tags); | |
242 | write_latex_original_model(write_equation_tags); | |
243 | write_latex_steady_state_model; | |
244 | ||
245 | collect_latex_files; | |
246 | if system(['pdflatex -halt-on-error -interaction=batchmode ' M_.fname '_TeX_binder.tex']) | |
247 | error('TeX-File did not compile.') | |
248 | end⏎ |
0 | /* | |
1 | * Example 1 from F. Collard (2001): "Stochastic simulations with DYNARE: | |
2 | * A practical guide" (see "guide.pdf" in the documentation directory). | |
3 | */ | |
4 | ||
5 | /* | |
6 | * Copyright (C) 2001-2010 Dynare Team | |
7 | * | |
8 | * This file is part of Dynare. | |
9 | * | |
10 | * Dynare is free software: you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation, either version 3 of the License, or | |
13 | * (at your option) any later version. | |
14 | * | |
15 | * Dynare is distributed in the hope that it will be useful, | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | * GNU General Public License for more details. | |
19 | * | |
20 | * You should have received a copy of the GNU General Public License | |
21 | * along with Dynare. If not, see <http://www.gnu.org/licenses/>. | |
22 | */ | |
23 | ||
24 | ||
25 | var y, c, k, a, h, b; | |
26 | varexo e, u; | |
27 | ||
28 | parameters beta, rho, alpha, delta, theta, psi, tau; | |
29 | ||
30 | alpha = -0.36; // changed "0.36" to "-0.36" to generate an error | |
31 | rho = 0.95; | |
32 | tau = 0.025; | |
33 | beta = 0.99; | |
34 | delta = 0.025; | |
35 | psi = 0; | |
36 | theta = 2.95; | |
37 | ||
38 | phi = 0.1; | |
39 | ||
40 | model; | |
41 | c*theta*h^(1+psi)=(1-alpha)*y; | |
42 | k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1))) | |
43 | *(exp(b(+1))*alpha*y(+1)+(1-delta)*k)); | |
44 | y = exp(a)*(k(-1)^alpha)*(h^(1-alpha)); | |
45 | k = exp(b)*(y-c)+(1-delta)*k(-1); | |
46 | a = rho*a(-1)+tau*b(-1) + e; | |
47 | b = tau*a(-1)+rho*b(-1) + u; | |
48 | end; | |
49 | ||
50 | initval; | |
51 | y = 1.08068253095672; | |
52 | c = 0.80359242014163; | |
53 | h = 0.29175631001732; | |
54 | k = 11.08360443260358; | |
55 | a = 0; | |
56 | b = 0; | |
57 | e = 0; | |
58 | u = 0; | |
59 | end; | |
60 | ||
61 | shocks; | |
62 | var e; stderr 0.009; | |
63 | var u; stderr 0.009; | |
64 | var e, u = phi*0.009*0.009; | |
65 | end; | |
66 | ||
67 | stoch_simul(noprint); // added "noprint" |
4 | 4 | # The binaries are cross compiled for Windows (32/64bits), Octave and MATLAB |
5 | 5 | # (all supported versions). |
6 | 6 | |
7 | # Copyright © 2017-2019 Dynare Team | |
7 | # Copyright © 2017-2020 Dynare Team | |
8 | 8 | # |
9 | 9 | # This file is part of Dynare. |
10 | 10 | # |
269 | 269 | mkdir -p "$ZIPDIR"/scripts |
270 | 270 | cp -p scripts/dynare.el "$ZIPDIR"/scripts |
271 | 271 | mkdir "$ZIPDIR"/dynare++ |
272 | cp -pr dynare++/32-bit/ dynare++/64-bit/ "$ZIPDIR"/dynare++ | |
272 | cp -pr dynare++/32-bit/ dynare++/64-bit/ dynare++/dynare_simul/dynare_simul.m "$ZIPDIR"/dynare++ | |
273 | 273 | mkdir -p "$ZIPDIR"/doc/dynare++ |
274 | 274 | mkdir -p "$ZIPDIR"/doc/dynare-manual.html |
275 | 275 | cp -pr doc/manual/build/html/* "$ZIPDIR"/doc/dynare-manual.html |