Package com.irurueta.geometry
Class Accuracy
java.lang.Object
com.irurueta.geometry.Accuracy
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Accuracy2D,Accuracy3D
Base class representing the confidence of provided accuracy from a covariance matrix
expressed in the distance unit of such matrix.
This class contains utility methods to convert covariance matrices into geometric figures
with the requested confidence.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleAverage square root of singular value of decomposed covariance matrix.protected doubleConfidence of provided accuracy of a point for a value located up to the standard deviation factor distance from the mean.private com.irurueta.algebra.MatrixCovariance matrix representing the accuracy of an estimated position.private static final doubleDefault standard deviation factor to account for a given accuracy confidence.private doubleMaximum square root of singular value of decomposed covariance matrix.private doubleMinimum square root of singular value of decomposed covariance matrix.protected double[]Square root of singular values of decomposed covariance matrix.protected doubleStandard deviation factor to account for a given accuracy confidence.protected com.irurueta.algebra.MatrixOrthonormal matrix representing a rotation after decomposing covariance matrix. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets average accuracy among all directions.doubleGets confidence of provided accuracy of estimated point or measure.com.irurueta.algebra.MatrixGets covariance matrix representing the accuracy of an estimated point or measure.doubleGets largest (worse) accuracy in any direction (i.e. either 2D or 3D).abstract intGets number of dimensions.doubleGets smallest (best) accuracy in any direction (i.e. either 2D or 3D).doubleGets standard deviation factor to account for a given accuracy confidence.voidsetConfidence(double confidence) Sets confidence of provided accuracy of estimated point or measure.voidsetCovarianceMatrix(com.irurueta.algebra.Matrix covarianceMatrix) Sets covariance matrix representing the accuracy of an estimated point or measure.voidsetStandardDeviationFactor(double standardDeviationFactor) Sets standard deviation factor to account for a given accuracy confidence.
-
Field Details
-
DEFAULT_STANDARD_DEVIATION_FACTOR
private static final double DEFAULT_STANDARD_DEVIATION_FACTORDefault standard deviation factor to account for a given accuracy confidence. Typically, a factor of 2.0 will be used, which means that accuracy of position will be drawn as an ellipse of size equal to one time the standard deviation. Assuming a Gaussian distribution this is equivalent to providing a 95.44% of confidence on provided accuracy.- See Also:
-
covarianceMatrix
private com.irurueta.algebra.Matrix covarianceMatrixCovariance matrix representing the accuracy of an estimated position. -
standardDeviationFactor
protected double standardDeviationFactorStandard deviation factor to account for a given accuracy confidence. Typically, a factor of 2.0 will be used, which means that accuracy of a point or measure will be drawn as a geometric figure (either an ellipse in 2D or an ellipsoid in 3D) equal to two times the standard deviation. Assuming a Gaussian distribution this is equivalent to providing a 95.44% of confidence on provided accuracy. -
confidence
protected double confidenceConfidence of provided accuracy of a point for a value located up to the standard deviation factor distance from the mean. This is expressed as a value between 0 and 1, where 1 indicates a 100% confidence that the real position is within provided accuracy. -
sqrtSingularValues
protected double[] sqrtSingularValuesSquare root of singular values of decomposed covariance matrix. -
u
protected com.irurueta.algebra.Matrix uOrthonormal matrix representing a rotation after decomposing covariance matrix. -
minSqrtSingularValue
private double minSqrtSingularValueMinimum square root of singular value of decomposed covariance matrix. Can be used to determine the smallest accuracy on a geometric figure (i.e. the shortest semi-axis on an ellipse or an ellipsoid). -
maxSqrtSingularValue
private double maxSqrtSingularValueMaximum square root of singular value of decomposed covariance matrix. Can be used to determine the largest accuracy on a geometric figure (i.e. the largest semi-axis on an ellipse or an ellipsoid). -
avgSqrtSingularValue
private double avgSqrtSingularValueAverage square root of singular value of decomposed covariance matrix. Can be used to determine the average accuracy on a geometric figure (i.e. the average semi-axis on an ellipse or an ellipsoid).
-
-
Constructor Details
-
Accuracy
protected Accuracy()Constructor. -
Accuracy
protected Accuracy(com.irurueta.algebra.Matrix covarianceMatrix) throws com.irurueta.algebra.NonSymmetricPositiveDefiniteMatrixException Constructor.- Parameters:
covarianceMatrix- covariance matrix to be set. Must be NxN where N is the number of dimensions and positive definite.- Throws:
IllegalArgumentException- if provided matrix is not square (it must also be positive definite to be properly converted to a geometric figure - e.g. an ellipse or an ellipsoid).com.irurueta.algebra.NonSymmetricPositiveDefiniteMatrixException- if provided matrix is not symmetric and positive definite.
-
Accuracy
protected Accuracy(double confidence) Constructor.- Parameters:
confidence- confidence of provided accuracy of an estimated position.- Throws:
IllegalArgumentException- if provided value is not within 0 and 1.
-
Accuracy
protected Accuracy(com.irurueta.algebra.Matrix covarianceMatrix, double confidence) throws com.irurueta.algebra.NonSymmetricPositiveDefiniteMatrixException Constructor.- Parameters:
covarianceMatrix- covariance matrix to be set. Must be NxN where N is the number of dimensions and positive definite.confidence- confidence of provided accuracy of an estimated position.- Throws:
IllegalArgumentException- if provided matrix is not square (it must also be positive definite to be properly converted to a geometric figure - e.g. an ellipse or an ellipsoid), or if provided confidence value is not within 0 and 1.com.irurueta.algebra.NonSymmetricPositiveDefiniteMatrixException- if provided matrix is not symmetric and positive definite.
-
-
Method Details
-
getCovarianceMatrix
public com.irurueta.algebra.Matrix getCovarianceMatrix()Gets covariance matrix representing the accuracy of an estimated point or measure.- Returns:
- covariance matrix representing the accuracy of an estimated point or measure.
-
setCovarianceMatrix
public void setCovarianceMatrix(com.irurueta.algebra.Matrix covarianceMatrix) throws com.irurueta.algebra.NonSymmetricPositiveDefiniteMatrixException Sets covariance matrix representing the accuracy of an estimated point or measure.- Parameters:
covarianceMatrix- covariance matrix representing the accuracy of an estimated point or measure.- Throws:
IllegalArgumentException- if provided matrix is not square (it must also be positive definite to be properly converted to a geometric figure - e.g. an ellipse or an ellipsoid).com.irurueta.algebra.NonSymmetricPositiveDefiniteMatrixException- if provided matrix is not symmetric and positive definite.
-
getStandardDeviationFactor
public double getStandardDeviationFactor()Gets standard deviation factor to account for a given accuracy confidence. Typically, a factor of 2.0 will be used, which means that accuracy can be drawn as a geometric figure of size equal to 2 times the standard deviation. Assuming a Gaussian distribution this is equivalent to providing a 95.44% confidence on provided accuracy.- Returns:
- standard deviation factor.
-
setStandardDeviationFactor
public void setStandardDeviationFactor(double standardDeviationFactor) Sets standard deviation factor to account for a given accuracy confidence. Typically, a factor of 2.0 will be used, which means that accuracy can be drawn as a geometric figure of size equal to 2 times the standard deviation. Assuming a Gaussian distribution this is equivalent to providing a 95.44% confidence on provided accuracy.- Parameters:
standardDeviationFactor- standard deviation factor to be set.- Throws:
IllegalArgumentException- if provided value is zero or negative.
-
getConfidence
public double getConfidence()Gets confidence of provided accuracy of estimated point or measure. This is expressed as a value between 0 and 1, where 1 indicates a 100% confidence that the real point or measure is within provided accuracy.- Returns:
- confidence of provided accuracy of estimated point or measure.
-
setConfidence
public void setConfidence(double confidence) Sets confidence of provided accuracy of estimated point or measure. This is expressed as a value between 0 and 1, where 1 indicates a 100% confidence that the real point or measure is within provided accuracy.- Parameters:
confidence- confidence of provided accuracy of estimated point or measure.- Throws:
IllegalArgumentException- if provided value is not within 0 and 1.
-
getSmallestAccuracy
public double getSmallestAccuracy()Gets smallest (best) accuracy in any direction (i.e. either 2D or 3D). This value is represented by the smallest semi axis representing the ellipse or ellipsoid of accuracy.- Returns:
- smallest accuracy in any direction.
-
getLargestAccuracy
public double getLargestAccuracy()Gets largest (worse) accuracy in any direction (i.e. either 2D or 3D). This value is represented by the largest semi axis representing the ellipse or ellipsoid of accuracy.- Returns:
- largest accuracy in any direction.
-
getAverageAccuracy
public double getAverageAccuracy()Gets average accuracy among all directions. This value is equal to the average value of all semi axes representing the ellipse or ellipsoid of accuracy.- Returns:
- average accuracy among all directions.
-
getNumberOfDimensions
public abstract int getNumberOfDimensions()Gets number of dimensions. This is equal to 2 for 2D, and to 3 for 3D.- Returns:
- number of dimensions.
-