metrify: Nearest Metric Space Representation of a Dissimilarity Object

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Calculates the nearest metric space representation of a dissimilarity object by iterating the transitive closure of the triangle inequality rule

Usage

1
2
3
metrify(dis,upper=FALSE,diag=FALSE)
as.metric(dis,upper=FALSE,diag=FALSE)
is.metric(dis)

Arguments

dis

a distance or dissimilarity object returned from dist, vegdist, or dsvdis

upper

a logical switch to control whether to return the lower triangle (upper=FALSE) or upper triangle (upper=TRUE) of the distance matrix

diag

a logical switch to control whether to return the diagonal of the distance matrix

Details

Implements a constrained iteration of the transitive closure of the triangle inequality, such that the distance between any two objects is less than or equal to the sum of the distances from the two objects to a third.

Value

For metrify and as.metric, an object of class ‘dist’. For is.metric returns TRUE or FALSE.

Note

Many multivariate statistical methods are designed for metric spaces, and yet the direct calculation of distance is often inappropriate due to problems with joint absences. metrify takes any dissimilarity matrix and converts it to the closest metric space representation, generally to avoid negative eigenvalues in an eigenanalysis of the matrix.

Author(s)

David W. Roberts droberts@montana.edu http://ecology.msu.montana.edu/droberts/droberts.html

See Also

euclidify

Examples

1
2
3
4
5
data(bryceveg) # returns a vegetation data.frame
dis.bc <- dsvdis(bryceveg,'bray/curtis') # calculate a Bray/Curtis
            #  dissimilarity matrix
dis.met <- metrify(dis.bc) # calculate the nearest euclidean
            #  representation

labdsv documentation built on Aug. 4, 2019, 5:03 p.m.

Related to metrify in labdsv...