Can excel calculate Mahalanobis distance?

K

kt_b1

Is there an option in excel add-inns for Mahalanobis distance? or can it be
programmed to calculate this? If so, how?
 
B

bj

I Know of no add-in, but
(if I understand Mahalanobis distance properly)

=sumproduct((range1*range2)^L)^(1/L)
may work
where range1 and 2 are your comparison data and L is the Mahalanobis level
you wish
 
P

Pete_UK

Do a Google search for Mahalanobis and you will get plenty of hits.

Hope this helps.

Pete
 
J

Jerry W. Lewis

Not directly, but Excel supports matrix and array calculations that permit
you to calculate it from first principles.

http://en.wikipedia.org/wiki/Mahalanobis_distance

For example, if the variance-covariance matrix is in A1:C3, then the
Mahalanobis distance between the vectors in E1:E3 and F1:F3 is given by
=SQRT(MMULT(MMULT(TRANSPOSE(F1:F3-E1:E3),MINVERSE(A1:C3)),F1:F3-E1:E3))
which must be array entered (Ctrl-Shift-Enter). If you fail to array enter
it, it will simply return #VALUE!

Jerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top