Class DenseWeightedEvaluation
- java.lang.Object
-
- org.apache.commons.math3.fitting.leastsquares.AbstractEvaluation
-
- org.apache.commons.math3.fitting.leastsquares.DenseWeightedEvaluation
-
- All Implemented Interfaces:
LeastSquaresProblem.Evaluation
class DenseWeightedEvaluation extends AbstractEvaluation
Applies a dense weight matrix to an evaluation.- Since:
- 3.3
-
-
Field Summary
Fields Modifier and Type Field Description private LeastSquaresProblem.Evaluationunweightedthe unweighted evaluationprivate RealMatrixweightSqrtreference to the weight square root matrix
-
Constructor Summary
Constructors Constructor Description DenseWeightedEvaluation(LeastSquaresProblem.Evaluation unweighted, RealMatrix weightSqrt)Create a weighted evaluation from an unweighted one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RealMatrixgetJacobian()Get the weighted Jacobian matrix.RealVectorgetPoint()Get the abscissa (independent variables) of this evaluation.RealVectorgetResiduals()Get the weighted residuals.-
Methods inherited from class org.apache.commons.math3.fitting.leastsquares.AbstractEvaluation
getCost, getCovariances, getRMS, getSigma
-
-
-
-
Field Detail
-
unweighted
private final LeastSquaresProblem.Evaluation unweighted
the unweighted evaluation
-
weightSqrt
private final RealMatrix weightSqrt
reference to the weight square root matrix
-
-
Constructor Detail
-
DenseWeightedEvaluation
DenseWeightedEvaluation(LeastSquaresProblem.Evaluation unweighted, RealMatrix weightSqrt)
Create a weighted evaluation from an unweighted one.- Parameters:
unweighted- the evalutation before weights are appliedweightSqrt- the matrix square root of the weight matrix
-
-
Method Detail
-
getJacobian
public RealMatrix getJacobian()
Get the weighted Jacobian matrix.- Returns:
- the weighted Jacobian: W1/2 J.
-
getResiduals
public 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.
-
getPoint
public RealVector getPoint()
Get the abscissa (independent variables) of this evaluation.- Returns:
- the point provided to
LeastSquaresProblem.evaluate(RealVector).
-
-