Commit Graph

3093 Commits (fix-tolerance-parameters)

Author SHA1 Message Date
Stéphane Adjemian (Ryûk) 462dceec46
dynatol.{f,x} -> simul.tol{x,f}. 2022-05-19 09:51:42 +02:00
Sébastien Villemot 2483639f4d
Fix bug introduced in 3516894a71 related to new estimation syntax 2022-05-18 19:27:00 +02:00
Sébastien Villemot 3516894a71
JSON output: fix handling of vector value options
The vectors were previously stored as strings internally, which would not
necessarily contain the commas which are required in JSON (but not in
MATLAB/Octave). The fix consists in internally storing those options as
std::vector.

Closes: #96
2022-05-18 17:44:36 +02:00
Sébastien Villemot 5b50c10229
Simplify OptionsList::writeJsonOutput() 2022-05-18 16:33:49 +02:00
Sébastien Villemot 29c683c6ad
JSON output: add missing comma for paired numerical options 2022-05-18 16:33:49 +02:00
Sébastien Villemot d64682f346
JSON output: fix possible spurious commas in vector of int or string options 2022-05-18 16:33:49 +02:00
Sébastien Villemot 2c92057d75
Activate more compiler warnings with -Wextra
However, disable -Wunused-parameter which creates too many false positives in
polymorphic methods.

Also, only disable -Wdangling-else instead of the whole of -Wparentheses.
2022-05-18 16:33:49 +02:00
Sébastien Villemot 2795207802
No longer delete move constructor/assignment operator
We follow the advice given by Josuttis in his book about move semantics.

Deleting those member fuctions can be a bug if we want to allow copy semantics,
because overload resolution will no longer fallback to the copy
constructor/assignment operator when given an rvalue.

In particular, this explain why it was not possible to delete the move
assignment operator of the StaticModel class.
2022-05-18 16:33:48 +02:00
Sébastien Villemot c6007aa780
C++17 modernization: use [[fallthrough]] attribute
This disables warnings when -Wimplicit-fallthrough is used (enabled by -Wextra).
2022-05-18 16:33:48 +02:00
Sébastien Villemot 701db61e09
JSON output: fix several bugs related to switch/case fallthrough 2022-05-18 16:33:42 +02:00
Sébastien Villemot ae97c4eb29
Factorization in OptionsList class 2022-05-17 18:08:10 +02:00
Sébastien Villemot 3e94250582
C++17 modernization: use std::optional in ExprNode::getPacOptimizingShareAndExprNodes() 2022-05-16 19:10:16 +02:00
Sébastien Villemot 0eb11d3323
C++17 modernization: use std::optional in expression matching functions 2022-05-16 19:10:16 +02:00
Sébastien Villemot 3496d77eb4
C++17 modernization: use std::optional to store orig diff vars in VAR and TCM
By the way, remove the unused TrendComponentModelTable::getOrigDiffVar() method.
2022-05-16 19:10:16 +02:00
Sébastien Villemot 34aa1d3bb4
Fix comment 2022-05-16 19:10:16 +02:00
Sébastien Villemot 06d05e9a8d
C++17 modernization: use std::optional for SymbolTable::getEquationNumberForMultiplier() 2022-05-16 19:10:16 +02:00
Sébastien Villemot fa7a926143
C++17 modernization: use std::optional for the storage of orig_symb_id and orig_lead_lag in SymbolTable
For the diff and unaryOp auxvar types, these value may be set or unset
depending on the complexity of the expression represented by the auxvar.
2022-05-16 19:10:15 +02:00
Sébastien Villemot 8fd1505ca2
C++17 modernization: use std::optional for “periods” option of “plot_conditional_forecast”
Incidentally, in the JSON output, no longer assign a value to the “periods”
field if not passed by the user (previously the value -1 was output in the JSON
file).
2022-05-16 19:10:15 +02:00
Sébastien Villemot fc037a4352
Simplify printing of booleans using std::boolalpha 2022-05-16 19:10:15 +02:00
Sébastien Villemot 92d3b8166a
C++17 modernization: use std::optional for equation line numbers 2022-05-16 19:10:15 +02:00
Sébastien Villemot 0b51294994
C++17 modernization: use std::optional for trend variables in TCM 2022-05-16 19:10:15 +02:00
Sébastien Villemot fb3b1c301f
endval(learnt_in=…) block: fix treatment of unused endogenous variables 2022-05-06 12:56:24 +02:00
Sébastien Villemot 46a85644d8
C++20 modernization: update comment about workaround for clang 2022-05-04 17:37:58 +02:00
Sébastien Villemot 7bd449d6c3
C++20 modernization: use new std::erase_if function 2022-05-04 17:37:58 +02:00
Sébastien Villemot b42ee40b55
C++20 modernization: use contains() method on containers 2022-05-04 17:37:57 +02:00
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