Mahalanobis Distance

Let x be a vector, and assume we have a distribution with mean μ and covariance matrix S. The Mahalanobis distance with respect to the distribution is defined as

D(x)=(xμ)TS1(xμ).

Why? Well, S is positive-definite, so we can decompose xμ into aiei, where ei are the orthonormal eigenvectors of S (with corresponding eigenvalues λi). Then S1aiei=aieiλi and so

D(x)=ai2λi.

So the Mahalanobis distance takes into account how far out from the mean we are, where the meaning of “far out” depends on the direction you’ve traveled from the mean.

This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.