Description Usage Arguments Value Examples
Transform matrix to use Mahalanobis distance instead of Euclidean one.
1 | maha_trans(U, estim = covrob_ogk(U))
|
U |
A matrix (e.g. PC scores). |
estim |
List of location and scatter estimates, |
U
, transformed.
1 2 3 4 5 6 7 8 9 | X <- readRDS(system.file("testdata", "three-pops.rds", package = "bigutilsr"))
svd <- svds(scale(X), k = 5)
U <- svd$u
dist1 <- dist_ogk(U)
U.maha <- maha_trans(U)
dist2 <- rowSums(U.maha^2)
all.equal(dist2, dist1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.