mahalDistP | R Documentation |
For N points, in M dimensions, get pairwise squared Mahalanobis distances between points. Return a square matrix of distances.
mahalDistP(m, covar = NULL, ...)
m |
A matrix with observations in rows. |
covar |
The covariance matrix for m. |
... |
Not used. |
For each pair of N points in M dimensions, get pairwise
squared Mahalanobis distances between points. Returns an
object, d
, of class "dist" (see
dist
) containing pairwise squared
Mahalanobis distances for all points in m. The method
attribute of d
is set to "mahalanobis". Obviously,
d
can get big for large N.
The full symmetric distance matrix for d can be recovered by
calling as.matrix(d)
.
This function is a convenience wrapper around
mahalanobis
, which see.
An object of class "dist" (see dist
)
containing pairwise squared Mahalanobis distances for all
points in m.
Dave Braze davebraze@gmail.com
mahalanobis
cov
solve
dist
m <- matrix(rnorm(200, m=.8, s=.05), nrow=50) md <- mahalDistP(m) cluster <- hclust(md) plot(cluster)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.