dmahal | R Documentation |
dmahal
computes and returns the Mahalanobis distance matrix between the rows of a data matrix.
dmahal(datos, S)
datos |
data matrix. |
S |
covariance matrix. |
A dist
object with distance information.
There is a function mahalanobis()
in stats package which can perform the Mahalanobis distance. While mahalanobis()
calculates the Mahalanobis distance with respect to given a center, function dmahal()
is designed to calculate the distance between each pair of units given a data matrix.
Itziar Irigoien itziar.irigoien@ehu.eus; Konputazio Zientziak eta Adimen Artifiziala, Euskal Herriko Unibertsitatea (UPV/EHU), Donostia, Spain.
Conchita Arenas carenas@ub.edu; Departament d'Estadistica, Universitat de Barcelona, Barcelona, Spain.
Everitt B. S. and Dunn G. (2001) Applied Multivariate Data Analysis. 2 edition, Edward Arnold, London.
dist
, dbhatta
,
dgower
, dcor
, dproc2
#Generate 10 objects in dimension 2 mu <- rep(0, 2) Sigma <- matrix(c(10,3,3,2),2,2) x <- mvrnorm(n=10, rep(0, 2), Sigma) d <- dmahal(x, Sigma)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.