Commit Graph

34 Commits (edede274f27e1fcd4d43037e0cebae105c37adbd)

Author SHA1 Message Date
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
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) 74520e77bf
Allow for lags on endogenous variable in growth option of pac_model. 2019-01-28 11:25:30 +01:00
Stéphane Adjemia (Scylla) 4d95484e60
Changed optimization algorithm. 2018-12-19 16:10:08 +01:00
Stéphane Adjemia (Scylla) d501d6d511
Added interface to lsqnonlin (Mathworks' optimization toolbox) in pac.estimate.nls. 2018-11-29 10:29:55 +01:00
Stéphane Adjemia (Scylla) e6c716ae9b
Added the possibility to use Gauss-Newton in pac/nls.
Also added the computation of the covariance matrix of the NLS estimator (using
White and Domovitz approach) and integration test.
2018-11-26 09:53:18 +01:00
Stéphane Adjemia (Scylla) 6b113273d3
Added integration tests (Iterative OLS and NLS for PAC equations). 2018-11-21 16:26:38 +01:00
Stéphane Adjemia (Scylla) 524085927d
Removed useless tag (data_type). 2018-10-24 18:45:38 +02:00
Stéphane Adjemia (Scylla) d96740c2ef
Added integration tests (var and pac expectations). 2018-10-14 17:01:02 +02:00
Houtan Bastani eb316d7e2d update files for change of option name from `trends` to `targets` 2018-09-13 12:24:32 +02:00
Stéphane Adjemian(Charybdis) 8d84d0b38b Add 'tests/pac/' from commit '72dda0e3ebdb46b741e484f2e2f2155d02c59815'
git-subtree-dir: tests/pac
git-subtree-mainline: 0f3678ec4a
git-subtree-split: 72dda0e3eb
2018-09-06 23:35:53 +02:00