Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: LU decomposition and Mahalanobis distance
Replies: 2   Last Post: Jul 3, 2006 2:44 PM

 Messages: [ Previous | Next ]
 Ross Clement Posts: 569 Registered: 12/8/04
LU decomposition and Mahalanobis distance
Posted: Jul 3, 2006 11:02 AM

Dear all,

I am currently using a library (gnu gsl) which takes great pains in
both API design and documentation to guide people away from using
matrix inverses explicitly and towards using the LU decomposition. I
have code which is going to calculate Mahalanobis distance, requiring
the inverse of covariance matrix. Is there any reason to use a LU
decomposition in calculating Mahalanobis distance? At present I'm a
little bit skeptical, as I will invert a (say 100x100) covariance
matrix once, then calculate *many* M distances. While I don't know
exactly how to formulate Mahalanobis distance using the LU
decomposition, or even know if it's possible (googling on both yields
nothing that obviously answers my question), I would presume that any
rewrite would require additional computation and therefore time. Would
there be a significant improvement in numerical accuracy? At present my
default inclination is to find the actual inverse and then calculate
distance by the standard formula.

Also, I have to solve some systems of linear equations. But the gsl
libray includes library routines to do this given a LU decomposition,
so unless corrected I'm assuming it's a no-brainer to solve them using
a LU decomposition.

Thanks in anticipation,

Ross-c

Date Subject Author
7/3/06 Ross Clement
7/3/06 Gordon Sande
7/3/06 IanMike