public abstract class AbstractLeastSquaresOptimizer extends java.lang.Object implements DifferentiableMultivariateVectorialOptimizer
This base class handles the boilerplate methods associated to thresholds settings, jacobian and error estimation.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_ITERATIONS
Default maximal number of iterations allowed.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getChiSquare()
Get a Chi-Square-like value assuming the N residuals follow N
distinct normal distributions centered on 0 and whose variances are
the reciprocal of the weights.
|
VectorialConvergenceChecker |
getConvergenceChecker()
Get the convergence checker.
|
double[][] |
getCovariances()
Get the covariance matrix of optimized parameters.
|
int |
getEvaluations()
Get the number of evaluations of the objective function.
|
int |
getIterations()
Get the number of iterations realized by the algorithm.
|
int |
getJacobianEvaluations()
Get the number of evaluations of the objective function jacobian .
|
int |
getMaxEvaluations()
Get the maximal number of functions evaluations.
|
int |
getMaxIterations()
Get the maximal number of iterations of the algorithm.
|
double |
getRMS()
Get the Root Mean Square value.
|
double[] |
guessParametersErrors()
Guess the errors in optimized parameters.
|
VectorialPointValuePair |
optimize(DifferentiableMultivariateVectorialFunction f,
double[] target,
double[] weights,
double[] startPoint)
Optimizes an objective function.
|
void |
setConvergenceChecker(VectorialConvergenceChecker convergenceChecker)
Set the convergence checker.
|
void |
setMaxEvaluations(int maxEvaluations)
Set the maximal number of functions evaluations.
|
void |
setMaxIterations(int maxIterations)
Set the maximal number of iterations of the algorithm.
|
public static final int DEFAULT_MAX_ITERATIONS
public void setMaxIterations(int maxIterations)
setMaxIterations in interface DifferentiableMultivariateVectorialOptimizermaxIterations - maximal number of function calls
.public int getMaxIterations()
getMaxIterations in interface DifferentiableMultivariateVectorialOptimizerpublic int getIterations()
getIterations in interface DifferentiableMultivariateVectorialOptimizerpublic void setMaxEvaluations(int maxEvaluations)
setMaxEvaluations in interface DifferentiableMultivariateVectorialOptimizermaxEvaluations - maximal number of function evaluationspublic int getMaxEvaluations()
getMaxEvaluations in interface DifferentiableMultivariateVectorialOptimizerpublic int getEvaluations()
The number of evaluation correspond to the last call to the
optimize method. It is 0 if
the method has not been called yet.
getEvaluations in interface DifferentiableMultivariateVectorialOptimizerpublic int getJacobianEvaluations()
The number of evaluation correspond to the last call to the
optimize method. It is 0 if
the method has not been called yet.
getJacobianEvaluations in interface DifferentiableMultivariateVectorialOptimizerpublic void setConvergenceChecker(VectorialConvergenceChecker convergenceChecker)
setConvergenceChecker in interface DifferentiableMultivariateVectorialOptimizerconvergenceChecker - object to use to check for convergencepublic VectorialConvergenceChecker getConvergenceChecker()
getConvergenceChecker in interface DifferentiableMultivariateVectorialOptimizerpublic double getRMS()
public double getChiSquare()
public double[][] getCovariances()
throws FunctionEvaluationException,
OptimizationException
FunctionEvaluationException - if the function jacobian cannot
be evaluatedOptimizationException - if the covariance matrix
cannot be computed (singular problem)public double[] guessParametersErrors()
throws FunctionEvaluationException,
OptimizationException
Guessing is covariance-based, it only gives rough order of magnitude.
FunctionEvaluationException - if the function jacobian cannot b evaluatedOptimizationException - if the covariances matrix cannot be computed
or the number of degrees of freedom is not positive (number of measurements
lesser or equal to number of parameters)public VectorialPointValuePair optimize(DifferentiableMultivariateVectorialFunction f, double[] target, double[] weights, double[] startPoint) throws FunctionEvaluationException, OptimizationException, java.lang.IllegalArgumentException
Optimization is considered to be a weighted least-squares minimization. The cost function to be minimized is ∑weighti(objectivei-targeti)2
optimize in interface DifferentiableMultivariateVectorialOptimizerf - objective functiontarget - target value for the objective functions at optimumweights - weight for the least squares cost computationstartPoint - the start point for optimizationFunctionEvaluationException - if the objective function throws one during
the searchOptimizationException - if the algorithm failed to convergejava.lang.IllegalArgumentException - if the start point dimension is wrongCopyright © 2010 - 2023 Adobe. All Rights Reserved