Enum GaussNewtonOptimizer.Decomposition
java.lang.Object
java.lang.Enum<GaussNewtonOptimizer.Decomposition>
org.apache.commons.math3.fitting.leastsquares.GaussNewtonOptimizer.Decomposition
- All Implemented Interfaces:
Serializable
,Comparable<GaussNewtonOptimizer.Decomposition>
,java.lang.constant.Constable
- Enclosing class:
GaussNewtonOptimizer
public static enum GaussNewtonOptimizer.Decomposition
extends Enum<GaussNewtonOptimizer.Decomposition>
The decomposition algorithm to use to solve the normal equations.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSolve by forming the normal equations (JTJx=JTr) and using theCholeskyDecomposition
.Solve by forming the normal equations (JTJx=JTr) and using theLUDecomposition
.Solve the linear least squares problem (Jx=r) using theQRDecomposition
.Solve the linear least squares problem using theSingularValueDecomposition
. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract RealVector
solve
(RealMatrix jacobian, RealVector residuals) Solve the linear least squares problem Jx=r.Returns the enum constant of this type with the specified name.static GaussNewtonOptimizer.Decomposition[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
LU
Solve by forming the normal equations (JTJx=JTr) and using theLUDecomposition
.Theoretically this method takes mn2/2 operations to compute the normal matrix and n3/3 operations (m > n) to solve the system using the LU decomposition.
-
QR
Solve the linear least squares problem (Jx=r) using theQRDecomposition
.Theoretically this method takes mn2 - n3/3 operations (m > n) and has better numerical accuracy than any method that forms the normal equations.
-
CHOLESKY
Solve by forming the normal equations (JTJx=JTr) and using theCholeskyDecomposition
.Theoretically this method takes mn2/2 operations to compute the normal matrix and n3/6 operations (m > n) to solve the system using the Cholesky decomposition.
-
SVD
Solve the linear least squares problem using theSingularValueDecomposition
.This method is slower, but can provide a solution for rank deficient and nearly singular systems.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
solve
Solve the linear least squares problem Jx=r.- Parameters:
jacobian
- the Jacobian matrix, J. the number of rows >= the number or columns.residuals
- the computed residuals, r.- Returns:
- the solution x, to the linear least squares problem Jx=r.
- Throws:
ConvergenceException
- if the matrix properties (e.g. singular) do not permit a solution.
-