2

I get the following error while running the mahalanobis distance

Error in solve.default(cov, ...) : 
  Lapack routine dgesv: system is exactly singular: U[2,2] = 0

This is my code.

calibration <- 10
mean <- colMeans(x[1:calibration,])
sx <- cov(x[1:calibration,])
d <- mahalanobis(x[1:calibration,], mean, sx) 

And this the data

1 0.7071068
0 0.0000000
2 1.4142136
2 1.4142136
0 0.0000000
0 0.0000000
2 1.4142136
1 0.7071068
1 0.7071068
0 0.0000000

How can I avoid this error?

0 Answers0