checkmetric {maotai} | R Documentation |
Check for Metric Matrix
Description
This function checks whether the distance matrix satisfies
four axioms to make itself a semimetric, which are (1)
, (2)
for
,
(3)
, and (4)
.
Usage
checkmetric(d)
Arguments
d |
|
Value
a logical; TRUE
if it satisfies metric property, FALSE
otherwise.
See Also
Examples
## Let's use L2 distance matrix of iris dataset
data(iris)
dx = as.matrix(stats::dist(iris[,1:4]))
# perturb d(i,j)
dy = dx
dy[1,2] <- dy[2,1] <- 10
# run the algorithm
checkmetric(dx)
checkmetric(dy)
[Package maotai version 0.2.5 Index]