| mahalanobis {nexus} | R Documentation |
Mahalanobis Distance
Description
Computes the squared Mahalanobis distance of all rows in x.
Usage
## S4 method for signature 'CompositionMatrix'
mahalanobis(x, center, cov, ..., robust = TRUE, method = c("mve", "mcd"))
## S4 method for signature 'ILR'
mahalanobis(x, center, cov, ..., robust = TRUE, method = c("mve", "mcd"))
Arguments
x |
A |
center |
A |
cov |
A |
... |
Extra parameters to be passed to |
robust |
A |
method |
A |
Value
A numeric vector.
Author(s)
N. Frerebeau
See Also
Other statistics:
aggregate(),
covariance(),
dist,
margin(),
mean(),
metric_var(),
quantile(),
scale(),
variation()
Examples
## Data from Aitchison 1986
data("hongite")
## Coerce to compositional data
coda <- as_composition(hongite)
## Mahalanobis distance
mahalanobis(coda)