Commit Graph

17 Commits (fb3335f191931835723240c73bdae1e2cdc297b7)

Author SHA1 Message Date
Sébastien Villemot 8e1528c1cb
Temporary fix for growth parameter in PAC models
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.
2019-09-26 17:35:31 +02:00
Stéphane Adjemian (Charybdis) d3db092c81
Added a cherry-pick routine.
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).
2019-03-14 11:04:10 +01:00
Stéphane Adjemian (Charybdis) 33e43a55b2
Cosmetic change. Print expression on more than one line (one line per additive term). 2019-03-08 09:36:56 +01:00
Stéphane Adjemian (Charybdis) 03e60b6439
Cosmetic change. 2019-03-07 17:09:56 +01:00
Stéphane Adjemian (Charybdis) cdadab34b4
Streamlined code in print_expectations and allow diff and unary op in growth option of pac_model. 2019-03-02 22:36:13 +01:00
Stéphane Adjemian (Charybdis) fd98e83d78
Adapted integration tests for 8e60ded. 2019-02-28 16:23:04 +01:00
Stéphane Adjemian (Charybdis) e75ca94a48
Fixed PAC with growth option equal to lagged endogenous or exogenous variable.
Still not working with first difference or lagged first difference.
2019-02-28 14:58:17 +01:00
Stéphane Adjemian (Charybdis) 4093a99f40
Efficiency change.
It is not possible to pre-allocate a cell array here, but

Array = {};
for i=1:10
    Array(i) = {'a'}
end

is faster by a factor 10 than

Array = {};
for i=1:10
    Array = [Array, 'a']
end
2019-02-28 09:41:35 +01:00
Stéphane Adjemian (Charybdis) 3aa977600c
Allow arbitrary unary operator, not only log(). 2019-02-28 09:30:03 +01:00
Stéphane Adjemian (Charybdis) 1775869bbd
Avoid infinite loop. 2019-02-28 09:24:12 +01:00
Stéphane Adjemian (Charybdis) 8e60ded1bd
Write the growth correction term in a separate file. 2019-02-27 22:26:07 +01:00
Stéphane Adjemian (Charybdis) 0af3068569
Handle situations where a PAC model is used in more than one equation. 2019-02-22 17:58:24 +01:00
Stéphane Adjemia (Scylla) 23e37e45c4
Cosmetic change.
create a namespace for each {VAR/PAC} expectation model.
2018-12-19 11:43:26 +01:00
Stéphane Adjemia (Scylla) 351da3b865
Do not update a dseries object, but instantiate a new object. 2018-12-19 10:53:09 +01:00
Stéphane Adjemia (Scylla) 2cff485113
Fixed bug in the routine evaluating the (PAC/VAR) expectations. 2018-12-14 17:29:46 +01:00
Stéphane Adjemia (Scylla) cb4384bb27
Create on the fly a routine for evaluating the (VAR/PAC) expectations.
The routine takes a dseries object as unique argument and return an updated
object with the expectation term.

If the mod file is named `example.mod` and if the (VAR/PAC) expectation model is
named `toto`, then after

var_expectation.print('toto');

the expectation term can be evaluated:

ts = example.var_expectations.evaluate_varexp(ts);

where ts is a dseries object containing all the time series appearign in the
auxiliary (var or trend_component).
2018-12-03 15:07:43 +01:00
Stéphane Adjemia (Scylla) a53c63d6d5
Added routines to print PAC_EXPECTATION and VAR_EXPECTATION in files.
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.
2018-10-14 16:57:51 +02:00