Commit Graph

33 Commits (master)

Author SHA1 Message Date
Sébastien Villemot 458926b17b
Remove useless semicolons
Detected and automatically fixed by MATLAB Code Analyzer app.
2023-12-15 16:28:36 +01:00
Stéphane Adjemian (Ryûk) a08de9e661
Partial fix for #1837. 2022-01-19 09:20:22 +01:00
Stéphane Adjemian (Charybdis) 1fd4904ccc
Fix evaluate routine if PAC's growth option is constant. 2022-01-17 16:56:58 +01:00
Stéphane Adjemian (Charybdis) e1d0ce28d2
Remove aux variables from evaluate routine.
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
2022-01-14 20:45:46 +01:00
Stéphane Adjemian (Ryûk) e1a63fbf81
Fix bug introduced in 25231f66.
Set decompose equal to false if the expectation model is not a PAC.
2022-01-03 22:25:48 +01:00
Stéphane Adjemian (Ryûk) 25231f6634
Account for PAC components in evaluate routine.
The print_expectations routine was previously only considering the
aggregate expectation (for the target). Now it updates the
database (dseries) with each component of the PAC model. The growth
neutrality correction is included in the aggregate expectation but not
in the expectations of the components.
2022-01-03 17:28:57 +01:00
Stéphane Adjemian (Ryûk) b297353b06
PAC decomposition between stationary and non-stationary components.
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.
2021-12-17 12:17:13 +01:00
Stéphane Adjemian (Ryûk) f4a7a5430c
Re-implement PAC equations.
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.
2021-11-24 16:40:35 +01:00
Stéphane Adjemian (Charybdis) 5e0c4272ce
Fix wrong logic in test introduced in ceb67c42c. 2021-10-26 10:24:19 +02:00
Stéphane Adjemian (Charybdis) ceb67c42c7
Add more explicit error message.
pac.print does not work in PAC/MCE equations.
2021-10-25 19:23:51 +02:00
Stéphane Adjemian (Charybdis) a5ccd0ae90
Acknowldge time_shift option in print_expectations.
Lagged information set was missing in the evaluation routine.
2021-10-24 19:32:46 +02:00
Stéphane Adjemian (Charybdis) 7f0ba33d5a
Fix doc headers (missing output). 2021-10-24 19:32:46 +02:00
Stéphane Adjemian (Ryûk) 96c24b3052
Add rehash command so that Matlab acknowledge the created routines.
[skip ci]
2021-10-21 09:59:37 +02:00
Stéphane Adjemian (Ryûk) cd2ed823b6
Fix constant in VAR and PAC expectations...
When the VAR auxiliary model has a constant.
2021-07-21 18:02:11 +02:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
DoraK 41c66583ac Add linear combination support for growth neutrality in Iiterative OLS. 2019-10-08 23:18:40 +02:00
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