@Reference(authors="L. N. Vaserstein", title="Markov processes over denumerable products of spaces describing large systems of automata", booktitle="Problemy Peredachi Informatsii 5.3 / Problems of Information Transmission, 5:3", url="http://mi.mathnet.ru/eng/ppi1811", bibkey="journals/misc/Vaserstein69") public class HistogramMatchDistanceFunction extends AbstractNumberVectorDistanceFunction implements SpatialPrimitiveDistanceFunction<NumberVector>
If your data is normalized to the 1-norm of 1, use
ManhattanDistanceFunction
instead, as this will be faster!
This distance function assumes there exist a natural order in the vectors, i.e., they should be some 1-dimensional histogram.
This is also known as Earth Movers Distance (EMD), 1st Mallows distance or 1st Wasserstein metric (also Vasershtein metric), for the special case of a one-dimensional histogram, where the cost is linear in the number of bins to transport.
Reference:
L. N. Vaserstein
Markov processes over denumerable products of spaces describing large systems
of automata
Problemy Peredachi Informatsii 5.3 / Problems of Information Transmission 5:3
Modifier and Type | Class and Description |
---|---|
static class |
HistogramMatchDistanceFunction.Parameterizer
Parameterization class, using the static instance.
|
Modifier and Type | Field and Description |
---|---|
static HistogramMatchDistanceFunction |
STATIC
Static instance.
|
Constructor and Description |
---|
HistogramMatchDistanceFunction()
Deprecated.
Use static instance!
|
Modifier and Type | Method and Description |
---|---|
double |
distance(NumberVector v1,
NumberVector v2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isMetric()
Is this distance function metric (satisfy the triangle inequality)
|
double |
minDist(SpatialComparable mbr1,
SpatialComparable mbr2)
Computes the distance between the two given MBRs according to this distance
function.
|
java.lang.String |
toString() |
dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, getInputTypeRestriction
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
instantiate
getInputTypeRestriction
isSquared, isSymmetric
public static final HistogramMatchDistanceFunction STATIC
@Deprecated public HistogramMatchDistanceFunction()
public double distance(NumberVector v1, NumberVector v2)
PrimitiveDistanceFunction
distance
in interface NumberVectorDistanceFunction<NumberVector>
distance
in interface PrimitiveDistanceFunction<NumberVector>
v1
- first DatabaseObjectv2
- second DatabaseObjectpublic double minDist(SpatialComparable mbr1, SpatialComparable mbr2)
SpatialPrimitiveDistanceFunction
minDist
in interface SpatialPrimitiveDistanceFunction<NumberVector>
mbr1
- the first MBR objectmbr2
- the second MBR objectpublic boolean isMetric()
DistanceFunction
isMetric
in interface DistanceFunction<NumberVector>
true
when metric.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2019 ELKI Development Team. License information.