Commit Graph

208 Commits (090945d8a8017e0f2b84aa8123f6ae00ea66af87)

Author SHA1 Message Date
Sébastien Villemot 75a26b6d11
Remove unused member in the RamseyPolicyStatement class 2022-01-06 14:47:34 +01:00
Sébastien Villemot 7dde09169e
estimated_params: check that no parameter is declared twice across concatenated blocks
The existing check (in AbstractEstimatedParamsStatement::commonCheckPass()) was
only working inside a given estimated_params block, but not across blocks.
2021-12-16 15:22:48 +01:00
Sébastien Villemot ea44aa19d6
New option “overwrite” to “estimated_params” block
This option provides the same behaviour as before the change in
60ef6bbdbd.

It is typically useful when doing several estimations in the same .mod file.
2021-12-16 14:22:31 +01:00
Sébastien Villemot 5ffbc5bad3
New estimated_params_remove statement 2021-12-15 16:02:57 +01:00
Sébastien Villemot 06a436fdf0
Minors simplification in EstimatedParams* classes
Also use a better name for the type-specific ID variable.
2021-12-15 16:02:53 +01:00
Sébastien Villemot 60ef6bbdbd
Allow multiple estimated_params statements 2021-12-15 12:20:29 +01:00
Johannes Pfeifer 164e2debdc occbin_write_regimes: add option to select type 2021-12-06 16:10:58 +01:00
Johannes Pfeifer befd432be7 evaluate_planner_objective: add options
Related to https://git.dynare.org/Dynare/dynare/-/merge_requests/1967
2021-12-03 14:06:57 +01:00
Sébastien Villemot 02ee077663
Fix handling of undeclared variables in the planner_objective statement
Closes: #81
2021-11-19 17:32:45 +01:00
Sébastien Villemot 127361971f
PAC: refactor with new PacModelTable that replaces PacModelStatement(s)
Incidentally, the auxiliary endogenous variable representing Z₁ and created for
PAC MCE models no longer necessarily appear as the first auxiliary variable (so
this is effectively a revert of 64f55e4a5e).
2021-10-29 14:11:30 +02:00
Johannes Pfeifer b496c4ba2c ramsey_model: Fix error message logic
one of the statements being present is sufficient
2021-09-24 09:14:41 +02:00
Sébastien Villemot eb006ecaeb
Remove unused steady_state_growth option to pac_model 2021-09-22 16:26:42 +02:00
Sébastien Villemot 989347f448
Fix bug introduced in previous commit that triggers a crash for DSGE-VAR models 2021-09-08 19:00:15 +02:00
Sébastien Villemot cb19ece049
estimated_params*: add a check that prevents (apparently) recursive prior definitions
Closes: #77
2021-09-08 17:10:56 +02:00
Sébastien Villemot 62ba9a434a
estimated_params_{bounds,init} now check that a parameter (or correlation) is never declared twice
This check was previously only implemented in estimated_params.
2021-09-08 16:38:15 +02:00
Johannes Pfeifer 3f37d9692c method_of_moments: move to namespace 2021-08-15 20:44:24 +02:00
Sébastien Villemot 15d7432105
Occbin: add more sanity checks on expressions in “occbin_constraints” block
— forbid leads and lags
— forbid expectation operators

This is implemented by moving the occbin_constraints expression to a separate
DataTree. As a side-effect, this removes the spurious non-linearity warning in
a stochastic context (because we were introducing inequalities and abs()
operators in the main DynamicModel tree).
2021-07-21 16:33:23 +02:00
Sébastien Villemot ebd9954d33
Occbin: new syntax for constructing multi-regime equations
Ref. #68
2021-07-20 18:18:24 +02:00
Sébastien Villemot 81d4fd5d83
Occbin: generate +<basename>/occbin_difference.m
In particular, this implies that steady state values of endogenous in the
“occbin_constraints” block must now be specified using the STEADY_STATE()
operator (and not with a “_ss” suffix).

Moreover:
– make various simplifications to the fields generated under M_
– in the driver file, replace the call to occbin.initialize() by a few explicit operations

Ref. #68
2021-07-20 12:26:11 +02:00
Sébastien Villemot 08ac455fcd
Implement “occbin_constraints” block
Consequently drop “occbin” option to “model”.

Incidentally, allow more values in equation tag names (previously some keywords
such as “alpha” were disallowed).

Ref. #68
2021-07-16 11:34:27 +02:00
Johannes Pfeifer 61b37942ab First part of Occbin interface 2021-07-13 13:38:25 +00:00
Sébastien Villemot 6aeef11bb2
New perfect_foresight_with_expectation_errors_{setup,solver} commands 2021-07-09 17:14:22 +02:00
Sébastien Villemot 221daeab6f
New time_shift option to var_expectation_model
Ref. dynare#1787
2021-07-01 17:56:07 +02:00
Johannes Pfeifer f354458418 method_of_moments: remove var_list_ 2021-06-24 15:10:24 +02:00
NormannR d0ec5eb155 Allows to write M_.objective_tmp_nbr in the driver.m file
Writes the number of temporary terms of the planner objective function derivatives objective_tmp_nbr in the driver.m file.
Useful for the k-order approximations of welfare.
2021-06-11 12:37:31 +02:00
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
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 0213c9be73 Merge branch 'ramsey_k_order' into 'master'
Allows to write M_.NNZDerivatives_objective in the driver.m file

See merge request Dynare/preprocessor!36
2021-04-22 13:28:18 +00:00
normann 22fbfb0fba Allows to write M_.NNZDerivatives_objective in the driver.m file
Writes the number of non-zero derivatives of the planner objective function NNZDerivatives_objective in the driver.m file. Useful for the k-order approximations of welfare.
2021-04-22 15:26:25 +02:00
Michel Juillard d511e3ec3a
add deterministic_trends statement (only used by Dynare Julia) 2021-04-22 15:19:21 +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
Johannes Pfeifer ad22e62874
filter_initial_state: Port lost preprocessor commits from https://git.dynare.org/JohannesPfeifer/dynare/-/commits/filter_initial_state 2021-01-26 16:03:04 +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
Willi Mutschler a87b2753ed
MoM: Add option analytic_jacobian 2021-01-08 18:57:06 +01:00
Johannes Pfeifer 78f6d48601 GMM: introduce option analytic_standard_errors 2020-12-12 09:36:40 +01:00
Sébastien Villemot 638b4c7ac5
Ensure that all statements produce an output in JSON mode 2020-11-26 16:25:22 +01:00
Sébastien Villemot a99ca9f450
Remove obsolete “var_estimation” statement 2020-11-26 16:13:52 +01:00
Sébastien Villemot 1b40327639
Remove obsolete “restrictions” block 2020-11-26 16:13:49 +01:00
Sébastien Villemot c697a63119
Fix typo 2020-11-25 18:08:49 +01:00
Sébastien Villemot 9292b0692e
Rename DetCondForecast to DetCondForecastStatement, for naming consistency 2020-11-25 17:40:00 +01:00
Johannes Pfeifer 9d9a4bd4d1 Remove matched_moments_ as input of method_of_moments
Now a subfield of M_
2020-08-05 13:46:09 +02:00
Sébastien Villemot 09054e11dc
Add new “matched_moments” block
Closes: #51
2020-07-28 18:30:24 +02:00
Johannes Pfeifer eb464665ac Fix faulty logic in checks 2020-07-21 10:48:45 +02:00
Johannes Pfeifer 98ddbb61ba Method of moments: Preprocessor preparations 2020-07-10 11:18:57 +02:00
MichelJuillard ed4c36a267 add first_simulation_period to the lexer
(cherry picked from commit c8575e11d2f81ad606ab50849c52127653699a93)
2020-05-14 14:36:35 +00:00
Stéphane Adjemian (Charybdis) 2a048a487c
Throw an error if mh_tune_guess is used without mh_tune_jscale. 2020-02-29 09:54:18 +01:00
Stéphane Adjemian (Charybdis) 3c6a23137b
Throw an error if mh_tune_jscale is used with mh_jscale. 2020-02-28 18:28:09 +01:00
Johannes Pfeifer 312edf0dba Provide M_ as an output to stoch_simul and discretionary_policy
Related to https://git.dynare.org/Dynare/dynare/issues/1711
2020-02-24 13:06:59 +00:00
Houtan Bastani 14be6bad00
occbin: support occbin tags in equation tags, add occbin_likelihood and occbin_smoother as options to estimation 2020-02-11 14:24:06 +01:00
Sébastien Villemot c4a9f93d40
Do not allow the estimation of a parameter that appears in “planner_discount”
Ref. dynare#1173
2020-02-04 17:49:53 +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
Houtan Bastani acdfeb4ee6
simplify calls to `symbol_list.checkPass` 2020-01-07 15:58:30 +01:00
Houtan Bastani 98a9c88880
Allow `dynasave` and `dynatype` to support exogenous variables in their var_list
issue dynare#1691
2020-01-06 10:52:18 +01:00
Houtan Bastani 54f73e0864
Symbol List check pass: allow caller to specify the valid types of variables in a Symbol List
dynare#1355
2019-12-23 21:16:00 +01:00
Sébastien Villemot e2d5a83592
Global reindentation 2019-12-20 16:59:30 +01:00
Houtan Bastani 42106f85a8
det_cond_forecast: fix output aesthetics
- remove semicolon after `end`
- don't test for existence of `oo_`
- fix spacing to conform with MATLAB/Octave spacing

issue #39
2019-12-20 14:51:16 +01:00
Houtan Bastani 9d3be05a2d
remove superfluous comma 2019-12-20 14:51:16 +01:00
Houtan Bastani 76b461de4a
organize function with other members of the same class 2019-12-20 14:51:16 +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 5f451ebc99
Cosmetic fixes to 8baec1e0ec
Ref. #1673
2019-12-20 11:48:50 +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
Stéphane Adjemian (Charybdis) 8baec1e0ec Allow k order estimation.
Automatically switch to k_order_solver if order>2. Use old mex file if
order==2 (since it seems unexpectedly significantly faster than
local_state_space_iteration_k, and because it can deal with pruning).
2019-12-20 11:15:16 +01:00
Sébastien Villemot 044258b0a2
Make “datafile” option of “perfect_foresight_setup” (and “simul”) equivalent to “initval_file”
Ref. dynare#1663
2019-12-19 14:53:52 +01:00
Sébastien Villemot c2461981d2
Various provisions for improvements to shock decomposition commands
– New “squeeze_shock_decomposition” command
— New “max_nrows” option to “plot_shock_decomposition” and
  “initial_condition_decomposition”
— “plot_shock_decomposition” now returns oo_ as an output argument

Ref. dynare#1687, dynare!1655
2019-12-18 11:39:44 +01:00
Sébastien Villemot 031c0cff5f
Various code simplifications and modernizations 2019-12-16 19:42:59 +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 1d3265acb7
C++17: further code simplifications (assignments in if) 2019-12-12 16:19:14 +01:00
Houtan Bastani 8dfa79a0f5
new command `evaluate_planner_objective`
dynare#1678
2019-12-12 11:35:26 +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
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 8bfcefe7fb Add interface for forecast_shock_decomposition. Dynare/dynare#1657 2019-11-25 17:08:59 +01:00
Sébastien Villemot d839aea08b
Drop unused functions for writing C and C++ output
These functions should have been deleted in
946d105c04.
2019-10-24 10:54:46 +02:00
Sébastien Villemot ecdca502aa
Modernization: stop using make_pair() and make_tuple()
In many cases, they can be replaced by the curly braces syntax.

Otherwise, we can now use the pair() and tuple() constructors, without the need
to specify template parameters, thanks to class template argument
deduction (new in C++17).
2019-10-24 10:49:13 +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 0b3cd3ec90
pac: fix parsing of linear combination for growth option 2019-10-03 18:26:09 +02:00
Sébastien Villemot b0ac4a4e51
Cosmetic change 2019-09-24 18:47:43 +02:00
Houtan Bastani 04b6a68aef
new calling structure for stoch_simul, discretionary_policy. dynare#1197 2019-09-11 18:05:40 +02:00
Sébastien Villemot 2c6fa34a1f
C++17: use structured bindings instead of std::tie whenever possible 2019-09-11 16:40:19 +02:00
Houtan Bastani d1be4f4946
remove duplicates from stoch_simul symbol_list. closes dynare#1519 2019-09-10 11:13:33 +02:00
Sébastien Villemot fbf535e819
Fix typo 2019-08-27 14:20:00 +02:00
Sébastien Villemot db6d4fb0cd
Support identification(order=3)
In that case, the preprocessor outputs g4 (4th derivatives of model) and
g3p (1st derivs of g3 w.r.t. parameters).

Ref #10
2019-08-22 17:02:40 +02:00
Sébastien Villemot 24d4b2dc77
identification command now accepts the order option
Note that this option does not modify the global options_.order, for
consistency with the semantics of the identification command.

The preprocessor will compute dynamic derivatives up to at least order+1.

Closes #10
2019-07-05 17:49:16 +02:00
Sébastien Villemot d59f9f75ff
Simplification of previous commit 2019-06-05 15:03:48 +02:00
Houtan Bastani d873414728
pac_model growth: allow single parameters 2019-05-27 16:06:14 +02:00
Houtan Bastani 3509291b74
pac_model: only write growth fields if growth was passed to pac_model 2019-05-20 16:14:40 +02:00
Houtan Bastani 2753ab9887
pac: collect exogenous variables in growth argument to pass exo use test in ModFile.cc 2019-05-17 15:06:16 +02:00
Houtan Bastani a0f74f5c16
pac growth: allow linear combination 2019-05-14 12:33:59 +02:00
Houtan Bastani 21fe0f4bdc
avoid cast warnings when compiling boost headers 2019-04-23 14:57:03 +02:00
Sébastien Villemot b73d554ad2
Use Unicode copyright symbol (in UTF-8 encoding) 2019-04-16 11:35:31 +02:00
Houtan Bastani 7392cd3a6c
add JSON output for plot_shock_decomposition, realtime_shock_decomposition, and initial_condition_decomposition 2019-04-12 14:34:09 +02:00
Sébastien Villemot 39926133b8
More automatic modernizations with clang-tidy 2019-04-03 16:46:20 +02:00
Sébastien Villemot 8a41a75c85
Apply modernize-raw-string-literal from clang-tidy
Use ReplaceShorterLiterals option to enforce replacement of all strings.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-raw-string-literal.html
2019-04-03 16:45:52 +02:00
Houtan Bastani 6ba31087ab
add check for parameter_set option to conditional_forecast 2019-04-03 14:26:02 +02:00
Sébastien Villemot 78583135df
Use true/false instead of 1/0 for boolean options
This is more elegant, and makes it easier to distinguish them from integer
options.
2019-03-19 15:15:10 +01:00
Houtan Bastani fdefb0f52a
move variable initialization out of body 2019-03-08 16:21:01 +01:00
Houtan Bastani e56f994d28
pac_model: write growth argument as string 2019-03-01 11:20:26 +01:00
Houtan Bastani 341b9c6667
pac_model: allow diff as argument to growth option 2019-02-28 19:22:34 +01:00
Houtan Bastani 240aba6709
move pac info out of pac expectation node 2019-02-20 15:35:13 +01:00
Houtan Bastani 0ea84fa9a4
pac: allow steady state growth and model consistent expectation substitution in pac equation 2019-02-18 15:11:45 +01:00