The Mahalanobis distance is a measure of the distance between a point P and a distribution D, introduced by P. C. Mahalanobis in 1936. Mahalanobis's definition was prompted by the problem of identifying the similarities of skulls based on measurements in 1927. It is a multi-dimensional generalization of the idea of measuring how many standard deviations away P is from the mean of D. This distance is zero for P at the mean of D and grows as P moves away from the mean along each principal component axis. If each of these axes is re-scaled to have unit variance, then the Mahalanobis distance corresponds to standard Euclidean distance in the transformed space. The Mahalanobis distance is thus unitless, scale-invariant, and takes into account the correlations of the data set. Definition Given a probability distribution on , with mean and positive-definite covariance matrix , the Mahalanobis distance of a point from isGiven two points and in , the Mahalanobis distance between them with respect to iswhich means that . Since is positive-definite, so is , thus the square roots are always defined. We can find useful decompositions of the squared Mahalanobis distance that help to explain some reasons for the outlyingness of multivariate observations and also provide a graphical tool for identifying outliers. By the spectral theorem, can be decomposed as for some real matrix, which gives us the equivalent definitionwhere is the Euclidean norm. That is, the Mahalanobis distance is the Euclidean distance after a whitening transformation. The existence of is guaranteed by the spectral theorem, but it is not unique. Different choices have different theoretical and practical advantages. In practice, the distribution is usually the sample distribution from a set of IID samples from an underlying unknown distribution, so is the sample mean, and is the covariance matrix of the samples. When the affine span of the samples is not the entire , the covariance matrix would not be positive-definite, which means the above definition would not work. However, in general, the Mahalanobis distance is preserved under any full-rank affine transformation of the affine span of the samples. So in case the affine span is not the entire , the samples can be first orthogonally projected to , where is the dimension of the affine span of the samples, then the Mahalanobis distance can be computed as usual. Intuitive explanation Consider the problem of estimating the probability that