Commit Graph

3022 Commits (last-simulation-period)

Author SHA1 Message Date
Stéphane Adjemian (Charybdis) c56d58822e
Get the value of periods returned by the initval_file command. 2022-01-21 16:43:46 +01:00
Stéphane Adjemian (Charybdis) ddddf89d9c
Add new option last_simulation_period for initval_file command. 2022-01-21 16:43:46 +01:00
Sébastien Villemot 5e8b478ccf
Add check to ensure that column indices in derivative matrices do not overflow
Closes: #89
2022-01-21 14:31:29 +01:00
Sébastien Villemot f17c40f272
Cosmetics 2022-01-21 11:31:35 +01:00
Sébastien Villemot 6c7c2bc321
Simplification using std::set range constructor 2022-01-21 11:05:17 +01:00
Sébastien Villemot 49fa876444
Add missing “time_shift” option to JSON output of var_expectation_model 2022-01-20 16:26:17 +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 e1e5118373
Refactor the code that substitutes unary ops in model equations
In particular, make it more visible that the substitution also occurs in PAC
equations (and not only in VAR and TCM equations).
2022-01-19 15:56:44 +01:00
Sébastien Villemot 96e2a8f971
Fix orig_lead_lag field for diff lag aux vars 2022-01-19 15:52:46 +01:00
Sébastien Villemot a71100b971
Fix comment 2022-01-19 15:41:37 +01:00
Sébastien Villemot 0d7d5f1ae7
In case of nested unary ops (e.g. log(log())), ensure that the definition of the external aux var references the internal aux var 2022-01-19 15:40:52 +01:00
Sébastien Villemot 064a3dcd77
Fix orig_lead_lag field for unary op auxiliary variables
Ref. dynare#1843
2022-01-19 15:40:24 +01:00
Sébastien Villemot d149d3a76c
PAC: substitute unary ops in “growth” expressions (in “pac_model” and “pac_target_info”)
Ref. dynare#1837
2022-01-18 12:40:15 +01:00
Sébastien Villemot f05b552f31
PAC: correctly handle log() and diff() operators in the equation defining the target
By default, the preprocessor substitutes logs and diffs by auxiliary variables
only in equations of auxiliary models (VAR, PAC). Hence they are not
substituted in the equation defining the target, since it is outside the
auxiliary model.

The fix consists in doing the substitution in that equation as well, when we
parse the linear combination within that equation.

Ref. dynare#1837
2022-01-17 12:57:37 +01:00
Sébastien Villemot 8c528f4f9a
Add missing include
(“endl” is defined in “ostream”)
2022-01-06 14:55:57 +01:00
Sébastien Villemot 0db05a886a
Move “using namespace std” statement after inclusion of standard headers
Otherwise clang emits this warning:
 using directive refers to implicitly-defined namespace 'std'
2022-01-06 14:54:57 +01:00
Sébastien Villemot 75a26b6d11
Remove unused member in the RamseyPolicyStatement class 2022-01-06 14:47:34 +01:00
Sébastien Villemot 5572e478f1
Indentation fix 2022-01-06 14:46:38 +01:00
Sébastien Villemot ebf7b6c51d
Clang compatibility fix 2022-01-06 14:35:39 +01:00
Sébastien Villemot 3417fb716f
Update copyright years
[skip ci]
2022-01-04 13:53:39 +01:00
Sébastien Villemot a8fce06dc4
PAC: new options “auxname” and “kind” to “pac_model” 2021-12-16 15:40:47 +01:00
Sébastien Villemot ea6fb40db7
PAC: new “pac_target_info” block and “pac_target_nonstationary” operator
Ref. Madysson/estimation-codes#5
2021-12-16 15:40:47 +01:00
Sébastien Villemot 6a31ba4b62
PAC: minor simplification in the matching of the growth expression
Simple variable nodes are already correctly matched by
ExprNode::matchLinearCombinationOfVariables().

Also improve the related documentation.
2021-12-16 15:40:47 +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 342c4faf8d
New var_remove statement 2021-12-15 12:20:29 +01:00
Sébastien Villemot 60ef6bbdbd
Allow multiple estimated_params statements 2021-12-15 12:20:29 +01:00
Sébastien Villemot 2d07186b8b
New model_options statement
The purpose of this statement is to specify the options that apply to the whole
model, when there are several “model” blocks, so as to restore the symmetry
between those blocks (since otherwise one “model” block would typically bear
the options, while the other ones would typically have no option).

It still remains possible to specify the options on one “model” block, or even
spread accross several ones.

Closes: #19
2021-12-15 12:20:14 +01:00
Sébastien Villemot 1f004584e9
New model_remove statement and model_replace block
Factorize the implementation with the existing code for the include_eqs and
exclude_eqs options (which has been refactored by the way).

Ref. #19
2021-12-15 12:11:25 +01:00
Sébastien Villemot a73b0d911a
Fix logic of include_eqs in the presence of [static]/[dynamic] equations
In a model with [static]/[dynamic] equations, if the user was using include_eqs
with a list of equations that does *not* contain equations marked
[static]/[dynamic], then the call to ModelTree::includeExcludeEquations(…,
static_equations=true) would have an empty list of equation tags (as stored
in tag_eqns).

The right behaviour in this case is to exclude all static equations. However,
the code would exclude none, and this would disrupt the equilibrium between
[static] and [dynamic] equations (since all [dynamic] equations were excluded
by the other call to the same method).

The fix consists in removing the shortcut that returns from the method if
tag_eqns is empty.
2021-12-10 12:50:10 +01:00
Sébastien Villemot a492417a5b
Fix typo 2021-12-10 12:44:42 +01:00
Sébastien Villemot 82c4b567cf Merge branch 'master' into 'master'
Julia specific interface for normcdf and normpdf

See merge request Dynare/preprocessor!56
2021-12-10 09:50:50 +00:00
MichelJuillard d047878333 Julia specific interface for normcdf and normpdf 2021-12-10 10:17:06 +01:00
Sébastien Villemot be316b3dec
Bump version number 2021-12-08 14:21:59 +01:00
Sébastien Villemot c0ea8d7203
Add hyperbolic primitives (cosh, sinh, tanh, acosh, asinh, atanh)
Everything was already in place (since ages!), except that the parser interface
was missing.

Also fix the derivation formula for atanh, which was incorrect.
2021-12-07 18:03:33 +01:00
Sébastien Villemot d15b2110a0
Add erfc() primitive
Closes: #85
2021-12-07 15:19:40 +01:00
Sébastien Villemot a040a7dbde
Merge branch 'write_regimes' of git.dynare.org:JohannesPfeifer/preprocessor
Ref. !55
2021-12-07 12:24:38 +01:00
Sébastien Villemot 81abea042b
Occbin: use element-by-element multiply, divide and power in occbin_difference.m
This file operates on vectors.

Ref. dynare#1826
2021-12-07 12:22:59 +01:00
Sébastien Villemot b356b8d5fa
Substitute out adl() operators in equations marked [static] 2021-12-06 17:17:38 +01:00
Sébastien Villemot dc99d81c45
Explain why expectation() operators need not be substituted in equations marked [static]
By the way, also perform a small code simplification.
2021-12-06 17:17:38 +01:00
Sébastien Villemot 214f0db4db
Add comment about predetermined variables and equations marked [static]
By the way, also perform a small code simplification.
2021-12-06 17:17:38 +01:00
Sébastien Villemot 5fe94ed606
Simplify constant equations also in equations marked [static]
The simplifyEquations() methods had to be moved to DynamicModel, in order to
access the static_only_equations member.
2021-12-06 17:17:37 +01:00
Sébastien Villemot fe974c4c31
When looking for unused endos/exos, also search in equations marked [static] 2021-12-06 17:17:37 +01:00
Sébastien Villemot 8d4cab6fe3
Substitute model-local variables in equations marked [static] 2021-12-06 17:17:27 +01:00
Johannes Pfeifer 164e2debdc occbin_write_regimes: add option to select type 2021-12-06 16:10:58 +01:00
Sébastien Villemot 7b8fc8edb7
Symbolic detrending engine: correctly handle equations marked [static]
Incidentally, this also fixes a detrending bug in the Occbin engine (since the
latter internally generates a [static] equation).

Ref. dynare#1827

By the way, perform a small code simplification.
2021-12-06 12:59:21 +01:00
Sébastien Villemot 607c5aab19 Merge branch 'planner_objective_options' into 'master'
evaluate_planner_objective: add options

See merge request Dynare/preprocessor!54
2021-12-03 16:07:14 +00: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