dmahal: Mahalanobis Distance

View source: R/dmahal.R

dmahalR Documentation

Mahalanobis Distance

Description

dmahal computes and returns the Mahalanobis distance matrix between the rows of a data matrix.

Usage

dmahal(datos, S)

Arguments

datos

data matrix.

S

covariance matrix.

Value

A dist object with distance information.

Note

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.

Author(s)

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.

References

Everitt B. S. and Dunn G. (2001) Applied Multivariate Data Analysis. 2 edition, Edward Arnold, London.

See Also

dist, dbhatta, dgower, dcor, dproc2

Examples

#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)

ICGE documentation built on Oct. 17, 2022, 5:10 p.m.

Related to dmahal in ICGE...