A common problem is determining whether an element belongs to a probability distribution, and estimating whether it is an inlier, that is, part of the distribution, or an outlier, that is, outside it.
The Mahalanobis distance (Mah36) measures an observation normalized by its variance and is therefore also known as the “generalized distance.”
| (2.22) |
This distance can be extended (generalized squared interpoint distance) to the case of two vectors and
, realizations of the same random variable with covariance distribution
:
| (2.23) |
In the special case of a diagonal covariance matrix, this gives the normalized Euclidean distance. When the covariance matrix is exactly the identity matrix—that is, when the components have unit variance and are uncorrelated—the above expression reduces to the standard Euclidean distance.
The Mahalanobis distance allows distances to be measured between samples whose units of measurement are unknown, effectively assigning the data an automatic scale factor.