Auxiliary variables were still present in the growth neutrality correction. This
commit remove the auxiliaries, so that the user doesn't need to update the
database with the auxiliary variable definitions.
Also adds integration test.
TODO Check that it works with log unary op
TODO Complete tests by checking that the written evaluate routine works
The taget in PAC equation can be decomposed into an arbitrary number of components (variables
in the VAR auxiliary model).
TODO Iterative OLS estimation (which is not the preferred estimation routine).
TODO Decomposition in the routine evaluating the forecasts for each component.
This commit only introduce new elements in the Dynare language (adding the
possibility to decompose the target into stationary and non stationary
components) and insure that all the former codes (ie without decomposition of
the target) are still working as expected.
- Force long run levels of the exogenous variables to be zero or g (the BGP growth rate of the LHS endogenous variable).
- Fix the correction of the correction for the share λ (aak γ).
- Provisions for the case where the long run level of the exogenous variable is
different from 0 or g (see tmp1 and ll which should be added to the growth
neutrality correction as a constant).
(cherry picked from commit a4423d734e1df1d4ee09c7225d7fd610e0d94cd1)
Use a different random seed under Octave for several tests.
Note that these tests seems fragile. Changing the seed under MATLAB often leads
to a failure.
– PAC model: fixes to M_.pac.MODEL.ar (information about autoregressive part)
+ 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
(Ref. Dynare/preprocessor#52)
– Block decomposition:
+ bugfix for solve one boundary blocks with mfs>0
+ fix evaluation of recursive variables in solved blocks
(Ref. Dynare/dynare#1726)
— Fix various potential bugs with model local variable
— Ensure that negative constants are never marked as temporary terms
By the way, activate tests/pac/trend-component-31/example.mod, since it should
now work.
In a PAC equation, the error correction term must be written as:
β×(yₜ₋₁-xₜ₋₁)
where x is the endogenous variable determined by the equation and y
the target for x. The ordering matters, if not respected the
preprocessor wll not identify the error correction term (hence the
target) and will throw an error. The target must be an endogenous
variable or the log of an endogenous variable. For a more general
target, ie an expression, one can create an auxiliary variable.
We impose the ordering, target comes first in the error correction
term, so that the stability condition is always β>0 (this constraint
can be enforced when estimating the PAC equation).
- Can handle more than one equation.
- Can handle identities.
- Forbids dynamic equations.
- Can handle following LHS y, diff(y), diff(diff(y)), log(y), diff(log(y)) and
diff(diff(log(y))), other transformations will result in an error.
- Added integration tests.
Remark 1. In the integration tests I compare the values returned by the
evaluate routine with the values computed with the simulation
routines. Normally the discrepancies should be small, but this is not
the case when the endogenous variable appear under a log on the
LHS. My current conclusion is that this has more to do with the
cumulation of the accuracy errors in the simulation routine (a
sequence of Newton algorithms) rather than with the evaluate routine.
Remark 2. Currently the only allowed nonlinear transformation on the LHS
endogenous variable is the log. It is not difficult to generalise, at
some point I had all the matlab functions allowed by Dynare,
but this would complicate the code for not much gain.
Extracts equations from a mod file and produce .inc files (equations, lists of
parameters, endogenous variables and exogenous variables) that can be included
in a mod file that will be used to simulate the model.
If an innovation has a tag `(used='estimationonly')` it will be excluded from
the generated files (ie list of shocks and equations).
Also fixes growth neutrality correction in models with non optimizing
agents (correction was not taking into account the value of the share of non
optimizing agents).
Fixes the iterative_ols estimation of PAC equation when the Rule of Thumbs (non
optimizing) part of the equations contains endogenous and/or exogenous variables.