Commit Graph

2920 Commits (var-models)

Author SHA1 Message Date
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 da9e0acc2d
VAR models: add a parameter representing the constant in the development of the var_expectation operator 2021-07-21 17:53:55 +02:00
Sébastien Villemot 1a5fb4d5e6
DynamicModel: make PAC data members private 2021-07-21 17:53:55 +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
Sébastien Villemot 1cf03a5f07
Cosmetic improvement 2021-07-21 17:53:54 +02:00
Sébastien Villemot 5498ce98ee
Use NumConstNode* type for DataTree constants (previously they were just expr_t) 2021-07-21 17:53:54 +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 ed31d1cb5e
Remove unused functions 2021-07-21 16:33:23 +02:00
Sébastien Villemot 6ae3d3131f
Occbin: handle external functions in “occbin_constraints” 2021-07-21 16:33:19 +02:00
Sébastien Villemot 0d6eb053d4
Ensure that “pac_expectation” operators are never inserted into a static model
The implementation of PacExpectationNode::toStatic() did not make sense. It
should normally never be called, hence we error out at this point.

Also do a cosmetic change in the PacExpectationNode::clone() methode.
2021-07-21 16:33:14 +02:00
Sébastien Villemot b16ab9b247
Fix preprocessor crash when a [static] equation contains a “var_expectation” operator
Rather error out with a meaningful message.
2021-07-21 16:33:09 +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 0b8e3345fc
Ensure that a tag is not declared twice in the same equation
Previously the first value was silently ignored. It’s better to explicitly
forbid this. If this change creates problems (since it’s a change in an
undocumented behaviour), we can turn it into a warning.
2021-07-20 14:56:48 +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 90b1235a64
New utility to check if an expression contains an exogenous (possibly deterministic) 2021-07-20 12:10:58 +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
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 2e696a2e0d
Add shocks(surprise) block (for occbin)
Ref. #68
2021-07-13 21:55:31 +02:00
Sébastien Villemot f0002c5ac6
Fix compiler warning introduced by 61b37942ab 2021-07-13 17:18:06 +02:00
Sébastien Villemot c3b0ce8e69
shocks/mshocks/conditional_forecast_paths: various cleanups 2021-07-13 17:17:57 +02:00
Sébastien Villemot 5624260a07 Merge branch 'occbin_rebase' into 'master'
First part of Occbin interface

See merge request Dynare/preprocessor!42
2021-07-13 13:38:26 +00:00
Johannes Pfeifer 61b37942ab First part of Occbin interface 2021-07-13 13:38:25 +00:00
Sébastien Villemot c9c36c037a
New preprocessor option “nocommutativity”
This option tells the preprocessor not to use the commutativity of addition and
multiplication when looking for common subexpressions.

As a consequence, when using this option, equations in various outputs (LaTeX,
JSON…) will appear as the user entered them.

There is however a potential performance cost to using this option, yet to be
determined.

Ref. dynare#1788
2021-07-13 14:35:10 +02: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 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 f7a367d7b1
“var_model” statement: make “eqtags” option mandatory 2021-07-08 12:55:40 +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 c9d6d9c6f8
Enforce non-positivity of the “time_shift” option to “var_expectation_model”
Closes: #70
2021-07-06 16:40:20 +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
Sébastien Villemot 5a33699f03
VAR / trend component models: cosmetic changes 2021-07-01 17:52:05 +02:00
Sébastien Villemot 700dd31d57 Merge branch 'mom_varlist' into 'master'
method_of_moments: remove var_list_

Closes #69

See merge request Dynare/preprocessor!44
2021-06-28 09:32:07 +00:00
Sébastien Villemot e6e25a5c87
macOS: fix detection of GCC installed by Dynare package
Since the preprocessor has moved, the relative path of the local Homebrew needs
to be adjusted.
2021-06-24 15:16:55 +02:00
Johannes Pfeifer f354458418 method_of_moments: remove var_list_ 2021-06-24 15:10:24 +02:00
Sébastien Villemot 1c3e6f89af
macOS: bump to GCC 11 (for compilation and for use_dll) 2021-06-24 12:34:29 +02:00
Sébastien Villemot e80215e377
Macroprocessor slides: various improvements 2021-06-18 17:29:46 +02:00
Sébastien Villemot 824433aa3f
Refactor driver output for heteroskedastic_shocks
Ref. dynare#1791
2021-06-15 12:53:40 +02:00
Sébastien Villemot a5d653a5f1 Merge branch 'ramsey_k_order' into 'master'
Allows to write M_.objective_tmp_nbr in the driver.m file

See merge request Dynare/preprocessor!41
2021-06-14 13:22:12 +00: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 04f242f971
xls_sheet option: allow quoted strings as value
Closes: #67
2021-05-31 18:18:25 +02:00
Johannes Pfeifer 4b401e6253
Preparations for Occbin MR
Related to https://git.dynare.org/Dynare/dynare/-/merge_requests/1863
2021-05-31 15:12:46 +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 1e9ea1acf4 Merge branch 'smoother_redux' into 'master'
Add smoother_redux option

See merge request Dynare/preprocessor!38
2021-05-27 14:55:35 +00:00
Johannes Pfeifer 2a8726fe6e Add kalman_algo and filter_covariance to calib_smoother 2021-05-27 16:42:10 +02:00
Johannes Pfeifer 0d635aed36 Add smoother_redux option 2021-05-27 16:41:36 +02:00