Commit Graph

676 Commits (97fa005b3341f8b92392d407337083f3fde32b73)

Author SHA1 Message Date
Sébastien Villemot 97fa005b33
Use 1-based indexing in M_.nonzero_hessian_eqs 2019-12-13 22:31:49 +01:00
Sébastien Villemot 141cff0761
New field M_.endo_trends
For each endogenous variable, gives the deflator and the growth factor (as well
as the “log” versions).

Ref. dynare#1648
2019-12-13 18:02:37 +01:00
Sébastien Villemot 2af26ee2c2
Ramsey: use information from transformed model for filling M_.nonzero_hessian_eqs
Since commit 9c9e8f816f, it’s the information
from the original model which was in this field, which is not what is expected.

By the way, do not output this field (and the related M_.hessian_eq_zero) when
the Hessian is not computed by the preprocessor (i.e. in practice for perfect
foresight), since they would otherwise contain incorrect information.

Ref. dynare#1681
2019-12-13 18:02:35 +01:00
Houtan Bastani 2646f01424
fix quotes from 7958f76fae 2019-12-13 16:03:37 +01:00
Houtan Bastani fddfb7fe2f
Issue deprecation warning for `simul`
closes dynare#1683
2019-12-13 16:01:47 +01:00
Houtan Bastani c1b8cdf811
epilogue: simplify _static file
issue #36
2019-12-12 16:32:12 +01:00
Sébastien Villemot b58bbb8e84
Ramsey: do not warn if instruments are not defined in steady_state_model block
Closes: dynare#1677
2019-12-12 16:19:15 +01:00
Sébastien Villemot 047b397899
Simplify x+y-y in x
Note that this actually corresponds to 4 different abstract syntax trees:
— (x+y)-y
— (y+x)-y
— (x-y)+y
— y+(x-y)
2019-12-12 16:19:15 +01:00
Sébastien Villemot d747b53a8b
Simplify x*y/y in x
Note that this actually corresponds to 4 different abstract syntax trees:
— (x*y)/y
— (y*x)/y
— (x/y)*y
— y*(x/y)
2019-12-12 16:19:15 +01:00
Sébastien Villemot 50275f3588
Simplify x-(-y) in x+y 2019-12-12 16:19:15 +01:00
Sébastien Villemot f24f28b2b2
Simplify x/(1/y) in x*y 2019-12-12 16:19:15 +01:00
Sébastien Villemot 1d3265acb7
C++17: further code simplifications (assignments in if) 2019-12-12 16:19:14 +01:00
Houtan Bastani 44adcbb488
epilogue: replace `dseries__` with `ds` making the file easier to read 2019-12-12 14:46:45 +01:00
Houtan Bastani dfcd381d20
epilogue: fix bug with external functions in `epilogue` block
issue #36
2019-12-12 14:45:49 +01:00
Houtan Bastani 7958f76fae
issue deprecation warning for `ramsey_policy`
dynare#1678
2019-12-12 11:36:43 +01:00
Houtan Bastani 8dfa79a0f5
new command `evaluate_planner_objective`
dynare#1678
2019-12-12 11:35:26 +01:00
Houtan Bastani 5430bb4bc6
simplify for statement 2019-12-11 16:21:18 +01:00
Houtan Bastani 4111bc8cfc
epilogue: create _dynamic and _static files
#36
2019-12-11 16:17:54 +01:00
Houtan Bastani 34a41b557d
epilogue: output endogs used in epilogue equations
#36
2019-12-11 15:51:26 +01:00
Houtan Bastani 41d38551e5
write names of epilogue variables 2019-12-11 15:51:26 +01:00
Houtan Bastani 3694fc40b3
detrend epilogue equations 2019-12-11 14:45:47 +01:00
Houtan Bastani 8dc70602c8
macro processor: move evaluation of all arguments for unary, binary, and trinary ops into their switch cases 2019-12-10 16:33:32 +01:00
Houtan Bastani 952e899f3a
fix bug in macro processor ensuring short-circuit functionality of `||` and `&&` statements
closes dynare#1676
2019-12-10 16:30:11 +01:00
Sébastien Villemot 5c081db76f
Add option “colormap” to “initial_condition_decomposition” command.
Ref dynare#1586
2019-12-09 15:43:39 +01:00
Sébastien Villemot 8962a9d589
Windows: apply the workaround for +<basename> removal to +objective subfolder
Because MATLAB under Windows maintains a lock on the “+<basename>” subdirectory,
we use a workaround consisting in first renaming the directory, then deleting
it.

But this is not enough when the “ramsey_policy” command is used, because the
latter creates a “+objective” subfolder inside “+<basename>”, on which MATLAB
also maintains a lock.

The fix consists in recursively using the same workaround as for the top-level
directory: renaming before deleting.
2019-12-06 15:19:23 +01:00
Houtan Bastani 3f3ef7ca00
fix bugs in initial_condition_decomposition statement
closes #37
2019-12-06 10:40:44 +01:00
Houtan Bastani 2814f05a67
Add flag to compilation of flex file
Without this flag flex errors out because it hits a hard-coded size limit
2019-12-04 16:57:20 +01:00
Houtan Bastani 02cb4cc973
add compiler statement
Allows the user to set the compiler, flags, and libs to be used with `use_dll`

Issue #35
2019-12-04 16:57:20 +01:00
Houtan Bastani bf56d6fb82
fix LaTeX output for sqrt, exp, sin, cos, tan 2019-12-04 11:26:30 +01:00
Houtan Bastani 2db2133796
fix bugs with cbrt
- it was not handled in the model block
- output was incorrect for MATLAB/Octave and LaTeX
2019-12-04 11:10:19 +01:00
Houtan Bastani abbdbb5862
Clarify part of code 2019-12-03 16:42:38 +01:00
Sébastien Villemot 23ff36a0dd
Systematically compute recursive ordering of auxiliary equations
Auxiliary equations appearing in set_auxiliary_variables.m and
dynamic_set_auxiliary_series.m need to appear in recursive ordering, since
those files are used for sequential evaluation.

Previously, the recursive ordering was guaranteed by a set of ad hoc rules and
workarounds, but that would not cover certain edge cases.

With this commit, the recursive ordering is systematically computed, using a
topological sort on the directed acyclic graph whose vertices are auxiliary
equations and whose edges are dependency relationships.

Closes: #22
2019-12-03 14:26:13 +01:00
Houtan Bastani 4a1fb239da
Add interface for init2shocks
Dynare/dynare#1650
2019-12-02 13:58:44 +01:00
Houtan Bastani de3de15249
add nograph option to plot_shock_decomposition
closes #30
2019-11-29 14:58:42 +01:00
Dóra Kocsis f11048f2dc Pass oo_ as function input for plot_icforecast. Dynare/dynare#1672 2019-11-29 12:17:02 +01:00
Sébastien Villemot d008113d69
Forbid exogenous and exogenous deterministic variables in STEADY_STATE operator
Closes: dynare#825
2019-11-27 17:27:04 +01:00
Sébastien Villemot 61ea8811de
Remove the undocumented and confusing “linear” option of stoch_simul
Closes: #33
2019-11-27 15:08:56 +01:00
Dóra Kocsis dfb5a856c4 bugfix: forecast type option in shock_decomposition. 2019-11-26 18:29:12 +01:00
Sébastien Villemot 0573475891 Merge branch 'master' into 'master'
Master

See merge request Dynare/preprocessor!8
2019-11-26 17:08:03 +00:00
Dóra Kocsis 3e43b36cf3 Introduce forecast type option in shock_decomposition command. Dynare/dynare#1657 2019-11-26 17:49:12 +01:00
Dóra Kocsis c23e136f93 Revert "Merge branch 'master' into 'master'"
This reverts commit 3ae92499b8, reversing
changes made to 3ec01b8612.
2019-11-26 16:46:12 +01:00
Dóra Kocsis 28bfc72a5c Revert "Merge branch 'master' into 'master'"
This reverts commit a37fea0dfc, reversing
changes made to 3ae92499b8.
2019-11-26 16:44:17 +01:00
Houtan Bastani e3a3979eba
remove unnecessary line included in 0ff7a9d 2019-11-26 16:37:01 +01:00
Houtan Bastani 0ff7a9d2ab
introduce command line options: `exclude_eqs` and `include_eqs`
Allows for the inclusion/exclusion of a set of equations, specified either on the command line or in a text file.

If the equation has a single endogenous variable on the LHS, then the equation is moved. If not, if the equation has an `endogenous` tag then that variable is removed along with this equation. If not, then an error is thrown.

As a command line argument, `exclude_eqs` can take the form (same syntax for `include_eqs`):
* `exclude_eqs=eq1 to remove all equations declared as `[name=eq1]`
* `exclude_eqs=[eq 1, eq 2]` to remove all equations declared as `[name=eq 1]` or `[name=eq 2]`
* `exclude_eqs=[tagname=X]` to remove all equations declared as `[tagname=X]`
* `exclude_eqs=[tagname=(X, Y)]` to remove all equations declared as `[tagname=X]` or `[tagname=Y]`

When declared in a file, the file should be of the form:
```
eq 1
eq 2
```
to remove all equations declared as `[name=eq 1]` or `[name=eq 2]`.

It should be of the form:
```
tagname=
X
Y
```
to remove all equations declared as `[tagname=X]` or `[tagname=Y]`.
2019-11-26 14:16:00 +01:00
Houtan Bastani a61565bd01
macro processor: fix bug in cast of string to bool
The incorrect `equal` template was being used.
2019-11-26 11:11:34 +01:00
Houtan Bastani 4540bed06c
macro processor: missed if statement with initializer for C++17 2019-11-26 10:40:51 +01:00
Houtan Bastani 4e3bf09495
macro processor: fix typo that caused logical or not to work when one of the arguments is Real == 1 and other arguments are false 2019-11-26 10:39:16 +01:00
Houtan Bastani 8034513578
macro processor: fix bug: allow empty strings
previously, `@#define str=""` caused an error
2019-11-26 10:32:43 +01:00
Dóra Kocsis 926ccccb26 fix missing tokens in the lexer: conditional, unconditional. 2019-11-25 17:34:52 +01:00
Dóra Kocsis 8bfcefe7fb Add interface for forecast_shock_decomposition. Dynare/dynare#1657 2019-11-25 17:08:59 +01:00