Description Usage Arguments Details Value Author(s) References Examples
transforms a distance matrix in a Euclidean one.
1 |
distmat |
an object of class |
print |
if TRUE, prints the eigenvalues of the matrix |
tol |
a tolerance threshold for zero |
cor.zero |
if TRUE, zero distances are not modified |
The function uses the smaller positive constant k which transforms the matrix of sqrt(dij² + 2*k) in an Euclidean one
returns an object of class dist
with a Euclidean distance
Daniel Chessel
Stéphane Dray stephane.dray@univ-lyon1.fr
Lingoes, J.C. (1971) Some boundary conditions for a monotone analysis of symmetric matrices. Psychometrika, 36, 195–203.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(capitales)
d0 <- capitales$dist
is.euclid(d0) # FALSE
d1 <- lingoes(d0, TRUE)
# Lingoes constant = 2120982
is.euclid(d1) # TRUE
plot(d0, d1)
x0 <- sort(unclass(d0))
lines(x0, sqrt(x0^2 + 2 * 2120982), lwd = 3)
is.euclid(sqrt(d0^2 + 2 * 2120981), tol = 1e-10) # FALSE
is.euclid(sqrt(d0^2 + 2 * 2120982), tol = 1e-10) # FALSE
is.euclid(sqrt(d0^2 + 2 * 2120983), tol = 1e-10)
# TRUE the smaller constant
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.