|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math.optimization.direct.BaseAbstractVectorialOptimizer<DifferentiableMultivariateVectorialFunction>
org.apache.commons.math.optimization.general.AbstractLeastSquaresOptimizer
public abstract class AbstractLeastSquaresOptimizer
Base class for implementing least squares optimizers.
It handles the boilerplate methods associated to thresholds settings,
jacobian and error estimation.
This class uses the DifferentiableMultivariateVectorialFunction.jacobian()
of the function argument in method
optimize and assumes that, in the matrix returned by the
value method, the rows
iterate on the model functions while the columns iterate on the parameters; thus,
the numbers of rows is equal to the length of the target array while the
number of columns is equal to the length of the startPoint array.
| Field Summary | |
|---|---|
protected int |
cols
Number of columns of the jacobian matrix. |
protected double |
cost
Cost value (square root of the sum of the residuals). |
protected double[] |
objective
Current objective function value. |
protected double[] |
point
Current point. |
protected double[] |
residuals
Current residuals. |
protected int |
rows
Number of rows of the jacobian matrix. |
protected double[][] |
weightedResidualJacobian
Jacobian matrix of the weighted residuals. |
protected double[] |
weightedResiduals
Weighted residuals |
| Fields inherited from class org.apache.commons.math.optimization.direct.BaseAbstractVectorialOptimizer |
|---|
evaluations |
| Constructor Summary | |
|---|---|
protected |
AbstractLeastSquaresOptimizer()
Simple constructor with default settings. |
protected |
AbstractLeastSquaresOptimizer(ConvergenceChecker<VectorialPointValuePair> checker)
|
| Method Summary | |
|---|---|
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. |
double[][] |
getCovariances()
Get the covariance matrix of the optimized parameters. |
double[][] |
getCovariances(double threshold)
Get the covariance matrix of the optimized parameters. |
int |
getJacobianEvaluations()
|
double |
getRMS()
Get the Root Mean Square value. |
double[] |
guessParametersErrors()
Guess the errors in optimized parameters. |
VectorialPointValuePair |
optimize(int maxEval,
DifferentiableMultivariateVectorialFunction f,
double[] target,
double[] weights,
double[] startPoint)
Optimize an objective function. |
protected void |
updateJacobian()
Update the jacobian matrix. |
protected void |
updateResidualsAndCost()
Update the residuals array and cost function value. |
| Methods inherited from class org.apache.commons.math.optimization.direct.BaseAbstractVectorialOptimizer |
|---|
computeObjectiveValue, doOptimize, getConvergenceChecker, getEvaluations, getMaxEvaluations, getStartPoint, getTargetRef, getWeightRef, setConvergenceChecker |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.commons.math.optimization.BaseOptimizer |
|---|
getConvergenceChecker, getEvaluations, getMaxEvaluations, setConvergenceChecker |
| Field Detail |
|---|
protected double[][] weightedResidualJacobian
updateJacobian(), but may be modified by the solver
in the derived class (the Levenberg-Marquardt optimizer does this).
protected int cols
protected int rows
protected double[] point
protected double[] objective
protected double[] residuals
protected double[] weightedResiduals
protected double cost
| Constructor Detail |
|---|
protected AbstractLeastSquaresOptimizer()
SimpleVectorialValueChecker.
protected AbstractLeastSquaresOptimizer(ConvergenceChecker<VectorialPointValuePair> checker)
checker - Convergence checker.| Method Detail |
|---|
public int getJacobianEvaluations()
protected void updateJacobian()
DimensionMismatchException - if the Jacobian dimension does not
match problem dimension.protected void updateResidualsAndCost()
DimensionMismatchException - if the dimension does not match the
problem dimension.
TooManyEvaluationsException - if the maximal number of evaluations is exceeded.public double getRMS()
public double getChiSquare()
public double[][] getCovariances()
SingularMatrixException - if the covariance matrix cannot be computed (singular problem).public double[][] getCovariances(double threshold)
threshold - Singularity threshold.
SingularMatrixException - if the covariance matrix cannot be computed (singular problem).public double[] guessParametersErrors()
SingularMatrixException - if the covariances matrix cannot be computed.
NumberIsTooSmallException - if the number of degrees of freedom is not
positive, i.e. the number of measurements is less or equal to the number of
parameters.
public VectorialPointValuePair optimize(int maxEval,
DifferentiableMultivariateVectorialFunction f,
double[] target,
double[] weights,
double[] startPoint)
∑weighti(objectivei - targeti)2
optimize in interface BaseMultivariateVectorialOptimizer<DifferentiableMultivariateVectorialFunction>optimize in class BaseAbstractVectorialOptimizer<DifferentiableMultivariateVectorialFunction>maxEval - Maximum number of function evaluations.f - Objective function.target - Target value for the objective functions at optimum.weights - Weights for the least squares cost computation.startPoint - Start point for optimization.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||