Commit Graph

2186 Commits (469a328cfc9d18595ae6dc27e1ea69cb3a98b59c)

Author SHA1 Message Date
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 a6991e8382
update license for new year 2019-01-02 13:34:58 +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
Sébastien Villemot a69c65361c
Fix ramsey_policy with histval
Since 38152c34a4, the M_.endo_histval variable is
generated via dynamic_set_auxiliary_dseries.m. But the latter file does not
handle auxiliary variables for Lagrange multiplier. We therefore now set them
by hand (at an initial value of zero).
2018-12-20 15:05:18 +01:00
Sébastien Villemot 9e66627375
Fix for histval block in the presence of auxiliary lead variables
Since 38152c34a4, the M_.endo_histval variable is
generated via dynamic_set_auxiliary_dseries.m. The problem is that, for
auxiliary variables corresponding to a lead, this will generate a NaN in
M_.endo_histval. This is conceptually correct, since such variables are never
used as initial conditions, but this is inconsistent with what we do with the
"initval" block, and leads to crashes in some routines where we fail when there
is a NaN. Therefore, replace these with a zero, as it used to be.
2018-12-20 15:05:17 +01:00
Stéphane Adjemia (Scylla) 8b81474a2e
On macOS use gcc-7 from homebrew instead of gcc-clang.
To install this version of gcc:

~$ brew install gcc@7

Does not seem to work with gcc-8 (missing headers…).
2018-12-20 14:38:37 +01:00
Houtan Bastani ea76bc8636
epilogue: use different syntax for firstobservedperiod call 2018-12-19 16:20:30 +01:00
Sébastien Villemot 1393bf1d7e
Parse the options list at the top of the mod-file
Ref Dynare/dynare#1630
2018-12-19 16:14:40 +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 82b1467074
Improve consistency of ExprNode methods for calculating max lead/lag
- ExprNode::maxLag() and ExprNode::maxLead() now take into account exogenous
  deterministic variables, for consistency with M_.maximum_{lead,lag}

- ExprNode::maxLag() no longer behaves as if diff() operators were
  expanded (i.e. it now returns 1 on diff(x(-1))), for consistency with
  maxEndoLag() and maxExoLag()

- New ExprNode::maxLagWithDiffsExpanded() method, that behaves as maxLag() used
  to behave (except that it also takes exogenous deterministic into account)
2018-12-05 15:30:03 +01:00
Sébastien Villemot fe6d4e9bca
Modify semantics of ExprNode::countDiffs()
Previously, this function was counting the total number of diff() operators in
an expression. But this is not very useful, and is potentially misleading,
because in practice we use this function to compute the maximum lag on
variables in levels.

This function now returns the maximum number of nested diffs.

For example, on diff(x)+diff(diff(y)), this function was returning 3, and it
now returns 2.
2018-12-05 12:41:13 +01:00
Sébastien Villemot 66a766b0b7
Small modernization 2018-12-04 18:41:04 +01:00
Sébastien Villemot 8bda21c504
Remove workaround for Bison 3.2
This was a bug, now fixed in Bison 3.2.2. The latter version is now available
on most platforms (Debian unstable/testing, Homebrew, MSYS2).
2018-12-04 17:10:34 +01:00
Sébastien Villemot 018068de91
Fix typo 2018-12-03 17:29:53 +01:00