public class LevenbergMarquardtOptimizer extends Object implements LeastSquaresOptimizer
This implementation should work even for over-determined systems (i.e. systems having more point than equations). Over-determined systems are solved by ignoring the point which have the smallest impact according to their jacobian column norm. Only the rank of the matrix and some loop bounds are changed to implement this.
The resolution engine is a simple translation of the MINPACK lmder routine with minor changes. The changes include the over-determined resolution, the use of inherited convergence checker and the Q.R. decomposition which has been rewritten following the algorithm described in the P. Lascaux and R. Theodor book Analyse numérique matricielle appliquée à l'art de l'ingénieur, Masson 1986.
The authors of the original fortran version are:
Minpack Copyright Notice (1999) University of Chicago. All rights reserved |
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
|
LeastSquaresOptimizer.Optimum
Constructor and Description |
---|
LevenbergMarquardtOptimizer()
Default constructor.
|
LevenbergMarquardtOptimizer(double initialStepBoundFactor,
double costRelativeTolerance,
double parRelativeTolerance,
double orthoTolerance,
double qrRankingThreshold)
Construct an instance with all parameters specified.
|
Modifier and Type | Method and Description |
---|---|
double |
getCostRelativeTolerance()
Gets the value of a tuning parameter.
|
double |
getInitialStepBoundFactor()
Gets the value of a tuning parameter.
|
double |
getOrthoTolerance()
Gets the value of a tuning parameter.
|
double |
getParameterRelativeTolerance()
Gets the value of a tuning parameter.
|
double |
getRankingThreshold()
Gets the value of a tuning parameter.
|
LeastSquaresOptimizer.Optimum |
optimize(LeastSquaresProblem problem)
Solve the non-linear least squares problem.
|
LevenbergMarquardtOptimizer |
withCostRelativeTolerance(double newCostRelativeTolerance) |
LevenbergMarquardtOptimizer |
withInitialStepBoundFactor(double newInitialStepBoundFactor) |
LevenbergMarquardtOptimizer |
withOrthoTolerance(double newOrthoTolerance)
Modifies the given parameter.
|
LevenbergMarquardtOptimizer |
withParameterRelativeTolerance(double newParRelativeTolerance) |
LevenbergMarquardtOptimizer |
withRankingThreshold(double newQRRankingThreshold) |
public LevenbergMarquardtOptimizer()
The default values for the algorithm settings are:
Precision.SAFE_MIN
public LevenbergMarquardtOptimizer(double initialStepBoundFactor, double costRelativeTolerance, double parRelativeTolerance, double orthoTolerance, double qrRankingThreshold)
initialStepBoundFactor
- initial step bound factorcostRelativeTolerance
- cost relative toleranceparRelativeTolerance
- parameters relative toleranceorthoTolerance
- orthogonality toleranceqrRankingThreshold
- threshold in the QR decomposition. Columns with a 2
norm less than this threshold are considered to be
all 0s.public LevenbergMarquardtOptimizer withInitialStepBoundFactor(double newInitialStepBoundFactor)
newInitialStepBoundFactor
- Positive input variable used in
determining the initial step bound. This bound is set to the
product of initialStepBoundFactor and the euclidean norm of
diag * x
if non-zero, or else to newInitialStepBoundFactor
itself. In most cases factor should lie in the interval
(0.1, 100.0)
. 100
is a generally recommended value.
of the matrix is reduced.public LevenbergMarquardtOptimizer withCostRelativeTolerance(double newCostRelativeTolerance)
newCostRelativeTolerance
- Desired relative error in the sum of squares.public LevenbergMarquardtOptimizer withParameterRelativeTolerance(double newParRelativeTolerance)
newParRelativeTolerance
- Desired relative error in the approximate solution
parameters.public LevenbergMarquardtOptimizer withOrthoTolerance(double newOrthoTolerance)
newOrthoTolerance
- Desired max cosine on the orthogonality between
the function vector and the columns of the Jacobian.public LevenbergMarquardtOptimizer withRankingThreshold(double newQRRankingThreshold)
newQRRankingThreshold
- Desired threshold for QR ranking.
If the squared norm of a column vector is smaller or equal to this
threshold during QR decomposition, it is considered to be a zero vector
and hence the rank of the matrix is reduced.public double getInitialStepBoundFactor()
withInitialStepBoundFactor(double)
public double getCostRelativeTolerance()
withCostRelativeTolerance(double)
public double getParameterRelativeTolerance()
withParameterRelativeTolerance(double)
public double getOrthoTolerance()
withOrthoTolerance(double)
public double getRankingThreshold()
withRankingThreshold(double)
public LeastSquaresOptimizer.Optimum optimize(LeastSquaresProblem problem)
optimize
in interface LeastSquaresOptimizer
problem
- the problem definition, including model function and
convergence criteria.Copyright © 2016–2020 Hipparchus.org. All rights reserved.