pdk.Math.Distances ($Date: 2002/12/04 10:16:02 $)
index
pdk/Math/Distances.py

Distance and similarity measures.

FOG 11.1999

 
Functions
            
coordinates_to_euclideandistance(X)
returns a square matrix of Euclidean distances for the points given in X.
cy_distance(v1, v2, weight=0.10000000000000001)
Yong`s dissimilarity measure.
distance_matrix(M, measure=<function euclidean_distance>, mode='byrow', returnFull=1)
returns a square n x n distance matrix for the n sample units of the n x m input matrix M using the dissimilarity measure measure. mode is one of DISTANCEMATRIX_MODE_BYROW - compute distances among rows DISTANCEMATRIX_MODE_BYCOLUMN - compute distances among columns DISTANCEMATRIX_MODE_BYCELL - compute distances among cells Note: for Euclidean Distance there is a much faster way to do this with the function coordinates_to_euclideandistance.
euclidean_distance(v1, v2, axis=0)
Euclidean distance between the two arrays v1 and v2:
euclidean_norm = euclidean_distance(v1, v2, axis=0)
Euclidean distance between the two arrays v1 and v2:
jaccard_distance(v1, v2)
Jaccard similarity converted to dissimilarity.
jaccard_similarity(v1, v2)
Jaccard similarity index J = c / (a + b + c) with c = species shared in both sites, a,b = species unique to each site
manhattan_distance(v1, v2, axis=0)
Manhattan distance between the two arrays v1 and v2:
soerensen_distance(v1, v2)
Soerensen similarity conveted to dissimilarity
soerensen_similarity(v1, v2)
Soerensen similarity index SJ = c / (A + B - c) with c = species shared in both sites A,B = total number of species in each site
 
Data
             DISTANCEMATRIX_MODE_BYCELL = 'bycell'
DISTANCEMATRIX_MODE_BYCOLUMN = 'bycolumn'
DISTANCEMATRIX_MODE_BYROW = 'byrow'
 
Author
            
$Author: gathmann $