Compute the matrix of pairwise distances between a matrix X and a matrix Y
Usage
pairwise_distances(X,Y,metric)
Value
distXY [matrix] Pairwise distances. distXY[i,j] is the distance
between X[i,] and Y[j,]
Arguments
X
[matrix] A first matrix (samples in row, features in columns).
Y
[matrix] A second matrix (samples in row, features in columns).
If Y = NULL, then pairwise distances is computed between X and X
metric
[string or callable] The metric used. If metric is a string,
then metric is compiled (so faster). Available string are:
"euclidean", "sqeuclidean" (Square of Euclidean distance),
"logeulidean" (log of the Euclidean distance) and "chebyshev" (max).
Callable must be a function taking two vectors and returning a double.