Commit Graph

40 Commits (7bf0395a2708a524725c0c25a3cefe5a5f54a8a5)

Author SHA1 Message Date
Stéphane Adjemian (Ryûk) 735bd66d4d
Remove unused output arguments. 2023-12-18 07:48:27 +01:00
Sébastien Villemot 1d5a442fe5
Bump minimal required version of Octave to 7.1.0
Incidentally, this means that the JSONlab submodule is no longer needed, so it
is removed in the present commit.

Closes: #1907
2023-11-22 17:46:13 +01:00
Sébastien Villemot 715aff891a
Octave 7 fixes bug related to generated files in +package folder 2022-04-15 14:33:02 +02:00
Sébastien Villemot 9c79b0d73f
Octave: better workaround for bug 46282 2022-01-25 11:32:08 +01:00
Stéphane Adjemian (Ryûk) ba7a53b38b
Code factorization (NLS). 2021-12-19 17:14:25 +01:00
Stéphane Adjemian (Ryûk) 8fa8ee8235
Bug fix (wrong dimension for exogenous variables).
Also removed the distinction between exogenous and endogenous variables when
replacing variables by columns in the data matrix.
2021-12-17 20:54:28 +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) 8c8a2cf0fa
Add trap if SSR is not a real number. 2021-12-17 14:54:58 +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
Sébastien Villemot f7149d60cc
NLS estimation: workaround for Octave random failure to read the generated ssr_*.m file 2021-09-23 16:21:25 +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 8e9085eea4
PAC NLS estimation: Octave compatibility fix
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.
2021-02-02 17:02:04 +01:00
Sébastien Villemot e26a5e2805
NLS: compatibility fix for Octave and MATLAB < R2014b 2021-01-15 17:42:00 +01:00
Stéphane Adjemian (Charybdis) 8aa86a2244
Save the list of parameter names in pac estimation results (NLS). 2020-01-06 11:03:26 +01:00
Stéphane Adjemian (Charybdis) d740af10f3 PAC/nls save lhs and fitted variables. 2019-11-25 17:29:45 +01:00
Stéphane Adjemian (Charybdis) fce51c6cc4 Added R² to PAC NLS estimator. 2019-10-28 16:35:45 +01:00
Stéphane Adjemian (Charybdis) 6a959c4629 Put estimated residuals in a dseries object. 2019-10-28 16:34:56 +01:00
Dóra Kocsis 3648ccb8ff Adjust result output for NLS and Iterative OLS. 2019-10-10 10:10:23 +02:00
Sébastien Villemot 3434ec2f9b
NLS estimation of PAC: fmincon now available under Octave 2019-10-09 12:32:26 +02:00
Stéphane Adjemian (Charybdis) e3f1ea7e3c Added upper bound to error correction parameter.
Available only for lsqnonlin, fmincon, annealing, and particleswarm algorithms.
2019-07-24 11:21:52 +02:00
Stéphane Adjemian (Charybdis) 4d69674874
Partially reverts 1190cab. 2019-03-07 12:31:23 +01:00
Houtan Bastani 1190caba61
pac.estimate.nls: clean up code: remove unused variables, unused output arguments, no need for otherwise in switch 2019-03-07 11:59:59 +01:00
Houtan Bastani b844bc53a0
pac: fix bugs in output of ec component 2019-03-07 11:44:40 +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) 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) 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) 3bc6b34161
Bug fix.
Be agnostic about the name of the PAC model.
2019-01-07 13:33:08 +01:00
Stéphane Adjemia (Scylla) c829e7968d
If possible define boundaries for the share of optimizing agents in PAC/NLS.
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.
2018-12-19 16:05:34 +01:00
Stéphane Adjemia (Scylla) df57bf7eb9
Fixed bug.
PAC/NLS routine was only working if the PAC model was named `pacman`.
2018-12-19 16:00:57 +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) cf35496c06
Fixed bug in the evaluation of the sum of squared residuals (PAC/NLS). 2018-11-21 15:21:23 +01:00
Stéphane Adjemian(Charybdis) 2518cd9884 Raise error of an optimization algorithm is not available. 2018-09-13 16:16:07 +02:00
Stéphane Adjemian(Charybdis) 2437d7034e Give access to more than one optimizer in PAC estimation (NLS).
Default is to use csminwel optimizer (because it seems to do the job and does
not rely on the Mathworks toolbox).
2018-09-13 16:15:52 +02:00
Stéphane Adjemian(Charybdis) 0f3678ec4a Fixed ordering of variables in error correction term of PAC equation
PAC equation has to be written as

diff(x) = a0*(xstar(-1)-x(-1)) + a1*diff(x(-1)) + ... + ap*diff(x(-p)) + PAC_EXPECTATION(pacmodelname) + ...;

In the error correction term, a0*(xstar(-1)-x(-1)), we must have the difference
between the target (the trend xstar(-1)) and the level of the endogenous
variable (x(-1)). To ensure stability around the trend, the parameter a0 needs
to be positive.

REMARKS

 [1] In the TREND_COMPONENT_MODEL the error correction terms are written in
 reverse order, ie as the difference betwwen the level of the endogenous
 variable and the trend variable.

 [2] In the estimation routine we do not constrain a0 to be positive, but is
 would surely help to satisfy this condition in the initial condition.
2018-09-06 22:07:31 +02:00
Stéphane Adjemian(Charybdis) 940c970ff3 Use same range in NLS and Iterative OLS.
The range option is the range of data considered for the right hand side variable.
2018-09-04 09:40:47 +02:00
Stéphane Adjemia (Scylla) 30b34c4323 Small efficiency changes. 2018-08-29 16:15:52 +02:00
Stéphane Adjemian(Charybdis) 42bba08887 Make the code robust to the order of declaration of the estimated parameters. 2018-08-15 22:03:33 +02:00
Stéphane Adjemian(Charybdis) 0edebbe5d7 Added Iterative OLS routine for PAC equation. 2018-07-23 16:12:46 +02:00
Stéphane Adjemian(Charybdis) cd9410644f Moved PAC estimation routine (NLS). 2018-07-16 16:30:07 +02:00