CovDist | R Documentation |
For a given 3-dimensional array where symmetric positive definite (SPD) matrices are stacked slice by slice, it computes pairwise distance using various popular measures. Some of measures are metric as they suffice 3 conditions in mathematical context; nonnegative definiteness, symmetry, and triangle inequalities. Other non-metric measures represent dissimilarities between two SPD objects.
CovDist(
A,
method = c("AIRM", "Bhattacharyya", "Cholesky", "Euclidean", "Hellinger", "JBLD",
"KLDM", "LERM", "Procrustes.SS", "Procrustes.Full", "PowerEuclidean",
"RootEuclidean"),
power = 1
)
A |
a |
method |
the type of distance measures to be used; |
power |
a non-zero number for PowerEuclidean distance. |
an (N\times N)
symmetric matrix of pairwise distances.
arsigny_log-euclidean_2006CovTools
\insertRefdryden_non-euclidean_2009CovTools
## generate 100 SPD matrices of size (5-by-5)
samples = samplecovs(100,5)
## get pairwise distance for "AIRM"
distAIRM = CovDist(samples, method="AIRM")
## dimension reduction using MDS
ss = cmdscale(distAIRM)
## visualize
opar <- par(no.readonly=TRUE)
plot(ss[,1],ss[,2],main="2d projection")
par(opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.