Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lingoes

Transformation of a Distance Matrix for becoming Euclidean


Description

transforms a distance matrix in a Euclidean one.

Usage

lingoes(distmat, print = FALSE, tol = 1e-07, cor.zero = TRUE)

Arguments

distmat

an object of class dist

print

if TRUE, prints the eigenvalues of the matrix

tol

a tolerance threshold for zero

cor.zero

if TRUE, zero distances are not modified

Details

The function uses the smaller positive constant k which transforms the matrix of sqrt(dij² + 2*k) in an Euclidean one

Value

returns an object of class dist with a Euclidean distance

Author(s)

Daniel Chessel
Stéphane Dray stephane.dray@univ-lyon1.fr

References

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

Examples

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

ade4

Analysis of Ecological Data: Exploratory and Euclidean Methods in Environmental Sciences

v1.7-16
GPL (>= 2)
Authors
Stéphane Dray <stephane.dray@univ-lyon1.fr>, Anne-Béatrice Dufour <anne-beatrice.dufour@univ-lyon1.fr>, and Jean Thioulouse <jean.thioulouse@univ-lyon1.fr>, with contributions from Thibaut Jombart, Sandrine Pavoine, Jean R. Lobry, Sébastien Ollier, Daniel Borcard, Pierre Legendre, Stéphanie Bougeard and Aurélie Siberchicot. Based on earlier work by Daniel Chessel.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.