
The Mahalanobis distance is defined as the distance between a (multidimensional) point and a distribution. It is the multivariate form of the distance measured in units of standard deviation and is named after the famous Indian statistician R.P. Mahalanobis (1893 – 1972).
Given a normal distribution with covariance matrix S and mean μ, the squared Mahalanobis distance of a point x to the mean of this distribution is given by d^{2}(x)=(xμ)′S^{1}(xμ), where (xμ)′ is the transpose of (xμ).
The distance formula above says that we have to weigh dimensions according to their covariances. If the covariance matrix S happens to be diagonal the formula above reduces to d^{2}(x)=Σ_{i=1}^{N} (x_{i}μ_{i})^{2}/σ_{i}.
© djmw, January 20, 2016