In regular expressions, the end-of-word operator (\>) does not behave the same
under Octave and under MATLAB. See:
https://savannah.gnu.org/bugs/index.php?59992
In this case, we can simply drop the \> operator, since there is no risk of
matching a partial variable name (since there is already “(-1)” at the end of
the pattern).
By the way, remove a useless parenthesis grouping in the regexp.
The preprocessor has been modified to allow linear combinations in the growth
parameter (see Dynare/preprocessor@a0f74f5c16 and
Dynare/preprocessor@d873414728).
This commit restores the previous functionality (i.e. it fixes the simple case
where only one parameter/variable is provided for the growth parameter).
The code still needs to be adapted to really handle linear combinations.
An index was used instead of a parameter value when modifying the
correction (for handling models with non optimizing agents and/or models with
exogenous variables).
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.
The parameter is constrained to be in (0,1) for the following algorithms
- lsqnonlin (without Levenberg-Marquardt)
- fmincon
- annealing
- particleswarm
Other algorithms do not allow the definition of boundaries... We should add a
penality function to the objective for these algorithms.
Each new routine pac.print() and var_expectation.print(), creates two files
that can be included (using the macro language) in a mod file. The first
file, {pac,var}expectationmodename-parameters.inc saved under
{M_.fname}/model/{pac,var}expectationmodel, contains the declaration of the
parameters created for the expanded (var or pac) expectation model, with
calibrated values. The second file, {pac,var}expectationmodename-parameters.inc
saved in the same subfolder, contains the expanded version of the (pac or var)
expectation term as a linear combination of the variables in the companion
representation of the expectatino model.