Learn R Programming

ade4 (version 1.01)

lingoes: Transformation of a Distance Matrix for becoming Euclidean

Description

transforms a distance matrix in an Euclidean one.

Usage

lingoes(distmat, print = FALSE)

Arguments

distmat
an object of class 'dist'
print
if TRUE, prints the eigenvalues of the matrix

Value

  • returns an object of class 'dist' with an Euclidean distance

Details

The function uses the smaller positive constant k which transforms the matrix of $\sqrt{d_{ij}^2 + 2 \ast k}$ in an Euclidean one

References

Lingoes, J.C. (1971) Some boundary conditions for a monotone analysis of symmetric matrices. Psychometrika, 36, 195--203.

Examples

Run this code
data(capitales)
d0 <- as.dist(capitales$df)
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

Run the code above in your browser using DataLab