Interface LeastSquaresProblem.Evaluation
-
- All Known Subinterfaces:
LeastSquaresOptimizer.Optimum
- All Known Implementing Classes:
AbstractEvaluation
- Enclosing interface:
- LeastSquaresProblem
public static interface LeastSquaresProblem.Evaluation
An evaluation of aLeastSquaresProblem
at a particular point. This class also computes several quantities derived from the value and its Jacobian.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
getChiSquare()
Get the sum of the squares of the residuals.double
getCost()
Get the cost.RealMatrix
getCovariances(double threshold)
Get the covariance matrix of the optimized parameters.RealMatrix
getJacobian()
Get the weighted Jacobian matrix.RealVector
getPoint()
Get the abscissa (independent variables) of this evaluation.double
getReducedChiSquare(int n)
Get the reduced chi-square.RealVector
getResiduals()
Get the weighted residuals.double
getRMS()
Get the normalized cost.RealVector
getSigma(double covarianceSingularityThreshold)
Get an estimate of the standard deviation of the parameters.
-
-
-
Method Detail
-
getCovariances
RealMatrix getCovariances(double threshold)
Get the covariance matrix of the optimized parameters.
Note that this operation involves the inversion of theJTJ
matrix, whereJ
is the Jacobian matrix. Thethreshold
parameter is a way for the caller to specify that the result of this computation should be considered meaningless, and thus trigger an exception.- Parameters:
threshold
- Singularity threshold.- Returns:
- the covariance matrix.
- Throws:
MathIllegalArgumentException
- if the covariance matrix cannot be computed (singular problem).
-
getSigma
RealVector getSigma(double covarianceSingularityThreshold)
Get 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, andC
is the covariance matrix.- Parameters:
covarianceSingularityThreshold
- Singularity threshold (seecomputeCovariances
).- Returns:
- an estimate of the standard deviation of the optimized parameters
- Throws:
MathIllegalArgumentException
- if the covariance matrix cannot be computed.
-
getRMS
double getRMS()
Get the normalized cost. It is the square-root of the sum of squared of the residuals, divided by the number of measurements.- Returns:
- the cost.
-
getJacobian
RealMatrix getJacobian()
Get the weighted Jacobian matrix.- Returns:
- the weighted Jacobian: W1/2 J.
- Throws:
MathIllegalArgumentException
- if the Jacobian dimension does not match problem dimension.
-
getCost
double getCost()
Get the cost. It is the square-root of theobjective function
.- Returns:
- the cost.
- See Also:
getResiduals()
,getChiSquare()
-
getChiSquare
double getChiSquare()
Get the sum of the squares of the residuals.- Returns:
- the cost.
- See Also:
getResiduals()
,getCost()
-
getReducedChiSquare
double getReducedChiSquare(int n)
Get the reduced chi-square.- Parameters:
n
- Number of fitted parameters.- Returns:
- the sum of the squares of the residuals divided by the number of degrees of freedom.
-
getResiduals
RealVector getResiduals()
Get the weighted residuals. The residual is the difference between the observed (target) values and the model (objective function) value. There is one residual for each element of the vector-valued function. The raw residuals are then multiplied by the square root of the weight matrix.- Returns:
- the weighted residuals: W1/2 K.
- Throws:
MathIllegalArgumentException
- if the residuals have the wrong length.
-
getPoint
RealVector getPoint()
Get the abscissa (independent variables) of this evaluation.- Returns:
- the point provided to
LeastSquaresProblem.evaluate(RealVector)
.
-
-