# The derivation of the Mahalanobis distance formula [closed]

Bottom to top explanation of the Mahalanobis distance?

I think I got the idea, but what I still felt missing was the derivation of the formula for the Mahalanobis distance. So my question is: "How does one derive the formula for Mahalanobis distance?"

Why does the formula have the form:

$$D(\textbf{x},\textbf{y})=\sqrt{ (\textbf{x}-\textbf{y})^TC^{-1}(\textbf{x}-\textbf{y})}$$

Could perhaps someone give analogous derivation as user @sjm.majewski gave on Principal component analysis on the link below:

Making sense of principal component analysis, eigenvectors & eigenvalues

UPDATE:

From Wikipedia intuitive explanation was:

"The Mahalanobis distance is simply the distance of the test point from the center of mass divided by the width of the ellipsoid in the direction of the test point."

So is $C^{-1}$ the width of the ellipsoid in the direction of the test point? I mean this distance I can understand: $$\displaystyle\frac{\textbf{x}-\textbf{u}}{\sigma}$$

But this distance confuses me...:/

$$\sqrt{ (\textbf{x}-\textbf{y})^TC^{-1}(\textbf{x}-\textbf{y})}$$

## closed as off topic by whuber♦Jun 24 '13 at 17:01

Questions on Cross Validated are expected to relate to statistics within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

• en.wikipedia.org/wiki/… provides an answer as to why the Mahalanobis distance takes the form it does. You might get more satisfying answers here if you add detail about what you find unsatisfying about the sort of explanation given there. – Ed Dean Jun 24 '13 at 5:28
• Please do not cross-post your questions. This one is more suitable for the Math site, because it is purely a question of linear algebra. – whuber Jun 24 '13 at 17:01