For the time being, the preprocessor will refuse that this option be used with
any command other than estimation.
By the way, remove occbin_likelihood and occbin_smoother options to estimation.
Ref. dynare#569
— output Julia files as soon as “language=julia” is passed, independently of
the value of the “output” option
— drop the “dynamic” and “first” values of the “output” option, since they
actually do nothing
— obey the “output” option even in the deterministic case
Ref. dynare#1600
This brings those models in line with stochastic models.
However note that transformation is still not exactly the same on stochastic
and deterministic models, because there is no need to take into account the
Jensen inequality on the latter. In deterministic models, there is a one-to-one
mapping between exogenous with lead/lags and auxiliaries, while in stochastic
models, an auxiliary endo may correspond to a more complex nonlinear expression.
– Fix order of items in this structure. Previously, items were ordered
according to the declaration order of parameters. Now, items are order
according to lag order (first lag appears first)
– Gracefully handle the case where there is no autoregressive part
(Closes: #52)
This is necessary to correctly compute those original model leads/lags. In
particular, this is needed for correct interaction with “histval”.
Closes: #47
Since commit 9c9e8f816f, it’s the information
from the original model which was in this field, which is not what is expected.
By the way, do not output this field (and the related M_.hessian_eq_zero) when
the Hessian is not computed by the preprocessor (i.e. in practice for perfect
foresight), since they would otherwise contain incorrect information.
Ref. dynare#1681
Because MATLAB under Windows maintains a lock on the “+<basename>” subdirectory,
we use a workaround consisting in first renaming the directory, then deleting
it.
But this is not enough when the “ramsey_policy” command is used, because the
latter creates a “+objective” subfolder inside “+<basename>”, on which MATLAB
also maintains a lock.
The fix consists in recursively using the same workaround as for the top-level
directory: renaming before deleting.
Auxiliary equations appearing in set_auxiliary_variables.m and
dynamic_set_auxiliary_series.m need to appear in recursive ordering, since
those files are used for sequential evaluation.
Previously, the recursive ordering was guaranteed by a set of ad hoc rules and
workarounds, but that would not cover certain edge cases.
With this commit, the recursive ordering is systematically computed, using a
topological sort on the directed acyclic graph whose vertices are auxiliary
equations and whose edges are dependency relationships.
Closes: #22
Allows for the inclusion/exclusion of a set of equations, specified either on the command line or in a text file.
If the equation has a single endogenous variable on the LHS, then the equation is moved. If not, if the equation has an `endogenous` tag then that variable is removed along with this equation. If not, then an error is thrown.
As a command line argument, `exclude_eqs` can take the form (same syntax for `include_eqs`):
* `exclude_eqs=eq1 to remove all equations declared as `[name=eq1]`
* `exclude_eqs=[eq 1, eq 2]` to remove all equations declared as `[name=eq 1]` or `[name=eq 2]`
* `exclude_eqs=[tagname=X]` to remove all equations declared as `[tagname=X]`
* `exclude_eqs=[tagname=(X, Y)]` to remove all equations declared as `[tagname=X]` or `[tagname=Y]`
When declared in a file, the file should be of the form:
```
eq 1
eq 2
```
to remove all equations declared as `[name=eq 1]` or `[name=eq 2]`.
It should be of the form:
```
tagname=
X
Y
```
to remove all equations declared as `[tagname=X]` or `[tagname=Y]`.
This is made possible by the getLagEquivalenceClass() method introduced in the
previous commit.
Previously, the static version of the LHS expressions was used.
As a consequence, drop ModFile::diff_static_model, now useless.
Previously, for testing whether two diff() expressions or two unary ops were
the lead/lag of each other, the preprocessor would test whether they have the
same static representation. This is ok for simple expressions (e.g.
diff(x(-1))), but not for more complex ones (e.g. diff(x-y) and diff(x(-1)-y)
should not be given the same auxiliary variable).
This commit fixes this by properly constructing the equivalence relationship
and choosing a representative within each equivalence class. See the comments
above lag_equivalence_table_t in ExprNode.hh for more details.
Closes#27
Since commit 64f55e4a5e, in the presence of PAC
model-consistent expectations, some endogenous variables are added to the
symbol table at the beginning of ModFile::transformPass(), while their defining
equations are added at a later point.
But commit 7c3f981eac has introduced a check that
verifies that all endogenous are used in equations. That check happens after
the above mentioned endogenous are created, but after their defining equations
are added. Hence it fails.
The fix consists in creating those endogenous after the check. Incidently, they
are no longer part of the saved original model, but this is a good thing.
— allow “language=matlab” for symmetry (this is the default)
— remove the useless “cuda” and “python” values
— give a more meaningful error message when “output” is used in conjunction
with “language=matlab”
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
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
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.
New options "mexext" and "matlabroot" are introduced, so that the preprocessor
knows where to find MATLAB and which architecture to compile for.
Only recent gcc is now supported. A set of optimization flags is used so that
compilation goes reasonably fast on large models.
Consequently, options "msvc", "mingw" and "cygwin" have been removed.
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.
The check is done at the time the preprocessor is compiled, but it ought to be
done at the time when the C source file generated by the preprocessor is compiled…
Anyways, it is probably irrelevant now, since MSVC has supported
acosh/asinh/atanh for a long time now.
This mimicks the structure of M-functions (though the logic for filling the
temporary terms vector is a bit different).
This change implied a modification in the way we compute the checksum in case
of block decomposition (the temporary terms for the C output are not correctly
computed in that case).