Sébastien Villemot
6c7c2bc321
Simplification using std::set range constructor
2022-01-21 11:05: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
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
5572e478f1
Indentation fix
2022-01-06 14:46:38 +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
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
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
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
a210a8fd59
Add several types of auxiliary variables to M_.mapping
...
In practice, only those auxiliary variables which do not have an orig_symb_id
will be listed (in addition to unary ops, due to an implementation bug).
2021-11-24 11:27:17 +01:00
Sébastien Villemot
2282d4773c
PAC: new auxiliary variable type for pac_expectation operator
...
Also add the new equation to auxiliary equations in the backward case (but not
in the MCE case, since that equation is recursive).
2021-11-23 14:31:03 +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
1041f205ea
PAC: trap a few more cases when an auxiliary param conflicts with a declared one
2021-11-09 15:48:59 +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
Sébastien Villemot
5bef185370
PAC: add growth correction term for definition of Z₁ in the MCE case
2021-10-25 17:28:01 +02:00
MichelJuillard
561bee0790
add NNZderivatives to JSON + use AbstractVector for Julia functions
2021-10-06 17:45:11 +02:00
Sébastien Villemot
78e295115a
PAC: better error message in case of name conflict for the growth neutrality correction parameter
2021-10-06 16:41:09 +02:00
Sébastien Villemot
784dd4122a
PAC: generate the “growth_neutrality_param_index” MATLAB field for MCE models
...
Previously it was only generated in the case of backward PAC models.
2021-08-31 17:54:20 +02:00
Sébastien Villemot
e1f7d8c735
VAR models: add a parameter representing the constant in the development of the pac_expectation operator
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
Sébastien Villemot
1cf03a5f07
Cosmetic improvement
2021-07-21 17:53:54 +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
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
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
4cc22897b7
Cosmetic improvements
2021-07-06 19:09:25 +02:00
Sébastien Villemot
8df34c1ca5
VAR and trend component models: improve sanity checks on lead/lags on RHS
...
In particular, forbid lagged exogenous.
2021-07-06 18:52:38 +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
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
MichelJuillard
9773bafc5b
Julia: write definition of get_power_deriv inside generated static/dynamic files
2021-04-26 10:52:18 +00:00
Sébastien Villemot
dca294de3a
Julia: refactor the auxiliary variable/series files
...
— rename the files with camel case
— encapsulate the functions with modules
— change the signature of function <MODFILE>_dynamic_set_series!, by removing
the output argument and appending the exclamation mark, since this function
modifies one of its arguments, and for symmetry with the static version
Ref. DynareJulia/Dynare.jl#1
2021-04-23 17:57:33 +02:00
Sébastien Villemot
4354d8a578
Julia: do not overwrite steady state / auxiliary variables/series files if contents has not changed
...
Ref. DynareJulia/Dynare.jl#1
2021-04-23 17:56:54 +02:00
Sébastien Villemot
4cfc7a563b
Julia: do not overwrite Static/Dynamic files if contents has not changed
...
Ref. DynareJulia/Dynare.jl#1
2021-04-22 18:03:47 +02:00
Sébastien Villemot
81b1d02748
Julia: fix typo in StatsFuns package name
...
Ref. DynareJulia/Dynare.jl#1
2021-04-22 15:48:25 +02:00
Sébastien Villemot
1f17528383
Julia: update dependencies of Static/Dynamic modules
...
Ref. DynareJulia/Dynare.jl#1
2021-04-19 17:02:46 +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
Michel Juillard
fd979f625a
add maximum lead and lag to modfile.json
2021-04-01 17:05:13 +02:00
Sébastien Villemot
4798a5e2bc
Cosmetic change
2021-02-19 20:09:48 +01:00
Sébastien Villemot
d3e115194b
Fix output write_latex_original_model for model-local variables
...
Those variables were substituted out by early substitution methods (which are
also called on the original model, for an unknown reason).
Closes : #65
2021-02-19 17:45:02 +01:00
Sébastien Villemot
2781e3e6f6
A few modernizations using clang-tidy
2021-02-10 16:48:46 +01:00