[R] mahalanobis distance

Michael Knudsen micknudsen at gmail.com
Mon Jul 20 15:56:35 CEST 2009


On Mon, Jul 20, 2009 at 3:08 PM, ekinakoglu<ekin at ims.metu.edu.tr> wrote:

> Error in solve.default(cov, ...) :
>  system is computationally singular: reciprocal condition number =
> 1.65972e-18

Try calculating the determinant of the S matrix:

> det(S)
[1] 2.825397e-06

It's very close to zero, and I guess that the matrix is therefore
considered non-invertible by R. Recall that S must be invertible

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

to work as a covarinace matrix in the definition of the Mahalanobis distance.

-- 
Michael Knudsen
micknudsen at gmail.com
http://lifeofknudsen.blogspot.com/




More information about the R-help mailing list