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

cailliez

Transformation to make Euclidean a distance matrix


Description

This function computes the smallest positive constant that makes Euclidean a distance matrix and applies it.

Usage

cailliez(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

Value

an object of class dist containing a Euclidean distance matrix.

Author(s)

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

References

Cailliez, F. (1983) The analytical solution of the additive constant problem. Psychometrika, 48, 305–310.

Legendre, P. and Anderson, M.J. (1999) Distance-based redundancy analysis: testing multispecies responses in multifactorial ecological experiments. Ecological Monographs, 69, 1–24.

Legendre, P., and Legendre, L. (1998) Numerical ecology, 2nd English edition edition. Elsevier Science BV, Amsterdam.

Examples

data(capitales)
d0 <- capitales$dist
is.euclid(d0) # FALSE
d1 <- cailliez(d0, TRUE)
# Cailliez constant = 2429.87867 
is.euclid(d1) # TRUE
plot(d0, d1)
abline(lm(unclass(d1)~unclass(d0)))
print(coefficients(lm(unclass(d1)~unclass(d0))), dig = 8) # d1 = d + Cte
is.euclid(d0 + 2428) # FALSE
is.euclid(d0 + 2430) # TRUE the smallest 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.