Commit Graph

191 Commits (master)

Author SHA1 Message Date
Stéphane Adjemian (Charybdis) 0f268ce70c
Fixed logic.
Value passed to steady_state_growth was not acknowledge.
2020-09-18 11:11:50 +02:00
Sébastien Villemot 09054e11dc
Add new “matched_moments” block
Closes: #51
2020-07-28 18:30:24 +02:00
Johannes Pfeifer 5cc9f216ca Make preprocessor recognize default order=2 of stoch_simul 2020-07-21 10:40:08 +02:00
Johannes Pfeifer 98ddbb61ba Method of moments: Preprocessor preparations 2020-07-10 11:18:57 +02:00
Sébastien Villemot becc433d56
Rename byte_code to bytecode for consistency with user option name 2020-05-20 11:39:59 +02:00
MichelJuillard ed4c36a267 add first_simulation_period to the lexer
(cherry picked from commit c8575e11d2f81ad606ab50849c52127653699a93)
2020-05-14 14:36:35 +00:00
Houtan Bastani 7371558321
rework equation tags
Create new EquationTags class to simplify use of equation tags throughout the code and avoid repeated code

issue #38
2020-02-21 17:49:38 +01:00
Sébastien Villemot c4a9f93d40
Do not allow the estimation of a parameter that appears in “planner_discount”
Ref. dynare#1173
2020-02-04 17:49:53 +01:00
Sébastien Villemot ee972d9638
Fix “planner_discount” option of “discretionary_policy”
Since fe0c781c06, the discount factor would
always be equal to one.

Ref. dynare#1699
2020-01-30 15:42:39 +01:00
Sébastien Villemot e2d5a83592
Global reindentation 2019-12-20 16:59:30 +01:00
Houtan Bastani 0cd59dbcf8
bug fix: clear symbol list and options list after call to `DetCondForecast` constructor
issue #39
2019-12-20 14:51:16 +01:00
Houtan Bastani 32c3910e18
allow symbol list to accept auxiliary variables
dynare#1355
2019-12-20 14:51:15 +01:00
Sébastien Villemot fe0c781c06
New “planner_discount_latex_name” option of “ramsey_policy”
Accepts a TeX name, as for variable declarations (i.e. enclosed within dollar
signs).

Ref. dynare#1686
2019-12-18 17:32:41 +01:00
Sébastien Villemot c2461981d2
Various provisions for improvements to shock decomposition commands
– New “squeeze_shock_decomposition” command
— New “max_nrows” option to “plot_shock_decomposition” and
  “initial_condition_decomposition”
— “plot_shock_decomposition” now returns oo_ as an output argument

Ref. dynare#1687, dynare!1655
2019-12-18 11:39:44 +01:00
Sébastien Villemot 031c0cff5f
Various code simplifications and modernizations 2019-12-16 19:42:59 +01:00
Houtan Bastani 2646f01424
fix quotes from 7958f76fae 2019-12-13 16:03:37 +01:00
Houtan Bastani fddfb7fe2f
Issue deprecation warning for `simul`
closes dynare#1683
2019-12-13 16:01:47 +01:00
Houtan Bastani 7958f76fae
issue deprecation warning for `ramsey_policy`
dynare#1678
2019-12-12 11:36:43 +01:00
Houtan Bastani 8dfa79a0f5
new command `evaluate_planner_objective`
dynare#1678
2019-12-12 11:35:26 +01:00
Houtan Bastani 3f3ef7ca00
fix bugs in initial_condition_decomposition statement
closes #37
2019-12-06 10:40:44 +01:00
Houtan Bastani 02cb4cc973
add compiler statement
Allows the user to set the compiler, flags, and libs to be used with `use_dll`

Issue #35
2019-12-04 16:57:20 +01:00
Houtan Bastani 4a1fb239da
Add interface for init2shocks
Dynare/dynare#1650
2019-12-02 13:58:44 +01:00
Sébastien Villemot d008113d69
Forbid exogenous and exogenous deterministic variables in STEADY_STATE operator
Closes: dynare#825
2019-11-27 17:27:04 +01:00
Dóra Kocsis c23e136f93 Revert "Merge branch 'master' into 'master'"
This reverts commit 3ae92499b8, reversing
changes made to 3ec01b8612.
2019-11-26 16:46:12 +01:00
Dóra Kocsis 8bfcefe7fb Add interface for forecast_shock_decomposition. Dynare/dynare#1657 2019-11-25 17:08:59 +01:00
Sébastien Villemot 5a5817b4fe
Improvements to the test for balanced growth path
— Raise the default tolerance for cross-derivatives to 1e-6, to reduce the
  number of false positives

— New option “balanced_growth_test_tol” to the “model” block for changing that
  tolerance

— Turn back test failures into errors. Since there is now an option for
  controlling the tolerance, the user always has the possibility of making the
  test pass.

Closes: dynare#1389
2019-11-14 17:55:17 +01:00
Houtan Bastani 9e454debb5
support external functions in MATLAB namespace. closes dynare#1639 2019-10-09 14:49:05 +02:00
Houtan Bastani 1fcd305015
allow for expressions as upper bound for irf_calibration and moment_calibration. Closes #12 2019-09-30 12:22:59 +02:00
Houtan Bastani ae0a91256a
add cubic root to dynare language 2019-07-15 12:18:26 -04:00
Sébastien Villemot 1907249fac
Ask GCC to warn about C-style casts (-Wold-style-cast)
Adapt the code accordingly.
2019-04-23 12:54:11 +02:00
Sébastien Villemot b73d554ad2
Use Unicode copyright symbol (in UTF-8 encoding) 2019-04-16 11:35:31 +02:00
Houtan Bastani a3fc7a7752
pac_model: fix input tests 2019-03-04 11:07:06 +01:00
Stéphane Adjemian (Charybdis) 34f02a37e3
Fixed logic in pac_model command.
If option aux_model_name is assigned a value, this value must not be
discarded if options growth and steady_state_growth are simultaneously
used.
2019-03-02 16:37:00 +01:00
Houtan Bastani 341b9c6667
pac_model: allow diff as argument to growth option 2019-02-28 19:22:34 +01:00
Stéphane Adjemian (Charybdis) abde60fbea
pac: Changed logic of the tests on growth and steady_state_growth options. 2019-02-25 16:21:30 +01:00
Stéphane Adjemian (Charybdis) b8f756fa35
Fixed option name in error message. 2019-02-22 23:11:06 +01:00
Houtan Bastani 469a328cfc
replace make_pair and make_tuple 2019-02-21 10:42:10 +01:00
Houtan Bastani af54c7a187
ensure steady_state_growth option is a parameter or a number 2019-02-19 14:08:37 +01:00
Houtan Bastani fe69dced1d
fix check for pac_model growth option introduced in 0ea84fa9a4 2019-02-18 17:23:33 +01:00
Houtan Bastani 0ea84fa9a4
pac: allow steady state growth and model consistent expectation substitution in pac equation 2019-02-18 15:11:45 +01:00
Houtan Bastani 71be51c464
pac_growth: ensure symbol has been declared 2019-01-28 10:45:48 +01:00
Houtan Bastani d922ae8ffc
pac_model: permit lag on growth option 2019-01-25 14:52:26 +01:00
Houtan Bastani bb624ec6a7
epilogue: allow for simulations in epilogue block 2018-12-19 16:09:30 +01:00
Sébastien Villemot 38152c34a4
Make histval compatible with diff operator
The idea is to make use of the dynamic_set_auxiliary_dseries.m file to generate
the initial conditions for all auxiliary variables, including the diffs.

Also remove the check done by the preprocessor for the lags in histval, since
it does not work correctly with the diff operator.
2018-12-11 17:32:05 +01:00
Houtan Bastani aad8414f94
allow the use of previously assigned variables in epilogue block in later equations in epilogue block 2018-12-10 16:30:19 +01:00
Houtan Bastani 9d3f104b8c
fix epilogue block 2018-12-10 12:27:27 +01:00
Sébastien Villemot 018068de91
Fix typo 2018-12-03 17:29:53 +01:00
Sébastien Villemot a08ce3de2b
Yet more simplifactions using std::tuple 2018-12-03 16:07:13 +01:00
Sébastien Villemot 67ac4bf8ea
Allow diff() and log() in "expression" option of var_expectation_model 2018-11-29 16:01:49 +01:00
Sébastien Villemot e9341c7153
Implement option "expression" of var_expectation_model
The data structure written in the driver file is changed also in the case of
the "variable" option.
2018-11-28 17:33:59 +01:00
Sébastien Villemot b88e0de53f
Remove useless accessor methods for data members that are const in ExprNode classes
Those const data members are simply made public.
2018-11-28 14:35:30 +01:00
Houtan Bastani 989532a6a2
add `string`, vec_str key/value option to posterior_sampler_options 2018-11-09 15:11:15 +01:00
Sébastien Villemot f2cf86b734 Add copy constructors / assignment operators for the DataTree class hierarchy
In particular, it is necessary to turn back DataTree::AddVariable() into a
non-virtual method, because it is called from DataTree's constructor. Enforcing
the absence of leads/lags is now done using a new boolean DataTree::is_static.

Take advantage of the new copy constructor for handling
PlannerObjectiveStatement more elegantly.

Unfortunately it is not possible to implement *move* constructor / assigment
operators, because the reference ExprNode::datatree is not mutable.
2018-10-10 12:53:55 +02:00
Sébastien Villemot 215283005e No longer store symbol type in VariableNode
This facilitates switching variable types on the fly. In particular, this
allows removing the hack in DynamicModel::updateAfterVariableChange() that way
basically recreating all the nodes after the type change.
2018-10-10 12:34:05 +02:00
Sébastien Villemot 48940ff899 Convert SvarRestrictionType into a class enum 2018-10-02 18:15:31 +02:00
Sébastien Villemot 3f26933f44 Replace ExternalFunctionSetOrNot enum by integer constants
This was not conceptually an enum, but rather a collection of unrelated
constants:
- two constants for use as placeholder for symbol IDs at different places
- one constant for the default number of arguments
2018-10-02 18:10:12 +02:00
Ferhat Mihoubi 139e3efa82 Adds a new model option "linear_decomposition" that creates a block composed of the non-linear equations o the model 2018-09-28 14:54:52 +02:00
Houtan Bastani 85dbb649b7 move trend_component_table and var_model_table to DynamicModel as they are only used there 2018-09-14 17:04:06 +02:00
Houtan Bastani eb74d48393 trend_component_model: replace `trends` option with `targets` 2018-09-13 12:21:23 +02:00
Sébastien Villemot 5d2e1cf7b9 Use smart pointers for storage of Statement in ModFile class 2018-09-05 18:28:27 +02:00
Houtan Bastani 9f0c30740e introduce epilogue block 2018-09-05 12:31:49 +02:00
Stéphane Adjemia (Scylla) a406c18598 Allow trend_component_model in var_expectations. 2018-08-22 16:50:01 +02:00
Houtan Bastani 539fddc9f6 introduce var model table 2018-08-22 12:15:02 +02:00
Houtan Bastani 6015b0e57b fixes to trend component model 2018-08-22 12:15:02 +02:00
Houtan Bastani afe0e475b1 trend_component_model statement 2018-08-17 16:52:48 +02:00
Sébastien Villemot f3c2a1bf87 New var_expectation_model statement and re-design of var_expectation operator
Given a previously declared var_model, the var_expectation_model statement is
used to declare a way of forming expectations with this VAR (possibly using a
finite or infinite discounted sum). The var_expectation operator now takes a
single argument, the name of the var_expectation_model.

For the moment, this only works when the var_model is using equations
explicitly declared in the model block.
2018-08-02 08:39:09 +02:00
Sébastien Villemot 8a03532c78 ParsingDriver: factorize code to check symbol types 2018-08-01 10:47:56 +02:00
Sébastien Villemot 122e154764 PlannerObjectiveStatement now owns its model_tree
By the way, error out if the planner_objective statement is used two times.
2018-07-31 13:00:41 +02:00
Sébastien Villemot 0a063eecc1 More smart pointers 2018-07-31 13:00:39 +02:00
Sébastien Villemot 7280c92642 Use variant semantic values in the Bison parser
We can therefore manipulate objects by value rather than by pointers, which
saves a lot of memory manipulations (and avoid potential segfaults and memory
leaks).

Note that there is no default action ("$$ = $1") when using the variant type,
so we add them explicitly.
2018-07-31 11:48:08 +02:00
Stéphane Adjemian(Charybdis) 49e1c43aed Partially reverted 19048bdca.
There is no reason to associate an exogenous variable or parameter to a
specific equation. For these types the user can use the pipe
notation (|x, |p) in any equations or the usual parameters and varexo statements.
2018-07-19 23:29:27 +02:00
Sébastien Villemot 14948401e4 C++11: convert PriorDistributions to a class enum 2018-07-18 16:52:12 +02:00
Sébastien Villemot 4ad0e500d4 C++11: convert {Unary,Binary,Trinary}Opcode to class enums 2018-07-18 16:18:26 +02:00
Sébastien Villemot d6055c1407 C++11: convert SymbolType to a class enum 2018-07-17 18:55:26 +02:00
Houtan Bastani e0bf2b60b6 Modify 19048bdcae to store equation tags for variables declared in equation tags 2018-07-09 14:49:12 +02:00
Houtan Bastani 19048bdcae Allow for the declaration of endogenous, exogenous, parameters on-the-fly in equation tags 2018-07-09 14:39:13 +02:00
Sébastien Villemot 30c205f418 C++11: replace calls to std::atof() by std::stod() 2018-07-04 14:53:13 +02:00
Sébastien Villemot 5e1d722013 C++11: replace most calls to std::atoi() by std::stoi()
The latter accepts a std::string as argument.
2018-07-04 14:53:08 +02:00
Sébastien Villemot 272d36a37c Remove useless casts of nullptr 2018-06-04 16:39:01 +02:00
Sébastien Villemot 608c43450c Replace most calls to make_pair by braced-initializer lists or emplace()/emplace_back() 2018-06-04 16:36:46 +02:00
Sébastien Villemot 182c53273e Remove useless spaces in type qualifiers
In C++11, it is no longer necessary to put a space between two consecutive ">".
2018-06-04 15:03:31 +02:00
Sébastien Villemot 1e56c73377 Port to C++11 nullptr keyword
Performed using modernize-use-nullptr from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
2018-06-04 15:03:31 +02:00
Sébastien Villemot 33b1359905 Port to C++11 emplace_back() method on containers
Performed using modernize-use-emplace from clang-tidy.

Manual intervention was needed to transform a NULL into nullptr in SymbolTable.cc.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-emplace.html
2018-06-04 15:03:31 +02:00
Sébastien Villemot c0ed97d247 Port to C++11 auto keyword
Performed using modernize-use-auto from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html
2018-06-04 15:03:26 +02:00
Sébastien Villemot 6cf4e6dc0c Port to C++11 range-based for loops
Performed using modernize-loop-convert from clang-tidy.

Manual intervention was needed in MacroValue.cc because of a variable name
capture issue.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-loop-convert.html
2018-06-04 12:26:16 +02:00
Houtan Bastani fb8d9258d0 add pac_model statement 2018-04-04 11:48:59 +02:00
Houtan Bastani db1f6c2998 Modify changes from on-the-fly branch 2018-03-20 11:03:46 +01:00
Houtan Bastani 80060fb9ef Merge remote-tracking branch 'origin/declare_vars_in_model_block' 2018-03-19 17:05:03 +01:00
Houtan Bastani 4897ab7d69 clean up adl code 2018-02-28 11:31:08 +01:00
Houtan Bastani a1437ac982 Merge remote-tracking branch 'dynare-preprocessor-github/master' into other-master 2018-02-26 12:09:58 +01:00
Houtan Bastani b504f160ca move files to src directory 2018-02-15 11:48:04 +01:00