Commit Graph

3068 Commits (93dcf5031b3b98490e72c4eb123c87e53868191b)

Author SHA1 Message Date
Sébastien Villemot 93dcf5031b
Bump to C++20 standard (with GNU extensions)
In practice, for the time being, we limit ourselves to C++20 features available
in GCC 10 and clang 12 (the latter because of the Julia infrastructure).
2022-05-04 17:37:02 +02:00
Sébastien Villemot ef02b79486
Various minor simplifications 2022-05-04 17:36:59 +02:00
Sébastien Villemot e0c3cb72b7
No longer link against libstdc++fs
That requirement was dropped in GCC 9.
2022-05-04 17:11:44 +02:00
Sébastien Villemot 3a820fffa2
New += and *= syntaxes in “endval(learnt_in=…)” blocks
Incidentally, forbid exogenous deterministic variables in “endval” blocks.
2022-05-03 16:52:04 +02:00
Sébastien Villemot 8c07fb5e43
Compatibility fix for GCC 12
Ref. dynare#1852
2022-05-02 17:03:42 +02:00
Sébastien Villemot 32761173e0
Add solve_algo, markowitz, maxit and tolf options to pfwee_setup 2022-04-29 15:53:26 +02:00
Sébastien Villemot 6509bc7d36
Allow “learnt_in=1” for “shocks” and “endval”
In that case, the option has no effect.
2022-04-29 11:17:11 +02:00
Sébastien Villemot 76a16a69a8
New “add” and “multiply” keywords in “shocks(learnt_in=…)” block 2022-04-26 15:21:45 +02:00
Sébastien Villemot dbe14ecfd4
Add checks on the value of the “learnt_in” option of “shocks” and “endval” 2022-04-26 11:45:22 +02:00
Sébastien Villemot e47ea565b9
Use booleans for “exo_det” and “multiplicative” fields of M_.det_shocks 2022-04-26 11:32:07 +02:00
Sébastien Villemot 8e3590ee71
Reject exogenous deterministic variables in a few places where they were erroneously accepted
– heteroskedastic_shocks block
– generate_irfs command
– new estimation syntax
2022-04-21 17:59:04 +02:00
Sébastien Villemot 516f0bf41f
Fix bug in new estimation syntax introduced in 7280c92642 2022-04-21 17:38:41 +02:00
Sébastien Villemot b5a4df1608
New shocks(learnt_in=…) and endval(learnt_in=…) blocks
For use with perfect_foresight_with_expectation_errors_setup.
2022-04-21 17:07:33 +02:00
Sébastien Villemot 54ca5d9cc0
Improve messages during model normalization
– Indicate whether we are trying to normalize the static or dynamic model
– If failed to normalize the static model, suggest to use the “no_static”
  option
– Remove a superfluous error message
2022-04-19 17:11:13 +02:00
Sébastien Villemot 894f5cda46
Macro-processor: more robust handling of empty files
The support for empty files at the macro-processor level, as implemented in
1291320053, was relying on
basic_streambuf::in_avail(), which does not seem to behave consistently across
platforms, and which may not be the right tool for the job.

Rather use the Bison grammar to support empty files.

Closes: #93
2022-04-19 16:40:18 +02:00
Sébastien Villemot 285a4389a3 Merge branch 'macro_doc' into 'master'
macroprocessor.tex: update slides

See merge request Dynare/preprocessor!59
2022-04-14 15:58:34 +00:00
Johannes Pfeifer e85d085ae8 macroprocessor.tex: update slides 2022-04-14 17:53:15 +02:00
Sébastien Villemot 8064bdc7d0
Use Unicode copyright symbol (in UTF-8 encoding)
This file was apparently a left-over from a previous conversion.

[skip ci]
2022-04-13 13:24:33 +02:00
Sébastien Villemot acaabd59da
New option “constant_simulation_length” to “perfect_foresight_with_simulation_errors_solver” command 2022-04-12 15:26:04 +02:00
Sébastien Villemot 0a3782df8c
Fix error in grammar for options of “perfect_foresight_with_expectations_errors_solver” 2022-04-12 15:26:04 +02:00
Sébastien Villemot a431682697
Fix check for the presence of ramsey_{model,policy} when ramsey_constraints is used
The existing check would incorrectly fail if ramsey_constraints appeared before
ramsey_{model,policy}.

Also, the check would not terminate the processing in case of error.

Closes: #91
2022-04-11 12:28:38 +02:00
Sébastien Villemot 621134b8d8
Julia: more adaptation of DynamicSetAuxiliarySeries.jl for TimeDataFrame objects
– also use vectorized versions for .+ and .-
– add a space before vectorized operators to avoid syntactical ambiguity

This commits complements bfdcc546ec.
2022-04-08 15:06:29 +02:00
Sébastien Villemot bfdcc546ec
Julia: adapt DynamicSetAuxiliarySeries.jl for TimeDataFrame objects 2022-04-01 17:34:37 +02:00
Sébastien Villemot 71edfd05e4
Add new “log” option to “var” statement
When an endogenous is declared with “var(log)”, say “y”:
– creates an auxiliary named “LOG_y”
– replaces “y(±l)” everywhere by “exp(LOG_y(±l))”
– adds a new auxiliary equation “y=exp(LOG_y)”
– adds a new definition “LOG_y=log(y)” in set_auxiliary_variables.m and
  dynamic_set_auxiliary_series.m files

This option also works in conjunction with “deflator=…”, such as “var(log,
deflator=…)” (the “log” must appear befor “deflator”). There are no provisions
for combining “log” with “log_deflator”, because that would not make much sense
from an economic point of view (amounts to taking the log two times).

Ref. dynare#349
2022-03-30 17:46:07 +02:00
Sébastien Villemot ee14027e1b
Remove duplicate functions for setting current parser data tree to dynamic model 2022-03-30 17:27:08 +02:00
Sébastien Villemot 40398425ae
Refactor some symbol declaration helpers so that they return the symbol ID
This avoids useless calls to SymbolTable::getID().
2022-03-29 16:44:04 +02:00
Sébastien Villemot 46cc47266b
Refactor parsing of symbol lists
For symbol lists (such as those given to “var” or “stoch_simul”), return a
semantic value at the Bison level, rather than building the list through a
temporary object in ParsingDriver. This allows various simplifications, and
leads to a more functional code.

By the way, homogeneize the naming of the various flavours of symbol lists in
the Bison file (with TeX names, partitioning, or with a wildcard).
2022-03-29 14:59:34 +02:00
Sébastien Villemot 7fff8b3406
Fix detection of nonlinearity of blocks of type “Solve backward/forward simple”
They were always marked as linear.
2022-03-15 16:47:03 +01:00
Sébastien Villemot 9db21a231c
Handle “resid” command at the preprocessor level and add “non_zero” option 2022-03-01 14:23:18 +01:00
Sébastien Villemot 11a81e3047
Add a couple of missing “explicit” keywords on single-argument constructors 2022-03-01 12:15:03 +01:00
Sébastien Villemot 17c5e1935d
Fix error message when “ramsey_policy” follows a “ramsey_model” statement
By the way, also fix error message when there are several “ramsey_model” or
“ramsey_policy” statements.

Closes: #90
2022-02-21 16:45:56 +01:00
Sébastien Villemot b78ac1d31f
Bytecode: fix temporary terms for dynamic derivatives in “evaluate” mode
The temporary terms for dynamic derivatives were only computed in the
“simulate” mode.
2022-02-18 12:38:06 +01:00
Sébastien Villemot cb78300e95
Transform predetermined variables before simplifying equations
Equation simplification takes leads/lags into account, so those need to be
correct upon entry of the procedure.
2022-02-17 18:27:08 +01: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 7df6781982
Add interface for “static” and “incidence” options of “model_info” 2022-02-09 12:26:00 +01:00
Sébastien Villemot adab6c7f93
Comment improvement + cosmetics 2022-01-28 17:24:48 +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 28f89261ab
Minor simplification of SymbolTable::addDiffAuxiliaryVar()
For symmetry with SymbolTable::addUnaryOpAuxiliaryVar().
2022-01-28 16:01:44 +01:00
Sébastien Villemot a93e264c2c
Harmonize “diffForward” auxvar with “diff” auxvar by giving it an orig_lead_lag as well
By the way:
– Fix and improve the explanation of the purpose of the orig_symb_id and
  orig_lead_lag fields for auxvars
– Factorize the code that prints those fields in MATLAB and JSON output
2022-01-28 15:53:41 +01:00
Sébastien Villemot 289b4773d7
Fix matching of diff leads/lags in TCM and PAC models
The logic was flawed in several ways. In particular, the test files
pac/trend-component-{3,10,11}/example1.mod would return A0 and A0star matrices
where the (2,2) element was incorrectly zero.
2022-01-28 15:53:41 +01:00
Sébastien Villemot b709da7f17
Fix SymbolTable’s getOrigSymbIdForAuxVar() and getUltimateOrigSymbID() so that they never return -1
The case of a diff aux var corresponding to a complex expression was not
correctly handled, and could lead to a value -1 being returned by these
methods.
2022-01-28 15:53:39 +01:00
Sébastien Villemot 2c84d500d9
Add GDB pretty-printer for ExprNode class hierarchy 2022-01-26 15:40:40 +01:00
Sébastien Villemot ff0e094d6f
Macroprocessor: MinGW bug for filesystem::path→string implicit conversion is still present in Debian 11 2022-01-25 12:57:12 +01:00
Sébastien Villemot 3d894b3a47
Macroprocessor: under Windows, trim trailing slashes and backslashes in the value of “@#includepath”
This is a  workaround for a GCC/MinGW bug present in version 10.2
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88881), that affects
gcc-mingw-w64 in Debian “Bullseye” 11. It is fixed in GCC 10.3, and thus should
be fixed in Debian “Bookworm” 12.

Ref. Madysson/estimation-codes#11
2022-01-25 12:57:09 +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
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