mahalanobis(x, center, cov, inverted=FALSE)
x
| Vector or matrix of data. |
center
| Mean vector of the distribution or second data vector. |
cov
| Covariance matrix of the distribution or the QR decomposition of the distribution. |
inverted
|
If TRUE, cov is supposed to contain the
inverse of the covariance matrix.
|
x and the
vector center, which is (for vector x) defined as
d = (x - center)' cov^{-1} (x - center)
qr,covx <- matrix(rnorm(30),ncol=3) mahalanobis(x)