Sébastien Villemot
b42ee40b55
C++20 modernization: use contains() method on containers
2022-05-04 17:37:57 +02:00
Sébastien Villemot
c03f4a559a
Fix JSON output when there are multiple “var_expectation_model” statements
...
Ref. Madysson/estimation-codes#19
2022-02-15 20:58:36 +01:00
Sébastien Villemot
01bea3f5e7
TCM: remove useless 3rd dimension of A0 and A0star (supposedly for lags)
2022-01-28 16:38:50 +01:00
Sébastien Villemot
1e77f7c5a7
SymbolTable::getOrigSymbIdForAuxVar() now also works on unaryOp and diffForward auxvars
...
This is a more natural semantics.
Incidentally, this fixes a bug in the variable mapping (M_.mapping) where some
endogenous, appearing in a log() in a VAR or TCM, would not be mentioned (e.g.
in the var-expectations/7/example1.mod test, and many others).
2022-01-28 16:30:11 +01:00
Sébastien Villemot
6936e54d42
Remove unused field M_.pac.(model_name).lhs
...
It contains symbol IDs, so it cannot be used from MATLAB/Octave code.
2022-01-25 10:34:46 +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
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
ebf7b6c51d
Clang compatibility fix
2022-01-06 14:35: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
ae242770f9
PAC: in the backward case, unify h0 and h1 parameters vector into a single vector
...
There is no reason to keep this distinction.
Additionally, since the data structure is now symmetric with the MCE case,
unify this “h” parameter vector with the “α” parameter vector.
2021-11-23 14:31:03 +01:00
Sébastien Villemot
0f89569f7e
PAC: in the backward case, create an aux. var. for the pac_expectation expression
...
By the way, refactor the MCE case by merging two routines related to the Z₁ aux. var.
This restores the symmetry with the backward case, now that the latter also has
an aux. var. for the pac_expectation operator. Also store the aux. var. IDs in a
structure common to the backward and MCE cases.
2021-11-23 14:31:03 +01:00
Sébastien Villemot
0e62206203
PAC: drop support for multiple PAC equations associated to a given PAC model
2021-11-23 14:31:02 +01:00
Sébastien Villemot
37a6ed6261
PAC: rethink the relation between PacModelTable and DynamicModel classes
2021-10-29 14:11:30 +02: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
Stéphane Adjemian (Ryûk)
8305b94d29
Fix constant definition in reduced form VAR.
2021-07-21 17:53:55 +02:00
Stéphane Adjemian (Ryûk)
c6a7d56b36
Fix constants in var model (it has to be a vector).
2021-07-21 17:53:55 +02:00
Sébastien Villemot
a6add6127b
VAR models: output vector of constants in varmatrices.m
2021-07-21 17:53:54 +02:00
Stéphane Adjemian (Ryûk)
6b9d94405c
Return the reduced form of the structural VAR model optionally.
...
Also
- changed the name of the generated matlab routine,
- changed initialization of matrix a0.
2021-07-16 08:33:26 +02:00
Sébastien Villemot
365fb27f3d
New “structural” option to “var_model”
...
As the name implies, this option allows contemporaneous variables on the RHS.
The A0 matrix for contemporaneous variables is added as a second (optional)
output to the generated var_ar.m file. Note that for reduced-form VAR, this
matrix will be the identity.
Also, the user is now allowed to write the VAR models in a more flexible form:
the LHS must still be a single variable, but the RHS can be an arbitrary
expression (as long as it is linear, obviously). Internally, the preprocessor
now uses derivation to compute the coefficients of the AR and A0. This change
applies to both reduced-form and structural VAR models.
Ref. dynare#1785
2021-07-08 12:55:47 +02:00
Sébastien Villemot
67f4777ac3
Remove support for obsolete syntax: var_model(order = 2) X Y Z;
2021-07-07 18:26:09 +02:00
Sébastien Villemot
5a33699f03
VAR / trend component models: cosmetic changes
2021-07-01 17:52:05 +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
e2d5a83592
Global reindentation
2019-12-20 16:59:30 +01:00
Sébastien Villemot
031c0cff5f
Various code simplifications and modernizations
2019-12-16 19:42:59 +01:00
Sébastien Villemot
2c6fa34a1f
C++17: use structured bindings instead of std::tie whenever possible
2019-09-11 16:40:19 +02:00
Sébastien Villemot
1907249fac
Ask GCC to warn about C-style casts (-Wold-style-cast)
...
Adapt the code accordingly.
2019-04-23 12:54:11 +02:00
Sébastien Villemot
b73d554ad2
Use Unicode copyright symbol (in UTF-8 encoding)
2019-04-16 11:35:31 +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
a3c08f932e
simplify code to find autoregressive matrix for VARs
2019-03-15 12:26:59 +01:00
Houtan Bastani
4160e48dab
output info relative to A0star column indices
...
(cherry picked from commit 70f73d9bd5232044f3e31f1e4b26425bd149a869)
2019-02-21 12:57:18 +01:00
Houtan Bastani
fc6d04b015
create A0 and A0star matrices for trend component models
2019-02-19 12:26:30 +01:00
Houtan Bastani
b3fbb86214
relieve constraint that max lag on EC matrix is 1
2019-02-15 11:12:07 +01:00
Houtan Bastani
f4837e6c94
fix AR and EC matrices when `equation = C` results in a simplified equation
2019-02-14 17:09:57 +01:00
Houtan Bastani
bef7c2a193
remove need to declare equations nonstationary
2018-10-24 16:04:51 +02:00
Sébastien Villemot
7bb5382428
Always use brace-initializer in constructors
...
The syntax makes clearer the distinction between a function call and an
initialization. Also, it prevents bugs due to implicit type conversions.
2018-10-04 17:19:18 +02:00
Houtan Bastani
fbeae9619a
aesthetic fix
2018-09-25 15:48:05 +02:00
Houtan Bastani
6c7d7f5d44
don’t create file if trend_component_model/var_model statement not present
2018-09-25 12:18:52 +02:00
Houtan Bastani
8ec06dddc4
fix typo and remove unnecessary braces
2018-09-18 17:31:51 +02:00
Houtan Bastani
eb74d48393
trend_component_model: replace `trends` option with `targets`
2018-09-13 12:21:23 +02:00
Houtan Bastani
dfb0629c25
fix typo
2018-09-12 18:21:34 +02:00
Houtan Bastani
dc9ecbb49a
fix bug in columns of EC matrix
2018-09-12 17:56:30 +02:00
Houtan Bastani
aa120abd02
simplify code
2018-09-12 11:57:14 +02:00
Houtan Bastani
f71c861d5e
output EC matrix in file for trend component models
2018-09-10 17:44:04 +02:00
Houtan Bastani
46709ada3f
output AR matrix in file for trend component models
2018-09-10 14:51:33 +02:00
Houtan Bastani
f5e5dea1be
support hard-coded parameters and parameter expressions in AR matrix
2018-09-07 10:14:18 +02:00
Houtan Bastani
acc197f539
output AR matrix in file
2018-09-06 18:00:05 +02:00