Commit Graph

562 Commits (2b3519e3b07a0c6fb736524cfdca45a551591d7e)

Author SHA1 Message Date
Houtan Bastani 7e085855b3
macro processor: introduce string casts 2019-08-02 15:19:00 -04:00
Houtan Bastani 5442512904
macro processor: introduce double casts 2019-08-02 15:03:05 -04:00
Houtan Bastani 5fc83fad29
macro processor: introduce integer casts 2019-08-02 14:53:24 -04:00
Houtan Bastani 4a3423f74f
macro processor: fix typos 2019-08-02 14:34:50 -04:00
Houtan Bastani b286bedbb6
onlymodel now prints shock_groups block 2019-07-22 15:18:01 -06:00
Houtan Bastani 2c8d0471a4
normalizeEquation not implemented for PacExpectationNodes 2019-07-15 16:34:54 -04:00
Houtan Bastani 866e4d6d39
macro processor: introduce colon operator with three args
This introduces a shift/reduce compilation warning in the macro processor because at expr COLON expr . COLON expr the parser doesn’t know whether to shift or reduce
2019-07-15 16:29:04 -04:00
Houtan Bastani ae0a91256a
add cubic root to dynare language 2019-07-15 12:18:26 -04:00
Sébastien Villemot deb41a2a8f
Fix comment in previous commit 2019-07-11 18:39:32 +02:00
Sébastien Villemot e7b619c0ef
Fix handling of underflows and overflows in load_params_and_steady_state
Basically revert the change made in 30c205f418,
since it lead to preprocessor crashes (via C++ exceptions).
2019-07-11 18:35:42 +02:00
Sébastien Villemot 0988a1f755
Generated LaTeX files are now under <basename>/latex/ 2019-07-11 17:33:53 +02:00
Sébastien Villemot ac9d352a2c
use_dll under MATLAB: link only to libraries that are really needed 2019-07-11 16:11:24 +02:00
Sébastien Villemot 176732ee2c
ModelTree: pass argument by const-reference rather than by value in some methods 2019-07-05 18:41:13 +02:00
Sébastien Villemot 17c4104275
ExprNode::removeTrendLeadLag(): pass map argument by const-reference rather than by value 2019-07-05 18:22:24 +02:00
Sébastien Villemot 24d4b2dc77
identification command now accepts the order option
Note that this option does not modify the global options_.order, for
consistency with the semantics of the identification command.

The preprocessor will compute dynamic derivatives up to at least order+1.

Closes #10
2019-07-05 17:49:16 +02:00
Sébastien Villemot 4032942fa4
Add “diff” and “flip” options to plot_shock_decomposition and initial_condition_decomposition
Ref Dynare/dynare#1649
2019-07-03 16:28:00 +02:00
Houtan Bastani 1562016389 macro processor: handle case of functions without arguments 2019-06-27 16:47:48 +02:00
Houtan Bastani 06b835c2e0 aesthetic changes 2019-06-27 14:27:59 +02:00
Houtan Bastani 63b2117587 macro processor: remove unnecessary includes 2019-06-27 13:57:19 +02:00
Houtan Bastani 8b19565372 macro processor: prefer superfluous parenthesis when printing than printing with incorrect precedence 2019-06-27 11:48:03 +02:00
Houtan Bastani bde7c47117 macro processor: combine comprehension classes 2019-06-27 11:44:51 +02:00
Houtan Bastani 6686344acb
fix typos introduced in 68789da6a1 2019-06-25 17:02:26 +02:00
Houtan Bastani 68789da6a1
macro processor: aesthetic changes 2019-06-25 16:52:17 +02:00
Houtan Bastani d5f728c0a3
macro processor: support array comprehension 2019-06-25 16:50:26 +02:00
Houtan Bastani 2bd6282aef
Revert "macro processor: support array comprehension" (should not have been pushed yet)
This reverts commit f2c93d377f.
2019-06-25 12:14:03 +02:00
Houtan Bastani b041cb4fba
macro processor: remove unnecessary function 2019-06-25 12:12:34 +02:00
Houtan Bastani f2c93d377f
macro processor: support array comprehension 2019-06-25 11:15:15 +02:00
Houtan Bastani cd9dfa64cb
macro processor: inline function 2019-06-25 11:14:00 +02:00
Houtan Bastani e5121176a9
fix typo/aesthetic fixes 2019-06-24 16:55:36 +02:00
Houtan Bastani 4c6032895d
macro processor: fix bug in indexing of strings/arrays 2019-06-24 15:57:00 +02:00
Houtan Bastani b8205a49df
Revert "macro processor: allow @#includepath to accept a colon-separated list of paths"
This reverts commit 12b09073e3.
2019-06-24 14:39:35 +02:00
Houtan Bastani 12b09073e3
macro processor: allow @#includepath to accept a colon-separated list of paths 2019-06-24 12:20:48 +02:00
Houtan Bastani 6cf9a410d0
macro processor: oblige parens for tuple passed as variable in for loop 2019-06-24 11:58:55 +02:00
Houtan Bastani a3e63101f4
support `save` option of @#echomacrovars 2019-06-24 11:06:31 +02:00
Houtan Bastani f400f02432
aesthetic changes 2019-06-24 10:09:37 +02:00
Houtan Bastani ef62bc6c50
add suppression missed in 5ba2d8500a 2019-06-21 17:08:58 +02:00
Houtan Bastani 5ba2d8500a
suppress macro processor compilation warnings with gcc 2019-06-21 17:07:10 +02:00
Houtan Bastani 17e040f3f6
macro processor 2.0 2019-06-21 16:45:17 +02:00
Sébastien Villemot 69f2f1ca88
UnaryOpCode::eval(): add missing error cases 2019-06-19 17:31:33 +02:00
Sébastien Villemot fb5518849d
Update comment following the renaming of the perfect_foresight_problem DLL 2019-06-18 15:33:56 +02:00
Sébastien Villemot 271a579808
Remove symmetric elements in 3rd derivatives 2019-06-17 15:28:33 +02:00
Sébastien Villemot d59f9f75ff
Simplification of previous commit 2019-06-05 15:03:48 +02:00
Houtan Bastani d873414728
pac_model growth: allow single parameters 2019-05-27 16:06:14 +02:00
Houtan Bastani 3509291b74
pac_model: only write growth fields if growth was passed to pac_model 2019-05-20 16:14:40 +02:00
Houtan Bastani 2753ab9887
pac: collect exogenous variables in growth argument to pass exo use test in ModFile.cc 2019-05-17 15:06:16 +02:00
Sébastien Villemot 51beb9c2ef
New M_.has_external_function field 2019-05-15 15:02:36 +02:00
Sébastien Villemot 840b5f4f7f
Bugfix for M_.dynamic_tmp_nbr: first element was not including temp. terms for model local vars 2019-05-14 17:08:38 +02:00
Houtan Bastani a0f74f5c16
pac growth: allow linear combination 2019-05-14 12:33:59 +02:00
Houtan Bastani 33c2f9b88b
move macOS compiler to gcc-9 2019-05-08 14:58:45 +02:00
Stéphane Adjemian (Charybdis) 358c3d6716 Revert "Allow th use of EXPECTATION keyword in variables tags."
This reverts commit fbc42b1930, which is
incorrect for the currently used version of Bison (in stretch).
Besides, even if the patch seems to work with recent versions of
Bison, it introduces hard to predict and probably very unpleasant
properties (this patch allows to use the `expectation` word anywhere,
this would be a problem if the user choose to name a variable or
parameter as `expectation`).
2019-05-04 08:40:44 +02:00
Sébastien Villemot 40ef954802
Add new dynamic_g1_nz.m generated file, for perfect_foresight_stacked_solver DLL 2019-05-03 19:25:23 +02:00
Stéphane Adjemian (Charybdis) fbc42b1930 Allow th use of EXPECTATION keyword in variables tags. 2019-05-03 12:18:45 +02:00
Houtan Bastani 7fb591645f
fix bug in pac equation: match terms of param*linear_expression 2019-05-03 11:54:45 +02:00
Sébastien Villemot 82cd95a653
Remove some unnecessary headers 2019-05-02 15:30:33 +02:00
Stéphane Adjemian (Charybdis) 84d57393dc Return empty list of names in models without parameters or exogenous variables. 2019-04-29 23:27:26 +02:00
Houtan Bastani bf89cedd88
fix compilation of static/dynamic files on macOS 2019-04-24 17:40:50 +02:00
Houtan Bastani 21fe0f4bdc
avoid cast warnings when compiling boost headers 2019-04-23 14:57:03 +02: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 c628f21245
JSON: output derivatives at an arbitrary order
Backward incompatible change: the temporary terms for 3rd order are now stored
in "temporary_terms_third_derivative" (without the final "s"; same for external
functions), for consistency with the name of the slot for the derivatives
themselves ("third_derivative").

Ref dynare#217
2019-04-18 17:13:16 +02:00
Sébastien Villemot 43906691d3
JSON: simplification of method for writing temporary terms 2019-04-18 17:10:39 +02:00
Sébastien Villemot 1fee4840b6
More Unicode copyright symbol 2019-04-16 14:29:30 +02:00
Sébastien Villemot b73d554ad2
Use Unicode copyright symbol (in UTF-8 encoding) 2019-04-16 11:35:31 +02:00
Sébastien Villemot bbab112d65
Support for output of arbitrary derivation order (in MATLAB and DLL modes)
Does not work for Julia mode, neither with block and bytecode.

Note: in DLL mode, the number of temporary terms in no longer given in the
‘ntt’ symbol; it must be computed using ‘M_.dynamic_tmp_nbr’.

Ref dynare#217
2019-04-12 18:13:50 +02:00
Houtan Bastani e689032c31
fix bug in 3947903f33 2019-04-12 14:34:25 +02:00
Houtan Bastani 7392cd3a6c
add JSON output for plot_shock_decomposition, realtime_shock_decomposition, and initial_condition_decomposition 2019-04-12 14:34:09 +02:00
Houtan Bastani 3947903f33
add JSON output for shock_groups 2019-04-12 14:16:42 +02:00
Houtan Bastani 1edc9af764
remove unused field 2019-04-12 14:16:15 +02:00
Houtan Bastani dfca3c5933
macroprocessor: fix bug: when macro variables were defined on the command line the resulting .mod file had newlines inserted at the top, resulting in incorrect line numbers when errors were encountered 2019-04-10 15:33:55 +02:00
Houtan Bastani c6467af814
Read options at top of .mod file as long as they exist on the first *non empty* line
In other words, allow newlines before these options
2019-04-10 14:49:33 +02:00
Houtan Bastani 2a9c4b234a
maintain order of macro variables defined on command line when writing them to the .mod file
Before this commit, a dynare call such as
```
dynare <<mod file>> -Db=“A” -Da=@{b}
```
would not expand the value of `b` in `a` whereas
```
dynare <<mod file>> -Da=“A” -Db=@{a}
```
would expand the value of `a` into `b` because the arguments were stored in a map which printed the `@#define` statements in the .mod file in alphabetic order.
2019-04-10 12:51:45 +02:00
Houtan Bastani 4d287a94f2
remove leading newlines when noemptylinemacro is passed 2019-04-09 15:11:47 +02:00
Sébastien Villemot 39926133b8
More automatic modernizations with clang-tidy 2019-04-03 16:46:20 +02:00
Sébastien Villemot 8a41a75c85
Apply modernize-raw-string-literal from clang-tidy
Use ReplaceShorterLiterals option to enforce replacement of all strings.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-raw-string-literal.html
2019-04-03 16:45:52 +02:00
Houtan Bastani 6ba31087ab
add check for parameter_set option to conditional_forecast 2019-04-03 14:26:02 +02:00
Houtan Bastani 92ada8e7e9
fix bug in writing of JSON output in options list 2019-03-29 17:30:39 +01:00
Houtan Bastani 7b6f23c55a
conditional_forecast_paths: add support to write JSON output 2019-03-29 17:30:39 +01:00
Sébastien Villemot 8dad93964d
Allow linear combination of targets in error correction term of trend component models 2019-03-29 17:06:24 +01:00
Sébastien Villemot 9bc6c57a5c
Factorization: create new utility SymbolTable::getUltimateOrigSymbID() 2019-03-29 17:06:24 +01:00
Sébastien Villemot 9b98da424a
Simplification in BinaryOpNode::getPacAREC() 2019-03-29 17:06:24 +01:00
Sébastien Villemot 4114b8a9e1
Simplification in BinaryOpNode::fillAutoregressiveRow
By the way, fix bug in detection of duplicate elements.
2019-03-29 17:06:23 +01:00
Sébastien Villemot 5497936e87
VarModelTable,TrendComponentModelTable: minor simplification 2019-03-29 17:06:23 +01:00
Sébastien Villemot 58adbdeddd
Compatibility fix with MATLAB ≤ R2011a 2019-03-26 15:41:48 +01:00
Sébastien Villemot fd6e700ec7
Simplification: use std::max when computing maxima 2019-03-21 17:24:49 +01:00
Sébastien Villemot 36fa97e5c5
Merge remote-tracking branch 'origin/identification_wmutschl' 2019-03-20 10:48:20 +01:00
Sébastien Villemot 78583135df
Use true/false instead of 1/0 for boolean options
This is more elegant, and makes it easier to distinguish them from integer
options.
2019-03-19 15:15:10 +01:00
Sébastien Villemot 7d5e8a16c0
Add new options for identification
Ref Dynare/dynare#1648
2019-03-19 11:59:15 +01:00
Sébastien Villemot 1793078ba2
Minor stylistic improvements 2019-03-18 18:49:55 +01:00
Houtan Bastani 92af6ffbe7
pass flag because regex’s on matlab side depend on it 2019-03-15 16:12:54 +01:00
Houtan Bastani da9f5dcffb
Revert "make pac expectation JSON output like that of var expectation"
This reverts commit 21d42e6010.
2019-03-15 16:11:55 +01:00
Houtan Bastani 21d42e6010
make pac expectation JSON output like that of var expectation 2019-03-15 15:47:50 +01:00
Houtan Bastani 50c26f4945
further simplifications related to AR matrices 2019-03-15 14:35:57 +01:00
Houtan Bastani f1d1c1e1c1
trend_component_model: simplify AR 2019-03-15 12:27:32 +01:00
Houtan Bastani a3c08f932e
simplify code to find autoregressive matrix for VARs 2019-03-15 12:26:59 +01:00
Houtan Bastani 0544141545
pac: fix bug when checking for symb_ids 2019-03-15 12:06:10 +01:00
Stéphane Adjemian (Charybdis) 9632b18c24
Add in M_ a list of exogenous variables that needs to be excluded if the model is not used for estimation. 2019-03-14 11:03:02 +01:00
Houtan Bastani 1e21904496
use emplace_back instead of push_back 2019-03-11 15:51:41 +01:00
Sébastien Villemot d9f7ac4c9b
Fix bug introduced in 7d16fff786
Here, emplace() and insert() are not interchangeable because this is a std::set of
std::vector<int>, and we really want the initializer-list constructor of
std::vector (and not the two int's constructor).

Fixes the test deterministic_simulations/lola_solve_one_boundary.mod
2019-03-08 18:57:17 +01:00
Houtan Bastani fdefb0f52a
move variable initialization out of body 2019-03-08 16:21:01 +01:00
Houtan Bastani 958661b30f
update comment for map 2019-03-08 12:05:56 +01:00
Stéphane Adjemian (Charybdis) e0acc669bd
Append a list of observed exogenous variables in M_ if varexo option status is used. 2019-03-07 16:55:20 +01:00