org.apache.commons.math3.optim.nonlinear.vector.jacobian
Class AbstractLeastSquaresOptimizer
- java.lang.Object
-
- org.apache.commons.math3.optim.BaseOptimizer<PAIR>
-
- org.apache.commons.math3.optim.BaseMultivariateOptimizer<PointVectorValuePair>
-
- org.apache.commons.math3.optim.nonlinear.vector.MultivariateVectorOptimizer
-
- org.apache.commons.math3.optim.nonlinear.vector.JacobianMultivariateVectorOptimizer
-
- org.apache.commons.math3.optim.nonlinear.vector.jacobian.AbstractLeastSquaresOptimizer
-
- Direct Known Subclasses:
- GaussNewtonOptimizer, LevenbergMarquardtOptimizer
Deprecated.All classes and interfaces in this package are deprecated. The optimizers that were provided here were moved to theorg.apache.commons.math3.fitting.leastsquarespackage (cf. MATH-1008).
@Deprecated public abstract class AbstractLeastSquaresOptimizer extends JacobianMultivariateVectorOptimizer
Base class for implementing least-squares optimizers. It provides methods for error estimation.- Since:
- 3.1
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description double[][]computeCovariances(double[] params, double threshold)Deprecated.Get the covariance matrix of the optimized parameters.double[]computeSigma(double[] params, double covarianceSingularityThreshold)Deprecated.Computes an estimate of the standard deviation of the parameters.doublegetChiSquare()Deprecated.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.doublegetRMS()Deprecated.Gets the root-mean-square (RMS) value.RealMatrixgetWeightSquareRoot()Deprecated.Gets the square-root of the weight matrix.PointVectorValuePairoptimize(OptimizationData... optData)Deprecated.Stores data and performs the optimization.-
Methods inherited from class org.apache.commons.math3.optim.nonlinear.vector.MultivariateVectorOptimizer
getTarget, getTargetSize, getWeight
-
Methods inherited from class org.apache.commons.math3.optim.BaseMultivariateOptimizer
getLowerBound, getStartPoint, getUpperBound
-
Methods inherited from class org.apache.commons.math3.optim.BaseOptimizer
getConvergenceChecker, getEvaluations, getIterations, getMaxEvaluations, getMaxIterations, optimize
-
-
-
-
Method Detail
-
getRMS
public double getRMS()
Deprecated.Gets the root-mean-square (RMS) value. The RMS the root of the arithmetic mean of the square of all weighted residuals. This is related to the criterion that is minimized by the optimizer as follows: If c if the criterion, and n is the number of measurements, then the RMS is sqrt (c/n).- Returns:
- the RMS value.
-
getChiSquare
public double getChiSquare()
Deprecated.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.- Returns:
- chi-square value
-
getWeightSquareRoot
public RealMatrix getWeightSquareRoot()
Deprecated.Gets the square-root of the weight matrix.- Returns:
- the square-root of the weight matrix.
-
computeCovariances
public double[][] computeCovariances(double[] params, double threshold)Deprecated.Get the covariance matrix of the optimized parameters.
Note that this operation involves the inversion of theJTJmatrix, whereJis the Jacobian matrix. Thethresholdparameter is a way for the caller to specify that the result of this computation should be considered meaningless, and thus trigger an exception.- Parameters:
params- Model parameters.threshold- Singularity threshold.- Returns:
- the covariance matrix.
- Throws:
SingularMatrixException- if the covariance matrix cannot be computed (singular problem).
-
computeSigma
public double[] computeSigma(double[] params, double covarianceSingularityThreshold)Deprecated.Computes an estimate of the standard deviation of the parameters. The returned values are the square root of the diagonal coefficients of the covariance matrix,sd(a[i]) ~= sqrt(C[i][i]), wherea[i]is the optimized value of thei-th parameter, andCis the covariance matrix.- Parameters:
params- Model parameters.covarianceSingularityThreshold- Singularity threshold (seecomputeCovariances).- Returns:
- an estimate of the standard deviation of the optimized parameters
- Throws:
SingularMatrixException- if the covariance matrix cannot be computed.
-
optimize
public PointVectorValuePair optimize(OptimizationData... optData) throws TooManyEvaluationsException
Deprecated.Stores data and performs the optimization.The list of parameters is open-ended so that sub-classes can extend it with arguments specific to their concrete implementations.
When the method is called multiple times, instance data is overwritten only when actually present in the list of arguments: when not specified, data set in a previous call is retained (and thus is optional in subsequent calls).
Important note: Subclasses must override
BaseOptimizer.parseOptimizationData(OptimizationData[])if they need to register their own options; but then, they must also callsuper.parseOptimizationData(optData)within that method.- Overrides:
optimizein classJacobianMultivariateVectorOptimizer- Parameters:
optData- Optimization data. In addition to those documented inJacobianMultivariateVectorOptimizer, this method will register the following data:- Returns:
- a point/value pair that satisfies the convergence criteria.
- Throws:
TooManyEvaluationsException- if the maximal number of evaluations is exceeded.DimensionMismatchException- if the initial guess, target, and weight arguments have inconsistent dimensions.
-
-
DMelt 3.0 © DataMelt by jWork.ORG