LeastSquaresOptimizer
public class GaussNewtonOptimizer extends Object implements LeastSquaresOptimizer
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. Cholesky/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 | Description |
---|---|---|
static class |
GaussNewtonOptimizer.Decomposition |
Deprecated.
Use
MatrixDecomposer instead. |
LeastSquaresOptimizer.Optimum
Constructor | Description |
---|---|
GaussNewtonOptimizer() |
Creates a Gauss Newton optimizer.
|
GaussNewtonOptimizer(MatrixDecomposer decomposer,
boolean formNormalEquations) |
Create a Gauss Newton optimizer that uses the given matrix decomposition algorithm
to solve the normal equations.
|
GaussNewtonOptimizer(GaussNewtonOptimizer.Decomposition decomposition) |
Deprecated.
Use
GaussNewtonOptimizer(MatrixDecomposer, boolean) instead.
The new constructor provides control of the numerical tolerances in the
decomposition. |
Modifier and Type | Method | Description |
---|---|---|
MatrixDecomposer |
getDecomposer() |
Get the matrix decomposition algorithm.
|
GaussNewtonOptimizer.Decomposition |
getDecomposition() |
Deprecated.
Use
getDecomposer() and isFormNormalEquations()
instead. |
boolean |
isFormNormalEquations() |
Get if the normal equations are explicitly formed.
|
LeastSquaresOptimizer.Optimum |
optimize(LeastSquaresProblem lsp) |
Solve the non-linear least squares problem.
|
String |
toString() |
|
GaussNewtonOptimizer |
withDecomposer(MatrixDecomposer newDecomposer) |
Configure the matrix decomposition algorithm.
|
GaussNewtonOptimizer |
withDecomposition(GaussNewtonOptimizer.Decomposition newDecomposition) |
Deprecated.
Use
withDecomposer(MatrixDecomposer) and withFormNormalEquations(boolean) instead. the new methods allow the numerical
tolerance of the decomposition to be set. |
GaussNewtonOptimizer |
withFormNormalEquations(boolean newFormNormalEquations) |
Configure if the normal equations should be explicitly formed.
|
public GaussNewtonOptimizer()
@Deprecated public GaussNewtonOptimizer(GaussNewtonOptimizer.Decomposition decomposition)
GaussNewtonOptimizer(MatrixDecomposer, boolean)
instead.
The new constructor provides control of the numerical tolerances in the
decomposition.decomposition
- the GaussNewtonOptimizer.Decomposition
algorithm.public GaussNewtonOptimizer(MatrixDecomposer decomposer, boolean formNormalEquations)
decomposer
- the decomposition algorithm to use.formNormalEquations
- whether the normal equations should be explicitly
formed. If true
then decomposer
is used
to solve JTJx=JTr, otherwise
decomposer
is used to solve Jx=r. If
decomposer
can only solve square systems then this
parameter should be true
.@Deprecated public GaussNewtonOptimizer.Decomposition getDecomposition()
getDecomposer()
and isFormNormalEquations()
instead.GaussNewtonOptimizer.Decomposition
algorithm. May be null
.@Deprecated public GaussNewtonOptimizer withDecomposition(GaussNewtonOptimizer.Decomposition newDecomposition)
withDecomposer(MatrixDecomposer)
and withFormNormalEquations(boolean)
instead. the new methods allow the numerical
tolerance of the decomposition to be set.newDecomposition
- the GaussNewtonOptimizer.Decomposition
algorithm to use.public MatrixDecomposer getDecomposer()
public GaussNewtonOptimizer withDecomposer(MatrixDecomposer newDecomposer)
newDecomposer
- the decomposition algorithm to use.public boolean isFormNormalEquations()
true
then
decomposer
is used to solve JTJx=JTr, otherwise
decomposer
is used to solve Jx=r.public GaussNewtonOptimizer withFormNormalEquations(boolean newFormNormalEquations)
newFormNormalEquations
- whether the normal equations should be explicitly
formed. If true
then decomposer
is used
to solve JTJx=JTr, otherwise
decomposer
is used to solve Jx=r. If
decomposer
can only solve square systems then this
parameter should be true
.public LeastSquaresOptimizer.Optimum optimize(LeastSquaresProblem lsp)
optimize
in interface LeastSquaresOptimizer
lsp
- the problem definition, including model function and
convergence criteria.Copyright © 2016–2018 Hipparchus.org. All rights reserved.