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
Houtan Bastani
69e7763490
pac: change vectors that store additive parts
2019-03-07 12:57:47 +01:00
Houtan Bastani
2201907245
pac: support additive elements whether optimizing agents are present or not
2019-03-07 12:36:08 +01:00
Houtan Bastani
583c8373d7
pac: add residual to additive part
2019-03-07 12:23:19 +01:00
Houtan Bastani
9b1b4113d9
pac: keep order of variables in ec part of pac equation and add scaling factor to output
2019-03-07 11:31:45 +01:00
Houtan Bastani
b0dac547e9
shorten writing of istarget output
2019-03-07 11:31:45 +01:00
Houtan Bastani
14e7c92f14
pac: fix bug in setting of target variable
2019-03-07 11:31:45 +01:00
Sébastien Villemot
bd7a1f4b44
Minor simplifications in the lexers
...
In particular, no need to put both upper and lower case letters in the
patterns, since the lexer is case-insensitive.
The only simplification that we do not perform is removing the quoting of
single quotes (i.e. replacing \' by '), since it confuses the C++ mode of
Emacs.
2019-03-06 13:58:22 +01:00
Houtan Bastani
8502ebfc06
json output: print statements in original model output
2019-03-06 11:43:30 +01:00
Sébastien Villemot
abfe1a70e7
Fix typo
2019-03-05 18:59:40 +01:00
Houtan Bastani
68850536e6
stop processing if we substitute a unary op with a lead. closes #20
2019-03-05 15:20:32 +01:00
Houtan Bastani
7c9f272e15
always substitute diffs of expressions that contain leads. closes #21
2019-03-05 12:43:54 +01:00
Houtan Bastani
a1c79e6a4c
remove code that should have been removed in 9963686e72
2019-03-05 12:33:21 +01:00
Houtan Bastani
9963686e72
handle additive terms when PAC equation does NOT have non/optimizing agents
2019-03-05 12:20:45 +01: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
e56f994d28
pac_model: write growth argument as string
2019-03-01 11:20:26 +01:00
Houtan Bastani
341b9c6667
pac_model: allow diff as argument to growth option
2019-02-28 19:22:34 +01:00
Houtan Bastani
5f013756f2
find additive parts to pac equation
2019-02-27 23:12:05 +01:00
Stéphane Adjemian (Charybdis)
2312ce13dc
Changed non_optimizing_behaviour.type field to non_optimizing_behaviour.isendo.
...
The elements are logicals true/false (true iff corresponding variable is an endogenous variable).
2019-02-27 15:35:19 +01:00
Houtan Bastani
ec21208ed7
pac: specify type of variables in non optimizing part of equation
2019-02-27 15:10:48 +01:00
Houtan Bastani
effa40543e
pac: find correct target variable when pac equation accounts for share of optimizing agents
2019-02-25 18:46:44 +01:00
Sébastien Villemot
3d42e6468d
Octave compatibility fix
2019-02-25 16:56:11 +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
Houtan Bastani
64f55e4a5e
pac: declare endogenous variables needed by pac model consistent expectation before the creation of auxiliary variables
2019-02-25 15:29:46 +01:00
Houtan Bastani
36b2ae5026
pac: model consistent expectation: add 1 to max lag from pac equation to obtain correct `m` for substitution
2019-02-25 10:48:53 +01:00
Stéphane Adjemian (Charybdis)
b8f756fa35
Fixed option name in error message.
2019-02-22 23:11:06 +01:00
Sébastien Villemot
8ae7f81fd9
Fix bug with var_expectation nodes introduced in 38152c34a4
...
We must provide a return value for
VarExpectationNode::maxLagWithDiffsExpanded().
Return zero, which will lead to the right overall result even if it is not
strictly the right choice (see the comment in the code).
2019-02-22 17:30:09 +01:00
Houtan Bastani
20690e1664
change ordering of aux vars in enum
2019-02-22 17:15:11 +01:00
Stéphane Adjemian (Charybdis)
6a34603f91
Conform to spelling used in Matlab codes.
2019-02-22 12:31:58 +01:00
Houtan Bastani
d8c9bbc353
ensure that h1/h0_param_indices are created regardless of whether there are parameters or not
2019-02-22 11:52:07 +01:00
Houtan Bastani
4160e48dab
output info relative to A0star column indices
...
(cherry picked from commit 70f73d9bd5232044f3e31f1e4b26425bd149a869)
2019-02-21 12:57:18 +01:00
Sébastien Villemot
7d16fff786
Further simplifications
2019-02-21 12:16:22 +01:00
Sébastien Villemot
be023bdab9
Simplification: the [] operator already inserts the new element
...
See https://en.cppreference.com/w/cpp/container/map/operator_at
2019-02-21 12:15:50 +01:00
Houtan Bastani
f41e681122
use emplace instead of insert and emplace_back instead of push_back
2019-02-21 10:59:53 +01:00
Houtan Bastani
84104a695e
don’t initialize string to empty
2019-02-21 10:53:11 +01:00
Houtan Bastani
520c7fc9b2
use auto instead of specific initializer
2019-02-21 10:52:59 +01:00
Houtan Bastani
469a328cfc
replace make_pair and make_tuple
2019-02-21 10:42:10 +01:00
Houtan Bastani
b09b50472b
pac: fix writing to use modstruct instead of M_
2019-02-20 16:46:52 +01:00
Houtan Bastani
f88682d683
pac: output model type in M_.pac.(model_name)
2019-02-20 16:43:24 +01:00
Houtan Bastani
5e1521f42b
don’t save unnecessary pac model info
2019-02-20 16:38:44 +01:00
Houtan Bastani
240aba6709
move pac info out of pac expectation node
2019-02-20 15:35:13 +01:00
Houtan Bastani
34756833ae
pac: output info into substructures based on pac model name & equation tag
2019-02-19 18:32:42 +01:00
Houtan Bastani
760eaf6712
fix compilation warning
2019-02-19 18:32:42 +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
c1cf5c8d18
fix comment
2019-02-19 12:51:05 +01:00
Houtan Bastani
fc6d04b015
create A0 and A0star matrices for trend component models
2019-02-19 12:26:30 +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
b3fbb86214
relieve constraint that max lag on EC matrix is 1
2019-02-15 11:12:07 +01:00
Houtan Bastani
f4837e6c94
fix AR and EC matrices when `equation = C` results in a simplified equation
2019-02-14 17:09:57 +01:00
Houtan Bastani
6e680c0159
simplify in accordance with 02ae0af3e5
2019-01-29 17:52:19 +01:00
Houtan Bastani
302fec4dec
remove comparisons to nullptr
2019-01-29 17:46:09 +01:00
Houtan Bastani
02ae0af3e5
change map type for readability
2019-01-29 17:43:17 +01:00
Houtan Bastani
1e071ca499
make simplifications in dynamic model before copying to original
2019-01-28 17:53:04 +01:00
Houtan Bastani
90c45b2cd6
remove unused function added in d922ae8ffc
2019-01-28 15:34:38 +01:00
Houtan Bastani
f5df7e7567
when an equation is of the form `X` = `constant`, replace all occurrences of `X` in other equations with `constant`
2019-01-28 15:32:12 +01:00
Sébastien Villemot
c5fc2e38c1
Simplify log(1/x) into -log(x) (and similarly for log10)
2019-01-28 15:15:58 +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
9c95bfa33f
fix typos
2019-01-18 12:48:45 +01:00
Houtan Bastani
027b59b449
fix typos
2019-01-18 12:36:19 +01:00
Houtan Bastani
a3e7547857
fix bug when defining variable with value on the command line with -D option (problem introduced in ee5fc6b16b
)
2019-01-16 11:51:14 +01:00
Sébastien Villemot
e7c9c26d2d
More modernizations with clang-tidy
2019-01-15 11:08:47 +01:00
Sébastien Villemot
4f9b384984
Use C++11 override keyword
2019-01-09 15:43:46 +01:00
Houtan Bastani
4c71d143f3
substitute leads/lags appropriately when identification or sensitivity statements are present. Issue: https://git.dynare.org/Dynare/dynare/issues/1631
2019-01-09 14:48:25 +01:00
Houtan Bastani
280b764ca5
onlymodel: read estimated_params block as well
2018-12-27 19:07:51 +01:00
Houtan Bastani
7d37c35a3d
onlymodel: read initval and endval too
2018-12-27 12:06:39 +01:00
Sébastien Villemot
f2b0bdf0a2
Fix bug when histval is used and there is no auxiliary variable
...
Problem introduced in a69c65361c
.
2018-12-20 17:45:54 +01:00
Sébastien Villemot
01385d1f80
Simplify implementation of nopreprocessoroutput option
...
Simply redirect cout to /dev/null, instead of propagating a boolean
everywhere.
2018-12-20 17:08:45 +01:00
Sébastien Villemot
5784dce1ca
Remove the possibility of passing the mod-file as a string in the first shell argument
...
This feature is ill-designed and no longer needed by the GUI. And is not very
useful: it is not possible to interact with the preprocessor without using the
filesystem, since the preprocessor creates many files anyways.
If we really need to reimplement such a feature, it should rather be redesigned
by reading the modfile from standard input (cin). That could be triggered by
using "-" as the filename argument (as is already done by several standard Unix
utilities).
2018-12-20 17:08:05 +01:00
Sébastien Villemot
b2e3a481e3
Fix for histval with auxiliary lead variables corresponding to non-linear terms
...
The M_.params structure was not correctly passed to
dynamic_set_auxiliary_series.m, leading to crashes if a parameter was needed to
compute an auxiliary variable (typically an auxiliayr lead variable
corresponding to a non-linear term in stochastic setup).
2018-12-20 15:05:18 +01:00