Top Description Fields Constructors Methods
org.apache.commons.math3.fitting.leastsquares

public abstract Class AbstractEvaluation

extends Object
implements Evaluation
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation
Known Direct Subclasses
org.apache.commons.math3.fitting.leastsquares.DenseWeightedEvaluation, org.apache.commons.math3.fitting.leastsquares.LeastSquaresFactory.LocalLeastSquaresProblem.UnweightedEvaluation, org.apache.commons.math3.fitting.leastsquares.LeastSquaresFactory.LocalLeastSquaresProblem.LazyUnweightedEvaluation
Imports
org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation, org.apache.commons.math3.linear.ArrayRealVector, .DecompositionSolver, .QRDecomposition, .RealMatrix, .RealVector, org.apache.commons.math3.util.FastMath

An implementation of Evaluation that is designed for extension. All of the methods implemented here use the methods that are left unimplemented.

TODO cache results?

Since
3.3

Field Summary

Modifier and TypeField and Description
private final int
observationSize

number of observations

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractEvaluation(final int
the number of observation. Needed for getRMS().
observationSize
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public double
public RealMatrix
getCovariances(double
Singularity threshold.
threshold
)

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getCovariances.

Get the covariance matrix of the optimized parameters.

public double
public RealVector
getSigma(double
Singularity threshold (see computeCovariances).
covarianceSingularityThreshold
)

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getSigma.

Get an estimate of the standard deviation of the parameters.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

observationSizeback to summary
private final int observationSize

number of observations

Constructor Detail

AbstractEvaluationback to summary
pack-priv AbstractEvaluation(final int observationSize)

Constructor.

Parameters
observationSize:int

the number of observation. Needed for getRMS().

Method Detail

getCostback to summary
public double getCost()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getCost.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getCost.

Get the cost.

Returns:double

the cost.

getCovariancesback to summary
public RealMatrix getCovariances(double threshold)

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getCovariances.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getCovariances.

Get the covariance matrix of the optimized parameters.
Note that this operation involves the inversion of the JTJ matrix, where J is the Jacobian matrix. The threshold 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:double

Singularity threshold.

Returns:RealMatrix

the covariance matrix.

getRMSback to summary
public double getRMS()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getRMS.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.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:double

the cost.

getSigmaback to summary
public RealVector getSigma(double covarianceSingularityThreshold)

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getSigma.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getSigma.

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]), where a[i] is the optimized value of the i-th parameter, and C is the covariance matrix.

Parameters
covarianceSingularityThreshold:double

Singularity threshold (see computeCovariances).

Returns:RealVector

an estimate of the standard deviation of the optimized parameters