Commit Graph

165 Commits (74ef3457b4805099ee9885b34173a0d0fd6aca61)

Author SHA1 Message Date
Sébastien Villemot 74ef3457b4
Use secure URL for link to GNU licenses 2021-06-09 17:21:00 +02:00
Sébastien Villemot 86b2b4c2da
When order option > 3, compute planner objective derivatives at that order
Ref. dynare!1866
2021-06-04 16:20:29 +02:00
Johannes Pfeifer 4b401e6253
Preparations for Occbin MR
Related to https://git.dynare.org/Dynare/dynare/-/merge_requests/1863
2021-05-31 15:12:46 +02:00
Sébastien Villemot c5f9ae89e7
Implement new “occbin” option to “model” block
For the time being, the preprocessor will refuse that this option be used with
any command other than estimation.

By the way, remove occbin_likelihood and occbin_smoother options to estimation.

Ref. dynare#569
2021-05-31 10:00:59 +02:00
Sébastien Villemot 1d188a7444
Add comment
[skip ci]
2021-05-04 17:21:47 +02:00
Sébastien Villemot 3c4d647cc3
Forbid mfs > 0 in a stochastic setup (or even when using check)
The result would be wrong.

Ref. dynare#1726
2021-05-04 17:11:09 +02:00
Sébastien Villemot c2d47fb48e
Julia: remove driver file
The Julia code now uses the JSON output for retrieving the information that
previously was in the driver file.
2021-04-19 17:02:41 +02:00
Sébastien Villemot 54365b16ed
Remove unfinished “occbin” option to perfect_foresight_solver and extended_path
Partially reverts f914837aff and
567156aad4.
2021-02-22 16:22:17 +01:00
Willi Mutschler f7cd6dbf0a
🐛 save oo_.time also in _results.mat 2021-02-04 10:48:59 +01:00
Willi Mutschler c79ae5d4bd
Save 'Total computing time' into oo_.time 2021-01-28 11:28:41 +01:00
Sébastien Villemot af9bd8f109
Remove the unfinished decomposition in linear and nonlinear blocks
Also remove the det_cond_forecast interface, that was related to it.

Ref. dynare!1626
Closes: #39
2021-01-25 18:03:37 +01:00
Stéphane Adjemian (Charybdis) 7a8446e836
Added call to a routine filling the fields required by some nonlinear solvers.
At some point this task might be delegated to the preprocessor.

(cherry picked from commit ca230d0902eadeb89ab705cf66790ffa2f135192)
2021-01-12 19:50:37 +01:00
Willi Mutschler a87b2753ed
MoM: Add option analytic_jacobian 2021-01-08 18:57:06 +01:00
Sébastien Villemot 8e03f17350
Cleanup the “output” option
— output Julia files as soon as “language=julia” is passed, independently of
  the value of the “output” option
— drop the “dynamic” and “first” values of the “output” option, since they
  actually do nothing
— obey the “output” option even in the deterministic case

Ref. dynare#1600
2021-01-08 18:51:48 +01:00
Sébastien Villemot 78874a01d3
No longer deal with the log file at the preprocessor level
Ref. dynare#1743
2021-01-06 14:19:33 +01:00
Johannes Pfeifer 78f6d48601 GMM: introduce option analytic_standard_errors 2020-12-12 09:36:40 +01:00
Sébastien Villemot f67e9c044b
JSON output: fix “variable_mapping” for Ramsey models
Ref. dynare#1755
2020-12-09 17:32:29 +01:00
Sébastien Villemot cfb41d291c
Substitute out model-local variables early in the model transform pass
Incidentally, this makes it possible to use model-local variables with either
the “block” or “bytecode” option. (Ref: dynare#1243)
2020-11-10 18:07:57 +01:00
Sébastien Villemot 9bca65c7e5
Deterministic models: replace exogenous with lead/lags by auxiliary variables
This brings those models in line with stochastic models.

However note that transformation is still not exactly the same on stochastic
and deterministic models, because there is no need to take into account the
Jensen inequality on the latter. In deterministic models, there is a one-to-one
mapping between exogenous with lead/lags and auxiliaries, while in stochastic
models, an auxiliary endo may correspond to a more complex nonlinear expression.
2020-11-09 16:28:32 +01:00
Sébastien Villemot d2cbe2a19e
PAC model: fixes to M_.pac.MODEL.ar (information about autoregressive part)
– Fix order of items in this structure. Previously, items were ordered
  according to the declaration order of parameters. Now, items are order
  according to lag order (first lag appears first)
– Gracefully handle the case where there is no autoregressive part
  (Closes: #52)
2020-10-16 16:31:51 +02:00
Sébastien Villemot feee0ffa12
PAC model: better error message when pac_expectation refers to a non-existent pac_model
Closes: #53
2020-09-10 14:24:20 +02:00
Johannes Pfeifer 98ddbb61ba Method of moments: Preprocessor preparations 2020-07-10 11:18:57 +02:00
Sébastien Villemot ad5e196d30
Block decomposition now compatible with 'use_dll' option 2020-06-23 15:13:04 +02:00
Sébastien Villemot c6a17913b4
Rename {Static,Dynamic}Model::writeOutput() to ::writeDriverOutput() for clarity 2020-05-20 11:44:40 +02:00
Sébastien Villemot becc433d56
Rename byte_code to bytecode for consistency with user option name 2020-05-20 11:39:59 +02:00
Stéphane Adjemian (Charybdis) c38f9aa7c3
Cosmetic change. 2020-04-06 09:29:57 +02:00
Stéphane Adjemian (Charybdis) 27a8b3b70e
Added preprocessor option: notime.
Do not print the total computing time at the end of the driver.
2020-04-03 11:00:48 +02:00
Sébastien Villemot 7d1a467aa3
Transform predetermined variables before computing original model leads/lags
This is necessary to correctly compute those original model leads/lags. In
particular, this is needed for correct interaction with “histval”.

Closes: #47
2020-03-02 17:10:24 +01:00
Houtan Bastani ac4749edf9
add undocumented `gui` option to preprocessor 2020-02-12 12:32:40 +01:00
Houtan Bastani f9a7d8ded3
make loop variables const 2020-02-06 16:09:03 +01:00
Sébastien Villemot b0c819cb03
Compute 3rd order dynamic derivatives for “dynare_sensitivity(identification)”
Ref. #40
2020-01-20 17:26:31 +01:00
Sébastien Villemot 23a08a3662
Ensure that dynamic model files contains all the derivatives that have been computed
Previously, there could be a discrepancy if the order mandated by
“identification” was less that the one mandated by “stoch_simul”.

Ref. #40
2020-01-20 17:22:32 +01:00
Sébastien Villemot e2d5a83592
Global reindentation 2019-12-20 16:59:30 +01:00
Houtan Bastani 32c3910e18
allow symbol list to accept auxiliary variables
dynare#1355
2019-12-20 14:51:15 +01:00
Sébastien Villemot 82c2682bb2
New “with_epilogue” option of “shock_decomposition”, “realtime_shock_decomposition” and “initial_condition_decomposition”
Ref. dynare!1688
2019-12-20 11:47:54 +01:00
Sébastien Villemot 031c0cff5f
Various code simplifications and modernizations 2019-12-16 19:42:59 +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 4111bc8cfc
epilogue: create _dynamic and _static files
#36
2019-12-11 16:17:54 +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
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
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 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
Dóra Kocsis 7a78593df4 introduce variableMapping, default equation name tags in M_ and JSON output 2019-10-30 16:30:51 +01:00
Houtan Bastani 8a789d060f
aesthetic fix: for conformity to the rest of the code, prefer `const auto` to `auto const` 2019-10-29 11:20:27 +01:00
Houtan Bastani 217dadabbd
Use `if` statements with initializers allowed by C++17 2019-10-29 11:20:13 +01:00
Sébastien Villemot 2a127b1f23
VAR/TCM models: use lag-equivalence relationship to compute maximum lags
This is made possible by the getLagEquivalenceClass() method introduced in the
previous commit.

Previously, the static version of the LHS expressions was used.

As a consequence, drop ModFile::diff_static_model, now useless.
2019-10-22 16:04:24 +02:00
Sébastien Villemot 8a83e08e79
Fix bug with diff or unary ops that have same static representation
Previously, for testing whether two diff() expressions or two unary ops were
the lead/lag of each other, the preprocessor would test whether they have the
same static representation. This is ok for simple expressions (e.g.
diff(x(-1))), but not for more complex ones (e.g. diff(x-y) and diff(x(-1)-y)
should not be given the same auxiliary variable).

This commit fixes this by properly constructing the equivalence relationship
and choosing a representative within each equivalence class. See the comments
above lag_equivalence_table_t in ExprNode.hh for more details.

Closes #27
2019-10-22 15:01:06 +02:00
Houtan Bastani f77413ebb8
remove unused argument to function 2019-10-08 11:22:29 +02:00
Houtan Bastani 979453815c
simplify initialization of `hasModelChanged` variable in writing of output 2019-10-07 11:32:02 +02:00