Class Accuracy

java.lang.Object
com.irurueta.geometry.Accuracy
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Accuracy2D, Accuracy3D

public abstract class Accuracy extends Object implements Serializable
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

    Fields
    Modifier and Type
    Field
    Description
    private double
    Average square root of singular value of decomposed covariance matrix.
    protected double
    Confidence of provided accuracy of a point for a value located up to the standard deviation factor distance from the mean.
    private com.irurueta.algebra.Matrix
    Covariance matrix representing the accuracy of an estimated position.
    private static final double
    Default standard deviation factor to account for a given accuracy confidence.
    private double
    Maximum square root of singular value of decomposed covariance matrix.
    private double
    Minimum square root of singular value of decomposed covariance matrix.
    protected double[]
    Square root of singular values of decomposed covariance matrix.
    protected double
    Standard deviation factor to account for a given accuracy confidence.
    protected com.irurueta.algebra.Matrix
    Orthonormal matrix representing a rotation after decomposing covariance matrix.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
    protected
    Accuracy(double confidence)
    Constructor.
    protected
    Accuracy(com.irurueta.algebra.Matrix covarianceMatrix)
    Constructor.
    protected
    Accuracy(com.irurueta.algebra.Matrix covarianceMatrix, double confidence)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets average accuracy among all directions.
    double
    Gets confidence of provided accuracy of estimated point or measure.
    com.irurueta.algebra.Matrix
    Gets covariance matrix representing the accuracy of an estimated point or measure.
    double
    Gets largest (worse) accuracy in any direction (i.e. either 2D or 3D).
    abstract int
    Gets number of dimensions.
    double
    Gets smallest (best) accuracy in any direction (i.e. either 2D or 3D).
    double
    Gets standard deviation factor to account for a given accuracy confidence.
    void
    setConfidence(double confidence)
    Sets confidence of provided accuracy of estimated point or measure.
    void
    setCovarianceMatrix(com.irurueta.algebra.Matrix covarianceMatrix)
    Sets covariance matrix representing the accuracy of an estimated point or measure.
    void
    setStandardDeviationFactor(double standardDeviationFactor)
    Sets standard deviation factor to account for a given accuracy confidence.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_STANDARD_DEVIATION_FACTOR

      private static final double DEFAULT_STANDARD_DEVIATION_FACTOR
      Default 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 covarianceMatrix
      Covariance matrix representing the accuracy of an estimated position.
    • standardDeviationFactor

      protected double standardDeviationFactor
      Standard 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 confidence
      Confidence 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[] sqrtSingularValues
      Square root of singular values of decomposed covariance matrix.
    • u

      protected com.irurueta.algebra.Matrix u
      Orthonormal matrix representing a rotation after decomposing covariance matrix.
    • minSqrtSingularValue

      private double minSqrtSingularValue
      Minimum 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 maxSqrtSingularValue
      Maximum 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 avgSqrtSingularValue
      Average 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.