|
The áfunction
distance
evaluates the distance between two
p-dimensional vectors with respect to a specified metric. The
possible metrics are given in the following table:
Distance | XploRe Name |
L1 | "l1" |
L2 | "l2", "euclid" |
Maximum | "maximum" |
Cosine | "cosine" |
![]() |
"chisquare" |
Centroid | "centroid" |
Tanimoto | "tanimoto" |
Matching | "matching" |
The first argument of
distance
is the matrix,
the second argument the XploRe name.
By default the second argument is
"l2". The commands
x = #(1, 4)~#(1, 5) distance(x,"l1")define the matrix x and evaluate the L1 distance between the rows of that matrix:
Contents of distance [1,] 0.000000 7.000000 [2,] 7.000000 0.000000while the command
distance(x)yields the L2 distance, since the second argument of the function
Contents of distance [1,] 0.000000 5.000000 [2,] 5.000000 0.000000The examples for this section are collected in
![]() |
MD*TECH Method and Data Technologies |
http://www.mdtech.de mdtech@mdtech.de |