Commit Graph

2971 Commits (a210a8fd59a052abf2c67d264f0889ba2213043d)

Author SHA1 Message Date
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 1cc512962c
No longer consider an equation of the form “x(+1) = 0” as defining x to be a constant
Fix this by restricting the detection of constant equations to those where the
variable appears without a lead or lag.

Closes: #83
2021-11-19 18:01:11 +01:00
Sébastien Villemot b51f122e59
With nostrict, really ignore unused endogenous in initval/endval/histval
Closes: #82
2021-11-19 17:49: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 1e4eadb266
Macroprocessor: make the removal of “@#line” directives and extra newlines consistent across LF and CR+LF conventions
Simplify the algorithm using only regexps, and add comments.
2021-11-19 16:49:21 +01:00
Sébastien Villemot 1de3476546
Macroprocessor: fix line counter inside @{} constructs
There were two bugs:
– with the LF convention, newlines were counted twice
– with the CR+LF convention, they were counted four times (because the CR was
  included in yyleng, alongside the LF)

The fix consists in implementing a location_increment() method similar to the
one used for the Dynare parser. This is the most robust solution.

By the way, mark the method DynareFlex::location_increment() method static.
2021-11-19 14:55:14 +01:00
Sébastien Villemot 487c372900
Macroprocessor: fix newlines in output when under Windows and input uses CR+LF convention
If the input .mod file uses CR+LF convention, and if the user is under Windows,
then the output of the macroprocessor (as given by the “savemacro” option) had
incorrect end of lines: those would be CR+CR+LF.

The reason is that some TextNode(s) internally created by the macroprocessor
would themselves contain CR+LF sequences, which would then be transformed into
CR+CR+LF in the output (because MinGW transforms LF into CR+LF in output
streams).

The fix consists in changing the nature of the EOL token: the parsed text is no
longer attached to it, so that the Bison file now systematically turns it into
a LF inside TextNode(s).

Closes: #80
2021-11-19 14:55:12 +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 6ad3d02ec6
Minor simplification in ExprNode::matchLinearCombinationOfVariables() 2021-10-29 15:39:40 +02:00
Sébastien Villemot c4e9432eef
Remove implementation of various methods of PacExpectationNode
Those implementations are dummy and are normally never used. Rather error out
on those, factorizing them within SubModelNode.
2021-10-29 14:11:30 +02:00
Sébastien Villemot 3e242dd481
New class SubModelNode to factorize between VarExpectationNode and PacExpectationNode 2021-10-29 14:11:30 +02: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 0123326123
Fix error message when using pac_expectation with occbin_constraints
By the way, also fix the argument name (the model is not a VAR).
2021-10-29 14:11:08 +02:00
Sébastien Villemot bc827326eb
JSON: fix syntax error in the aux vars table introduced in a7fb198463 2021-10-26 12:31:01 +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
Sébastien Villemot 4191cec9aa Merge branch 'master' into 'master'
Master

See merge request Dynare/preprocessor!53
2021-10-08 13:42:16 +00:00
Sébastien Villemot 8bb8e59410
Improve message for GCC installation under macOS 2021-10-08 12:59:17 +02:00
MichelJuillard a7fb198463 add field aux_vars to modfile.json 2021-10-08 09:26:49 +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 9938cb2632 Merge branch 'ramsey_logic' into 'master'
ramsey_model: Fix error message logic

See merge request Dynare/preprocessor!52
2021-09-24 14:20:34 +00: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 d1acee0631 Merge branch 'mh_mode' into 'master'
Rename mh_mode to correct mh_posterior_mode_estimation option

Closes #60

See merge request Dynare/preprocessor!51
2021-09-21 16:09:01 +00:00
Johannes Pfeifer 8d14e18cdb Rename mh_mode to correct mh_posterior_mode_estimation option
Closes https://git.dynare.org/Dynare/preprocessor/-/issues/60
2021-09-21 17:28:37 +02:00
Sébastien Villemot b12746190d
ramsey_{model,policy}, discretionary_policy: check that instruments are declared endogenous
Closes: #72
2021-09-21 17:17:36 +02:00
Sébastien Villemot 3d215020ae
Fix use_dll on macOS + Octave
Enforce GCC with mkoctfile. Otherwise Clang will be used, and it does not
accept our custom optimization flags.

Ref. dynare#1797
2021-09-13 16:50:13 +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
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 6863494db2
Ensure that the “discount” option of “pac_model” is a parameter
Ref. Madysson/estimation-codes#4
2021-08-31 12:52:00 +02:00
Sébastien Villemot 15658fda5c
Merge branch 'mom_namespace' of git.dynare.org:JohannesPfeifer/preprocessor
Ref. !50
2021-08-30 16:05:44 +02:00
Sébastien Villemot 297888ce72
Merge remote-tracking branch 'origin/updated_covariance'
Ref. !47
2021-08-30 16:05:13 +02:00
Stéphane Adjemian (Charybdis) 79d5a2d687
Fix warning (missing option in occbin_setup). 2021-08-18 15:18:21 +02:00
Stéphane Adjemian bb7f60b8fb Merge branch 'occbin_options' into 'master'
Occbin: Add missing options

See merge request Dynare/preprocessor!49
2021-08-16 09:59:42 +00:00
Johannes Pfeifer 3f37d9692c method_of_moments: move to namespace 2021-08-15 20:44:24 +02:00
Johannes Pfeifer 6fb86522ea Occbin: Add missing options 2021-08-10 20:28:32 +02:00
Sébastien Villemot f0c39b461e
Bump version number 2021-07-23 15:48:17 +02:00
Sébastien Villemot bb19d98712 Merge branch 'results_file' into 'master'
Move results file to output folder

See merge request Dynare/preprocessor!48
2021-07-23 11:58:46 +00:00
Johannes Pfeifer 361b789e88 Move results file to output folder 2021-07-22 19:36:12 +02:00
Johannes Pfeifer 38714a58c4 Add updated_covariance option
Related to https://git.dynare.org/Dynare/dynare/-/issues/1784
2021-07-22 17:12:02 +02:00
Sébastien Villemot 5cfe6303e2
Cosmetic changes 2021-07-22 16:49:59 +02:00
Sébastien Villemot 30972e44ef Merge branch 'smoother2histval' into 'master'
Introduce option consider_all_endogenous_and_auxiliary

See merge request Dynare/preprocessor!46
2021-07-22 10:21:03 +00:00
Johannes Pfeifer 5da01faa74 Introduce option consider_all_endogenous_and_auxiliary 2021-07-22 11:49:36 +02:00