Class/Object

au.id.cxd.math.function.distance

MahalanobisDistance

Related Docs: object MahalanobisDistance | package distance

Permalink

class MahalanobisDistance extends AnyRef

Mahalanobis Distance An elliptical distance measure for the difference between two samples having the spread of their covariance matrix.

Given samples X and Y the Mahalanobis distance is given as

$$ dist(X,Y) = \left\{ (X-Y)' \Sigma_{X,Y}^{-1} (X-Y) \right\}^{1/2} $$ Where $\Sigma_{X,Y}^{-1}$ is the inverse of the variance-covariance matrix.

This bears a relationship to the shape and location of a multivariate normal distribution where the $Y$ sample in this case takes the place of the $\mu$ parameter for the mean of $X$ and the variance-covariance matrix is formed by the covariates of $X$.

This class supports distance calculations for

- The instance of two vectors $X$ and $Y$ the result is a single value

- The instance of two Matrices $X$ and $Y$ the result is a vector where each item is the distance of each row of X to each row of Y

- And in the case of a single matrix where the parameters $\mu$ and $\Sigma$ are estimated, where each item is the distance from X to the distribution parameters given or the parameters estimated from X, note in the case of the single matrix the resulting vector can then be sorted and plotted against the quartiles of the chi-squared distribution in order to define a qqplot, rendering a visualisation of the deviation from the expected quartile under the Multivariate normal assumption. This type of visualisation is useful in diagnosing whether a data set deviates from MVN.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MahalanobisDistance
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MahalanobisDistance()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def dist(X: DenseVector[Double], Y: DenseVector[Double]): Double

    Permalink

    mahalanobis distance between two vectors.

  7. def dist(X: DenseMatrix[Double]): DenseMatrix[Double]

    Permalink

    determine the distance from the mean using the variance covariance matrix of the supplied sample

  8. def dist(X: DenseMatrix[Double], Y: DenseMatrix[Double]): DenseMatrix[Double]

    Permalink

    distance between two matrices

  9. def dist(X: DenseMatrix[Double], Mu: DenseMatrix[Double], Sigma: DenseMatrix[Double]): DenseMatrix[Double]

    Permalink

    a distance operation where the parameters Mu and Sigma have already been estimated.

  10. var distMatrix: DenseMatrix[Double]

    Permalink

    after the distance calculation keep the full distance matrix.

  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. def mahalanobis(delta: DenseMatrix[Double], sigma: DenseMatrix[Double]): DenseMatrix[Double]

    Permalink
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped