Commit Graph

60 Commits (master)

Author SHA1 Message Date
Sébastien Villemot 6dd55726e6
Drop autoconf/automake build system 2023-09-20 15:33:44 +02:00
Stéphane Adjemian (Ryûk) cc0d22cf4c
Fix integration tests.
print_equations() has been replaced by search().
2023-03-06 17:17:31 +01:00
Stéphane Adjemian (Charybdis) f1aff2b370
Remove calls to dbstack in dynare_solve.
Adding three input parameters for maxit, tolf and tolx.

Closes #1841.
2022-04-10 20:29:57 +02:00
Stéphane Adjemian (Ryûk) 24d5ba0290
Change nonlinear solvers in some integration tests.
Trust region with block decomposition (as provided by dmperm) fails to provide
correct simulations (most likely due to the interpretation of tolf which
depends on the number and size of blocks).
2022-03-25 19:42:40 +01:00
Stéphane Adjemian (Charybdis) e7d11dd7b1
Remove aux variables from target definition (PAC). 2022-02-18 09:13:17 +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) 7f075ca109
Remove files that should not have been committed in e1d0ce2.
[skip ci]
2022-01-16 16:12:37 +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) c43777f610
Show how to hide simulated annealing algorithm iterations. 2021-12-17 20:55:46 +01:00
Stéphane Adjemian (Ryûk) 4512000f0f
Display estimation results PAC/NLS. 2021-12-17 20:53:39 +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 (Ryûk) f778e3c1ce
Fix growth neutrality correction in PAC equations.
- 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)
2021-10-21 10:19:23 +02:00
Sébastien Villemot 014e18df69
Preprocessor: remove unused steady_state_growth option to pac_model 2021-09-22 16:27:48 +02:00
Stéphane Adjemian (Ryûk) 54f80e88d2
Add structural VAR as an auxiliary model for VAR based expectations and PAC expectations.
Ref. #1785

Just add option `structural` to the `var_model` command.
2021-07-16 10:25:18 +02:00
Stéphane Adjemian (Ryûk) 2b4572affd
Allow arbitrary nonzero mean exogenous variables in PAC equations.
Previously any nonzero mean exogenous variable had to be centered on
the growth rate (first difference) of the (PAC's LHS) endogenous
variable.
2021-07-11 17:06:53 +02:00
Sébastien Villemot 88b427f7bc
Compatibility fix for MATLAB R2014a
MATLAB R2014a does not like the syntax “abs(x).data” where “x” is a dseries.
2021-06-16 17:41:40 +02:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Sébastien Villemot e4af502360
Testsuite / pac: Octave compatibility fix
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.
2021-02-04 16:01:35 +01:00
Sébastien Villemot f094dc71f9
Testsuite / pac/trend-component-19-growth-comb: fix accuracy check
The test was using the comparison operator (>) on a dseries. This would give a
bogus (false) result under MATLAB, and would crash under Octave.
2021-02-04 16:01:30 +01:00
Sébastien Villemot 91b0ba64c6
Testsuite: rename all test files that have the name “example.mod”
That filename conflicts with Octave’s builtin example() function.
2021-01-15 17:19:41 +01:00
Sébastien Villemot 8e3127d69e
Preprocessor rebase
– 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.
2020-10-16 16:53:26 +02:00
Sébastien Villemot 7270f722e4
Activate test for two PAC equations in the same file 2020-10-16 16:30:38 +02:00
Sébastien Villemot fcc3a3cec2
Testsuite: fix repeated typo in equation name
[skip ci]
2020-09-18 17:40:44 +02:00
Stéphane Adjemian (Odysseus) 579fb9e685 Fixed bug introduced in edede274f2. 2020-07-24 22:30:51 +02:00
Stéphane Adjemian (Charybdis) edede274f2
Make the detection of the target in PAC equation more robust.
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).
2020-07-24 17:36:31 +02:00
Stéphane Adjemian (Charybdis) 7f50b02910
Added test where the PAC equation doesn't have lags on the endogenous variable.
This example is currently failing.
2020-07-22 12:25:05 +02:00
Stéphane Adjemian (Charybdis) 897e2fc63b
Added test with two PAC equations in the same mod file. 2020-07-22 12:21:23 +02:00
Dóra Kocsis b4cd1c0f57 Add routine printing equations where a searched variable appears in. 2019-11-08 17:33:27 +01:00
Dóra Kocsis 3648ccb8ff Adjust result output for NLS and Iterative OLS. 2019-10-10 10:10:23 +02:00
DoraK 41c66583ac Add linear combination support for growth neutrality in Iiterative OLS. 2019-10-08 23:18:40 +02:00
Stéphane Adjemian (Charybdis) ad73aac0ad Fixed integration test.
Need to increase accuracy (set tolf 1e-9 instead of 1e-6) if some
endogenous variables appear under logs (which is the case for x3).
2019-09-30 14:29:19 +02:00
Sébastien Villemot e9da62eca9
Add missing exceptions to .gitignore 2019-09-26 15:19:26 +02:00
Sébastien Villemot e521dcf081
Drop useless LICENSE file 2019-09-26 15:19:14 +02:00
Stéphane Adjemia (Scylla) 8740355407
Rewrote evaluate routine.
- 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.
2019-04-08 11:01:34 +02:00
Stéphane Adjemia (Scylla) aa499671ce
Added the possibility to rename an endogenous variable in equation. 2019-04-02 18:06:47 +02:00
Stéphane Adjemian (Charybdis) 567ca19000
Added routine to evaluate the RHS of an equation. 2019-03-19 07:08:55 +01: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) 52eed33c42
Fixed growth neutrality correction in presence of exogenous variables.
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).
2019-03-11 11:54:53 +01:00
Stéphane Adjemian (Charybdis) 6997e0a4a6
Added the possibility to have exogenous variables in the optimal part of PAC.
Works with iterative ols and nls.
2019-03-08 14:34:41 +01:00
Stéphane Adjemian (Charybdis) 40918f4316
Fixed condition in integration tests for ec.istarget. 2019-03-07 09:39:14 +01:00
Stéphane Adjemian (Charybdis) 9eb64a0b64
Updated preprocessor submodule.
Fixes exogenous variables in PAC equation without non optimizing behaviour.
2019-03-06 15:39:00 +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) d00b57541e
Allow exogenous variables in pac.estimation.iterative_ols routine.
The parameters associated to these additional variables can be estimated or calibrated.
2019-03-01 23:32:47 +01:00
Stéphane Adjemian (Charybdis) fd98e83d78
Adapted integration tests for 8e60ded. 2019-02-28 16:23:04 +01:00
Stéphane Adjemian (Charybdis) f07b1e8028
Account for exogenous variables in PAC's RoT part.
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.
2019-02-27 15:53:25 +01:00
Stéphane Adjemian (Charybdis) 379431b05b
Added integration test.
Check that the content of pac.[pacmodel].equations.[eqtag].non_optimizing_behaviour.vars is correct.
2019-02-27 14:22:59 +01:00
Stéphane Adjemian (Charybdis) 445f88df55
Fixed PAC/MCE with non optimizing behaviour.
Alse added integration tests for PAC/MCE.
2019-02-25 23:07:57 +01:00
Stéphane Adjemian (Charybdis) 1aa7f4a93f
Added PAC with Model Consistent Expectations. 2019-02-25 17:31:58 +01:00