gdist {mvpart} | R Documentation |
The function computes useful dissimilarity indices which are known to have a good rank-order relation with gradient separation and are thus efficient in community ordination with multidimensional scaling.
gdist(x, method="bray", keepdiag=FALSE, full=FALSE, sq=FALSE)
x |
Data matrix |
method |
Dissimilarity index |
keepdiag |
Compute amd keep diagonals |
full |
Return the square dissimilarity matrix |
sq |
Square the dissimilarities – useful for distance-based partitioning |
The function knows the following dissimilarity indices:
euclidean | d[jk] = sqrt(sum (x[ij]-x[ik])^2) |
manhattan | d[jk] = sum(abs(x[ij] - x[ik])) |
gower | d[jk] = sum (abs(x[ij]-x[ik])/(max(i)-min(i)) |
canberra | d[jk] = (1/NZ) sum ((x[ij]-x[ik])/(x[ij]+x[ik])) |
bray | d[jk] = (sum abs(x[ij]-x[ik])/(sum (x[ij]+x[ik])) |
kulczynski | d[jk] 1 - 0.5*((sum min(x[ij],x[ik])/(sum x[ij]) + (sum min(x[ij],x[ik])/(sum x[ik])) |
maximum | d[jk] = max(abs(x[ij] - x[ik])) |
binary | d[jk] = max(abs(x[ij]>0 - x[ik]>0)) |
chord | d[jk] = sqrt((sum (x[ij]-x[ik])^2)/(sum (x[ij]+x[ik])^2)) |
where NZ is the number of non-zero entries.
Infamous ''double zeros'' are removed in Canberra dissimilarity.
Euclidean and Manhattan dissimilarities are not good in gradient separation without proper standardization but are still included for comparison and special needs.
Some of indices become identical or rank-order similar after some standardizations.
Should be interchangeable with dist
and returns a
distance object of the same type.
The function is an alternative to dist
adding
some ecologically meaningful indices. Both methods should produce
similar types of objects which can be interchanged in any method
accepting either. Manhattan and Euclidean dissimilarities should be
identical in both methods, and Canberra dissimilary may be similar.
Jari Oksanen – modified Glenn De'ath (Dec 03)
Faith, D.P, Minchin, P.R. and Belbin, L. (1987) Compositional dissimilarity as a robust measure of ecological distance. Vegetatio 69, 57-68.
data(spider) spider.dist <- gdist(spider[1:12,])