This class solve a least-square problem by solving the normal equations of the linearized problem at each iteration. Either LU decomposition or Cholesky decomposition can be used to solve the normal equations, or QR decomposition or SVD decomposition can be used to solve the linear system. LU decomposition is faster but QR decomposition is more robust for difficult problems, and SVD can compute a solution for rank-deficient problems.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | GaussNewtonOptimizer.
The decomposition algorithm to use to solve the normal equations. |
| Modifier and Type | Field and Description |
|---|---|
| private final GaussNewtonOptimizer. | decomposition
Indicator for using LU decomposition. |
| private static final double | SINGULARITY_THRESHOLD
The singularity threshold for matrix decompositions. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | GaussNewtonOptimizer(final GaussNewtonOptimizer.
the decompositionDecomposition algorithm.Create a Gauss Newton optimizer that uses the given decomposition algorithm to solve the normal equations. |
| Modifier and Type | Method and Description |
|---|---|
| private static Pair | Returns: the n by n normal matrix and the n by 1 JTr vector.the m by n jacobian matrix, J. Input. jacobian, final RealVector the m by 1 residual vector, r. Input. residuals)Compute the normal matrix, JTJ. |
| public GaussNewtonOptimizer. | Returns: the matrixDecomposition algoritm.Get the matrix decomposition algorithm used to solve the normal equations. |
| public LeastSquaresOptimizer. | optimize(final LeastSquaresProblem
the problem definition, including model function and
convergence criteria. lsp)Implements org. Solve the non-linear least squares problem. |
| public String | |
| public GaussNewtonOptimizer | Returns: a new instance.the newDecompositionDecomposition algorithm to use.Configure the decomposition algorithm. |
| decomposition | back to summary |
|---|---|
| private final GaussNewtonOptimizer. Indicator for using LU decomposition. | |
| SINGULARITY_THRESHOLD | back to summary |
|---|---|
| private static final double SINGULARITY_THRESHOLD The singularity threshold for matrix decompositions. Determines when a | |
| GaussNewtonOptimizer | back to summary |
|---|---|
| public GaussNewtonOptimizer() Creates a Gauss Newton optimizer. The default for the algorithm is to solve the normal equations using QR decomposition. | |
| GaussNewtonOptimizer | back to summary |
|---|---|
| public GaussNewtonOptimizer(final GaussNewtonOptimizer. Create a Gauss Newton optimizer that uses the given decomposition algorithm to solve the normal equations.
| |
| computeNormalMatrix | back to summary |
|---|---|
| private static Pair Compute the normal matrix, JTJ.
| |
| getDecomposition | back to summary |
|---|---|
| public GaussNewtonOptimizer. Get the matrix decomposition algorithm used to solve the normal equations.
| |
| optimize | back to summary |
|---|---|
| public LeastSquaresOptimizer. Implements org. Doc from org. Solve the non-linear least squares problem.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| withDecomposition | back to summary |
|---|---|
| public GaussNewtonOptimizer withDecomposition(final GaussNewtonOptimizer. Configure the decomposition algorithm.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final GaussNewtonOptimizer. | CHOLESKY
Solve by forming the normal equations (JTJx=JTr) and
using the |
| public static final GaussNewtonOptimizer. | LU
Solve by forming the normal equations (JTJx=JTr) and
using the |
| public static final GaussNewtonOptimizer. | QR
Solve the linear least squares problem (Jx=r) using the |
| public static final GaussNewtonOptimizer. | SVD
Solve the linear least squares problem using the |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract RealVector | Returns: the solution x, to the linear least squares problem Jx=r.the Jacobian matrix, J. the number of rows >= the number or
columns. jacobian, RealVector the computed residuals, r. residuals)Solve the linear least squares problem Jx=r. |
| public static GaussNewtonOptimizer. | |
| public static GaussNewtonOptimizer. |
| CHOLESKY | back to summary |
|---|---|
| public static final GaussNewtonOptimizer. Solve by forming the normal equations (JTJx=JTr) and
using the 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. | |
| LU | back to summary |
|---|---|
| public static final GaussNewtonOptimizer. Solve by forming the normal equations (JTJx=JTr) and
using the 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 | back to summary |
|---|---|
| public static final GaussNewtonOptimizer. Solve the linear least squares problem (Jx=r) using the Theoretically this method takes mn2 - n3/3 operations (m > n) and has better numerical accuracy than any method that forms the normal equations. | |
| SVD | back to summary |
|---|---|
| public static final GaussNewtonOptimizer. Solve the linear least squares problem using the This method is slower, but can provide a solution for rank deficient and nearly singular systems. | |
| Decomposition | back to summary |
|---|---|
| private Decomposition() | |
| solve | back to summary |
|---|---|
| protected abstract RealVector solve(RealMatrix jacobian, RealVector residuals) Solve the linear least squares problem Jx=r.
| |
| valueOf | back to summary |
|---|---|
| public static GaussNewtonOptimizer. | |
| values | back to summary |
|---|---|
| public static GaussNewtonOptimizer. | |