Luc Maisonobe [Wed, 14 May 2014 18:42:03 +0000 (18:42 +0000)]
Release candidate 3 for Apache Commons Math 3.3 has passed vote
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/tags/MATH_3_3@
1594665 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Wed, 7 May 2014 20:40:29 +0000 (20:40 +0000)]
Creating Commons Math v3.3 tag.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/tags/MATH_3_3_RC3@
1593134 13f79535-47bb-0310-9956-
ffa450edef68
Phil Steitz [Sun, 4 May 2014 23:19:43 +0000 (23:19 +0000)]
Added StatUtils convenience methods and updated user guide for Kolmogorov-Smirnov tests. JIRA: MATH-437.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1592430 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Fri, 2 May 2014 09:04:01 +0000 (09:04 +0000)]
Revert javadoc changes after discussion on the mailinglist.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591835 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Fri, 2 May 2014 08:03:03 +0000 (08:03 +0000)]
Fixed checkstyle error.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591822 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Thu, 1 May 2014 20:43:46 +0000 (20:43 +0000)]
Removed test based on the assumption that iterating over a
"ConcurrentHashMap" would always provide its elements in a
random order. This seemed to be the case up to Java 7 but
not always in Java 8.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591770 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Thu, 1 May 2014 20:05:31 +0000 (20:05 +0000)]
Re-enabled test, build is anyway not ready for Java 8.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591760 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Thu, 1 May 2014 13:48:02 +0000 (13:48 +0000)]
Javadoc fixes with Java 8.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591664 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Thu, 1 May 2014 12:14:14 +0000 (12:14 +0000)]
Disable randomly failing unit test.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591631 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Thu, 1 May 2014 11:57:55 +0000 (11:57 +0000)]
Add missing due-to.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591626 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Thu, 1 May 2014 11:54:06 +0000 (11:54 +0000)]
[MATH-1110] Added constructor to OLSMultipleLinearRegression to be able to specify a custom singularity threshold for QR decomposition. Thanks to Edward Segall.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591624 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Thu, 1 May 2014 11:12:12 +0000 (11:12 +0000)]
Fix typo.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591603 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Wed, 30 Apr 2014 22:18:03 +0000 (22:18 +0000)]
MATH-1092
Added changelog entry.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591497 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Wed, 30 Apr 2014 19:06:20 +0000 (19:06 +0000)]
Added missing change entry for 3.3.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591448 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Wed, 30 Apr 2014 08:21:15 +0000 (08:21 +0000)]
Added findbugs exception for CMAES.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591212 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Wed, 30 Apr 2014 08:20:51 +0000 (08:20 +0000)]
Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1591211 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Tue, 29 Apr 2014 06:29:53 +0000 (06:29 +0000)]
Apache is now part of the project name.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1590879 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Mon, 28 Apr 2014 22:04:42 +0000 (22:04 +0000)]
Change naming of tools jar to support the classifier tag of maven.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1590823 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Mon, 28 Apr 2014 21:33:38 +0000 (21:33 +0000)]
Add link to javadoc of latest release.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1590809 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Mon, 28 Apr 2014 21:32:05 +0000 (21:32 +0000)]
Update changelog.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1590808 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Mon, 28 Apr 2014 06:39:21 +0000 (06:39 +0000)]
Fixed javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1590561 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Mon, 28 Apr 2014 06:39:01 +0000 (06:39 +0000)]
Typos.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1590560 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sat, 26 Apr 2014 17:36:34 +0000 (17:36 +0000)]
Build empty polyhedrons set when given equal min/max boundaries.
Also explained better in the javadoc about some wrong usage of
PolyhedronsSet constructor.
JIRA: MATH-1115
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1590254 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sat, 26 Apr 2014 16:55:11 +0000 (16:55 +0000)]
Build properly empty polygons for equal min/max box.
JIRA: MATH-1117
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1590251 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sun, 20 Apr 2014 14:29:42 +0000 (14:29 +0000)]
Added a fast single-step method for fixed-step Runge-Kutta integrators.
JIRA: MATH-1119
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1588769 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sun, 20 Apr 2014 13:30:16 +0000 (13:30 +0000)]
Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1588755 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sun, 20 Apr 2014 13:25:36 +0000 (13:25 +0000)]
Math.nextUp is not available before Java 1.6.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1588754 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sun, 20 Apr 2014 13:25:11 +0000 (13:25 +0000)]
Added an order 6 fixed-step ODE integrator.
The integrator was designed by H. A. Luther in 1968. We have added a
corresponding step interpolator by solving the order conditions provided
by the rkcheck tool.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1588753 13f79535-47bb-0310-9956-
ffa450edef68
Phil Steitz [Sat, 19 Apr 2014 01:27:33 +0000 (01:27 +0000)]
Removed deprecations of test(.) methods.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1588601 13f79535-47bb-0310-9956-
ffa450edef68
Phil Steitz [Sat, 19 Apr 2014 01:24:37 +0000 (01:24 +0000)]
Advertise the right exception.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1588600 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Fri, 18 Apr 2014 15:58:47 +0000 (15:58 +0000)]
MATH-1118
Fixed compatibility of "equals(Object)" with "hashCode()" ("Complex" will
behave as JDK's "Double"). Added new methods for testing floating-point
equality.
Thanks to Cyrille Artho for reporting the issue.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1588500 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Thu, 17 Apr 2014 09:14:24 +0000 (09:14 +0000)]
Typo.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1588182 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Tue, 15 Apr 2014 12:22:31 +0000 (12:22 +0000)]
MATH-1118
Equality of double values in accordance with the semantics of "java.lang.Double".
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1587548 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Tue, 15 Apr 2014 10:02:54 +0000 (10:02 +0000)]
MATH-1116
Javadoc
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1587494 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Thu, 27 Mar 2014 21:47:41 +0000 (21:47 +0000)]
Replace tabs.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1582491 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Tue, 25 Mar 2014 16:05:36 +0000 (16:05 +0000)]
Clearer statements.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1581393 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Tue, 25 Mar 2014 16:00:36 +0000 (16:00 +0000)]
Minimize number of array accesses.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1581391 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Tue, 25 Mar 2014 15:57:18 +0000 (15:57 +0000)]
"final" keyword.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1581389 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Tue, 25 Mar 2014 15:51:25 +0000 (15:51 +0000)]
Minimize number of array accesses.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1581383 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Tue, 25 Mar 2014 15:48:28 +0000 (15:48 +0000)]
"final" keyword.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1581381 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Wed, 19 Mar 2014 18:43:39 +0000 (18:43 +0000)]
Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1579346 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Wed, 19 Mar 2014 18:33:13 +0000 (18:33 +0000)]
MATH-1111
Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1579343 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Mon, 17 Mar 2014 15:14:07 +0000 (15:14 +0000)]
Improved brackting utility for univariate solvers.
Bracketing utility for univariate root solvers now returns a tighter
interval than before. It also allows choosing the search interval
expansion rate, supporting both linear and asymptotically exponential
rates.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1578428 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Mon, 3 Mar 2014 11:11:46 +0000 (11:11 +0000)]
Fixed failing test.
As functions evaluations were not counted properly, which has been fixed
a few days ago, the multi-start test in fact did not performed all
expected restarts. This commit fixes this (by increasing the max
evaluations), and fixes the result checks accordingly.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1573523 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Mon, 3 Mar 2014 09:58:29 +0000 (09:58 +0000)]
Prevent penalties to grow multiplicatively in CMAES.
Patch provided by Bruce A Johnson.
JIRA: MATH-1107
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1573506 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sun, 2 Mar 2014 19:54:43 +0000 (19:54 +0000)]
Add SVD to GaussNewtonOptimizer
Allow using the SVD decomposition which has excellent stability and can
provide a "solution" for singular problems.
Figured out why one of the least squares tests did not check two of the
states. There was only one equation for the two states. The test now
verifies the states satisfy the constraint.
Patch provided by Evan Ward.
JIRA: MATH-1104
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1573351 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Sun, 2 Mar 2014 19:38:47 +0000 (19:38 +0000)]
MATH-1092
Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1573341 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Sun, 2 Mar 2014 14:54:37 +0000 (14:54 +0000)]
MATH-1092
Added parameter in "LineSearch" and "NonLinearConjugateGradientOptimizer".
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1573316 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sun, 2 Mar 2014 14:02:50 +0000 (14:02 +0000)]
Fix switched iterations and evaluations
In LevenbergMarquardtOptimizer the number of iterations and evaluations
was switched in two of the return statements.
Patch provided by Evan Ward.
JIRA: MATH-1106
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1573308 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sun, 2 Mar 2014 14:02:21 +0000 (14:02 +0000)]
Fix checker seeing not old point
ConvergenceCheckers always saw previous.getPoint() to equal
current.getPoint() because the optimizers used the same array and did
not make a copy of the previous point. Fixed by using a new array for
each model evaluation and LSP.evaluate() now makes its own copy of the
state vector as well.
Path provided by Evan Ward.
JIRA: MATH-1103
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1573307 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Sun, 2 Mar 2014 08:31:30 +0000 (08:31 +0000)]
Fix typo.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1573271 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Fri, 28 Feb 2014 16:23:26 +0000 (16:23 +0000)]
MATH-1092
Extracted class "LineSearch" from "PowellOptimizer".
Made method "computeObjectiveValue" public in "MultivariateOptimizer".
Modified "PowellOptimizer" to use the now public class.
"NonLinearConjugateGradientOptimizer" uses the new "LineSearch".
Added constructors to set the line search tolerances and deprecated
obsolete contructors and inner classes ("BracketingStep" and
"LineSearchFunction".
Removed method "findUpperBound".
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1572988 13f79535-47bb-0310-9956-
ffa450edef68
Phil Steitz [Wed, 26 Feb 2014 23:24:21 +0000 (23:24 +0000)]
Fixed comment.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1572341 13f79535-47bb-0310-9956-
ffa450edef68
Phil Steitz [Wed, 26 Feb 2014 23:14:08 +0000 (23:14 +0000)]
Added KolmogorovSmirnovTest, deprecated KolmogorovSmirnovDistributio. JIRA: MATH-437
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1572335 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 25 Feb 2014 16:42:07 +0000 (16:42 +0000)]
Improved test coverage.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1571737 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Tue, 25 Feb 2014 10:27:21 +0000 (10:27 +0000)]
Typo.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1571640 13f79535-47bb-0310-9956-
ffa450edef68
Gilles Sadowski [Tue, 25 Feb 2014 10:26:55 +0000 (10:26 +0000)]
Fixed small inconsistency.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1571639 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 25 Feb 2014 09:21:32 +0000 (09:21 +0000)]
Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1571627 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Mon, 24 Feb 2014 14:58:07 +0000 (14:58 +0000)]
Make AbstractEvaluation public
Allow custom implementations of LeastSquaresProblem to use the default
methods for computing the covariance, rms, etc.
JIRA: MATH-1102
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1571307 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Mon, 24 Feb 2014 14:57:44 +0000 (14:57 +0000)]
In LeastSquaresProblem.Evaluation removed the getValue() method.
- The residuals are the really the values of the objective function
that is being minimized.
- Forcing the value to be a real vector and the residual computed
through subtraction is an unnecessary constraint. For example
Rotation.distance() will compute a better residual than
subtracting the quaternion elements of two rotations.
- Method was not used by any optimizer.
JIRA: MATH-1102
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1571306 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sun, 23 Feb 2014 14:00:48 +0000 (14:00 +0000)]
Moved OptimizationProblem interface to optim package.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1571015 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sun, 23 Feb 2014 14:00:20 +0000 (14:00 +0000)]
Change private least square problem implementation to internal class.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1571014 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Sun, 23 Feb 2014 11:10:41 +0000 (11:10 +0000)]
Improved documentation of QR decomposition handling of singular matrix.
JIRA: MATH-1101
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1570994 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Fri, 21 Feb 2014 13:18:35 +0000 (13:18 +0000)]
QR decomposition can compute pseudo-inverses for tall matrices.
Thanks to Sean Owen for the patch.
JIRA: MATH-1053
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1570566 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Fri, 21 Feb 2014 11:26:09 +0000 (11:26 +0000)]
Field vectors now implement the visitor pattern just like real vectors.
JIRA: MATH-820
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1570536 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Fri, 21 Feb 2014 10:16:52 +0000 (10:16 +0000)]
Un-deprecated RealVector.sparseIterator.
The documentation now explicitly states that entries not iterated above
are the zero ones.
This is part of Apache Commons Math reconsidering support for sparse
linear algebra.
JIRA: MATH-875
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1570510 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Thu, 20 Feb 2014 16:16:19 +0000 (16:16 +0000)]
Relaxed specification for function mapping on vectors.
JIRA: MATH-821
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1570254 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Thu, 20 Feb 2014 15:56:37 +0000 (15:56 +0000)]
Continue un-deprecation of sparse methods.
JIRA: MATH-870
JIRA: MATH-803
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1570246 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Thu, 20 Feb 2014 14:52:13 +0000 (14:52 +0000)]
Added a test showing the limitation of sparse matrices implementation.
JIRA:MATH-870.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1570209 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Thu, 20 Feb 2014 14:35:14 +0000 (14:35 +0000)]
computeXxx renamed getXxx in the Evaluation interface (leastsquares).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1570206 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Wed, 19 Feb 2014 20:32:43 +0000 (20:32 +0000)]
Make QR the default in GaussNewtonOptimizer
Theoretically QR offers the best blend of speed and numerical stability.
Empirically the QR implementation is slightly faster than the Cholesky
implementation.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569907 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Wed, 19 Feb 2014 20:32:20 +0000 (20:32 +0000)]
Add Cholesky option to GaussNewtonOptimizer
Since the normal matrix is symmetric positive (semi-)definite, the
Cholesky decomposition is theoretically faster.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569906 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Wed, 19 Feb 2014 20:31:47 +0000 (20:31 +0000)]
Make QR in GaussNewton faster and more accurate
Re-factored the code in GaussNewtonOptimizer so that the decomposition
algorithm sees the Jacobian and residuals instead of the normal
equation. This lets the QR algorithm operate directly on the Jacobian
matrix, which is faster and less sensitive to numerical errors. As a
result, one test case that threw a singular matrix exception now passes
with the QR decomposition.
The refactoring also include a speed improvement when computing the
normal matrix for the LU decomposition. Since the normal matrix is
symmetric only half of is computed, which results in a factor of 2 speed
up in computing the normal matrix for problems with many more
measurements than states.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569905 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Wed, 19 Feb 2014 17:19:59 +0000 (17:19 +0000)]
The sparse vector and matrix classes have been un-deprecated.
This is a reversal of a former decision, as we now think we should adopt
a generally accepted behavior which is ... to ignore the problems of
NaNs and infinities in sparse linear algebra entities.
JIRA: MATH-870 (which is therefore NOT fixed)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569825 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 15:11:46 +0000 (15:11 +0000)]
Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569380 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:33:57 +0000 (14:33 +0000)]
Removed interfaces in the fluent API that do not add any value.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569363 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:33:49 +0000 (14:33 +0000)]
Fixed checkstyle and compiler warnings.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569362 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:33:41 +0000 (14:33 +0000)]
Expand Evaluation tests, use weighted values.
Added more test cases to EvaluationTest to test the other methods of
DenseWeightedEvaluation/UnweightedEvaluation.
Fixed a bug in DenseWeightedEvaluation.computeValue() where the the
weights were not applied to the return value.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569361 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:33:33 +0000 (14:33 +0000)]
Qualify Evaluation in interfaces.
Use LeastSquaresProblem.Evaluation in the public interfaces for
readability.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569360 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:33:28 +0000 (14:33 +0000)]
JUnit directly executes least squares tests
Previously JUnit would make the call to test a specific optimizer, and
then that method would call all of the individual test cases relevant to
that optimizer.,Now JUnit will directly call each individual test case.
The same test coverage is preserved. The GaussNewtonOptimizerTest is
split into two classes, one for each decomposition algorithm it can use.
There is a significant amount of duplicated code between
GaussNewtonOptimizerWithLUTest and GaussNewtonOptimizerWithQRTest.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569359 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:33:20 +0000 (14:33 +0000)]
Fixed errors introduced by few previous API changes.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569358 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:33:14 +0000 (14:33 +0000)]
Fix Javadoc and checkstyle errors.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569357 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:33:08 +0000 (14:33 +0000)]
Clean up LeastSquaresBuilder
Provide methods for using old and new interfaces. Data is stored internally
using the new interfaces now.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569356 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:33:00 +0000 (14:33 +0000)]
Clean up LeastSquaresFactory
* There are now 3 factory methods: one using the previous interfaces, one using
the new interfaces with weights, and one using the new interfaces without
weights.
* Make model(...) method public.
* Fix javadoc typo
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569355 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:32:54 +0000 (14:32 +0000)]
Use Real{Vector,Matrix} in LeastSquares interfaces
Covered all of the interfaces in the leastsquares package to use RealVector and
RealMatrix instead of double[] and double[][]. This reduced some duplicated code.
For example Evaluation.computeResiduals() was a complete duplication of
RealVector.subtract(). It also presents a consistent interface and allows data
encapsulation.
Lastly, this change enables [math] to "eat our own dog food." It enables the
linear package to be used in the implementation of the optimization algorithms.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569354 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:32:44 +0000 (14:32 +0000)]
Use Evaluation instead of PointVectorValuePair
Use Evaluation instead of PointVectorValuePair in the ConvergenceChecker. This
gives the checkers access to more information, such as the rms and covariances.
The change also simplified the optimizer implementations since they no longer
have to keep track of the current function value.
A method was added to LeastSquaresFactory to convert between the two types of
checkers and a method added to LeastSquaresBuilder so that it can accept either
type. I would have prefered to do this through method overloading, but
overloading doesn't play well with generics.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569353 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:32:36 +0000 (14:32 +0000)]
Use enum for LU or QR in GaussNewtonOptimizer
Changed the boolean useLu prarameter to an enum. This is benificial because:
1. user code is easier to read: new GNO(Decomposition.QR) instead of new GNO(false)
2. Allows other algorithms to be added in the future
3. developer code is easier to read. One less if statement in optimize()
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569352 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:32:28 +0000 (14:32 +0000)]
Make infinite loop in GaussNewton explicit.
The main loop in GN could only be ended by convergence or exception. I made that
explicit with while(true) and removed an unreachable MathInternalError.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569350 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:32:23 +0000 (14:32 +0000)]
LevenbergMarquardtOptimizer is thread safe.
Converted the mutable fields to locals.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569349 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:32:17 +0000 (14:32 +0000)]
Add Javadoc to LeastSquaresBuilder.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569348 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:32:11 +0000 (14:32 +0000)]
Fixup javadoc in LeastSquaresProblem
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569347 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:32:06 +0000 (14:32 +0000)]
Value and Jacobian evaluated in a single method.
A new interface MultivariateJacobianFunction lets the function value and
Jacobian be evaluated at the same time. This saves the user from having to cache
the result between calls to get the value and the jacobian.
A factory method was added to create LeastSquaresProblems from the new interface.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569346 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:31:59 +0000 (14:31 +0000)]
Clean up LeastSquaresProblemImpl
Reorder constructor parameters to match LeastSquaresFactory and remove an unused
method.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569345 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:31:53 +0000 (14:31 +0000)]
Implicit Weights
The weights are no longer implicit in LeastSquaresProblem.Evaluation. They are
already included in the computed residuals and Jacobian.
GN and LM multiplied the residuals by the weights immediately, so that was easy
to remove.
Created an AbstractEvaluation class which handles the derived quantitied (cost,
rms, covariance,...) and two implementations. UnweightedEvaluation uses the
straight forward formulas. DenseWeightedEvaluation delegates to an Evaluation
and multiples the residuals and Jacobian by the square root of the weight matrix
before returning them. Allowed me to remove the reference to the full weight
matrix.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569344 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:31:43 +0000 (14:31 +0000)]
Immutable Optimizer configuration.
The GN and LM optimizers now use an immutable fields for their configuration
parameters and a fluent api. LM still has some mutable fields it uses a scratch
space.
This commit is a backport of Evan Ward github commit
https://github.com/wardev/commons-math/commit/
157cdde
into the current development version.
Conflicts:
src/main/java/org/apache/commons/math3/fitting/leastsquares/GaussNewtonOptimizer.java
src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569343 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Tue, 18 Feb 2014 14:31:34 +0000 (14:31 +0000)]
Separate least squares algorithm from problem.
The least squares package now has two main interfaces LeastSquaresOptimizer and
LeastSquaresProblem, where the optimizer can be applied to the problem.
In this commit all of the test cases pass with one change (annotated) to
LevenbergMarquardt.testControlParameters(). The tests for Gauss Newton were
expanded to cover using the QR decomposition, which revealed a QR default
tolerance discrepancy.
A factory and a mutable builder were create for LeastSquaresProblem.
This commit is a backport of Evan Ward github commit
https://github.com/wardev/commons-math/commit/
7e9a15efb535b91afad9d8275eb2864ea2295ab4
into the current development version.
Conflicts:
src/main/java/org/apache/commons/math3/fitting/leastsquares/AbstractLeastSquaresOptimizer.java
src/main/java/org/apache/commons/math3/fitting/leastsquares/GaussNewtonOptimizer.java
src/main/java/org/apache/commons/math3/optim/AbstractOptimizer.java
src/test/java/org/apache/commons/math3/fitting/leastsquares/AbstractLeastSquaresOptimizerAbstractTest.java
src/test/java/org/apache/commons/math3/fitting/leastsquares/GaussNewtonOptimizerTest.java
src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1569342 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Sun, 16 Feb 2014 12:32:52 +0000 (12:32 +0000)]
Update test after adding new error message.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1568754 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Sun, 16 Feb 2014 12:19:51 +0000 (12:19 +0000)]
[MATH-749] Remove GrahamScan, GiftWrap, make MonotoneChain more robust wrt collinear points, add ConvergenceException in case the specified tolerance results in a non-convex hull.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1568752 13f79535-47bb-0310-9956-
ffa450edef68
Luc Maisonobe [Wed, 12 Feb 2014 11:12:45 +0000 (11:12 +0000)]
Rewrote completely the enclosing spherical cap computation on 2-sphere.
The previous version was based on Welzl algorithm, but it appeared this
algorithm really need some properties that hold in Euclidean spaces and
not on the sphere.
The current version is not perfect in the sense that some times the
enclosing spherical cap returned is not the smallest possible. It is
documented in the Javadoc.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1567599 13f79535-47bb-0310-9956-
ffa450edef68
Thomas Neidhart [Tue, 11 Feb 2014 22:33:39 +0000 (22:33 +0000)]
Further improvements.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@
1567427 13f79535-47bb-0310-9956-
ffa450edef68