[R] Rep mahalanobis distance

From: Cabannes <scabannes_at_free.fr>
Date: Sat 25 Jun 2005 - 00:13:22 EST


Dear Karen,

> I am trying to calculate Mahalanobis distances for a matrix called
> "fgmatrix"
>

> Then I get an error message "Covariance matrix is apparently singular"
>
> What does this mean? I can't see anything strange about the covariance
> matrix, and am not getting anywhere with the help files.
>
As you can read in the help for "mahalanobis distance" :

    Returns the Mahalanobis distance of all rows in 'x' and the vector     mu='center' with respect to Sigma='cov'. This is (for vector 'x')     defined as

                D2 = (x - mu)' Sigma^{-1} (x - mu)

that need to invert the cov matrix, so if not invertible...

Sam



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jun 25 00:15:07 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:02 EST