Commit Graph

178 Commits (c3fc5b1dd799641fbbedfb420358e3dc6f5a4b87)

Author SHA1 Message Date
Sébastien Villemot c3fc5b1dd7
Enable -Wunused-parameter
As a consequence, add many [[maybe_unused]] attributes for legitimate
cases (mainly in virtual functions).
2022-06-24 17:11:48 +02:00
Sébastien Villemot 17f72d6162
Remove empty checkPass() methods 2022-06-24 17:11:48 +02:00
Sébastien Villemot c94dfb848c
C++20 modernization: use initialization within range-based for loop
In particular, use this feature in many loops which feature a special treatment
for the first iteration, using a boolean variable (replacing iterator
manipulation). By the way, also use std::exchange() to simultaneously test the
value of this variable and update it.
2022-06-07 14:35:59 +02:00
Sébastien Villemot 9ace2dc413
C++17 modernization: take advantage of class template argument deduction 2022-06-07 14:35:26 +02:00
Sébastien Villemot 0b5c88109f
Various simplifications 2022-06-07 14:34:30 +02:00
Sébastien Villemot 591b5e5f9e
Always create bytecode output
And, symmetrically, when the “bytecode” option is requested by the user, always
create the .m static/dynamic files.

The “bytecode” option therefore no longer modifies the preprocessor output.
2022-05-19 14:49:46 +02:00
Sébastien Villemot 0284b249f5
Remove unused “bytecode” argument in {Static,Dynamic}Model::computingPass() 2022-05-19 14:10:22 +02:00
Sébastien Villemot 2483639f4d
Fix bug introduced in 3516894a71 related to new estimation syntax 2022-05-18 19:27:00 +02:00
Sébastien Villemot 3516894a71
JSON output: fix handling of vector value options
The vectors were previously stored as strings internally, which would not
necessarily contain the commas which are required in JSON (but not in
MATLAB/Octave). The fix consists in internally storing those options as
std::vector.

Closes: #96
2022-05-18 17:44:36 +02:00
Sébastien Villemot 701db61e09
JSON output: fix several bugs related to switch/case fallthrough 2022-05-18 16:33:42 +02:00
Sébastien Villemot 8fd1505ca2
C++17 modernization: use std::optional for “periods” option of “plot_conditional_forecast”
Incidentally, in the JSON output, no longer assign a value to the “periods”
field if not passed by the user (previously the value -1 was output in the JSON
file).
2022-05-16 19:10:15 +02:00
Sébastien Villemot b42ee40b55
C++20 modernization: use contains() method on containers 2022-05-04 17:37:57 +02:00
Sébastien Villemot ef02b79486
Various minor simplifications 2022-05-04 17:36:59 +02:00
Sébastien Villemot 8e3590ee71
Reject exogenous deterministic variables in a few places where they were erroneously accepted
– heteroskedastic_shocks block
– generate_irfs command
– new estimation syntax
2022-04-21 17:59:04 +02:00
Sébastien Villemot b5a4df1608
New shocks(learnt_in=…) and endval(learnt_in=…) blocks
For use with perfect_foresight_with_expectation_errors_setup.
2022-04-21 17:07:33 +02:00
Sébastien Villemot a431682697
Fix check for the presence of ramsey_{model,policy} when ramsey_constraints is used
The existing check would incorrectly fail if ramsey_constraints appeared before
ramsey_{model,policy}.

Also, the check would not terminate the processing in case of error.

Closes: #91
2022-04-11 12:28:38 +02:00
Sébastien Villemot 46cc47266b
Refactor parsing of symbol lists
For symbol lists (such as those given to “var” or “stoch_simul”), return a
semantic value at the Bison level, rather than building the list through a
temporary object in ParsingDriver. This allows various simplifications, and
leads to a more functional code.

By the way, homogeneize the naming of the various flavours of symbol lists in
the Bison file (with TeX names, partitioning, or with a wildcard).
2022-03-29 14:59:34 +02:00
Sébastien Villemot 9db21a231c
Handle “resid” command at the preprocessor level and add “non_zero” option 2022-03-01 14:23:18 +01:00
Sébastien Villemot 7df6781982
Add interface for “static” and “incidence” options of “model_info” 2022-02-09 12:26:00 +01:00
Sébastien Villemot aa0e06bc7d
Refactor handling of var_expectation_model statements
Creates a VarExpectationModelTable analogous to PacModelTable.
2022-01-20 16:26:15 +01:00
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