Class HistogramMatchDistance

  • All Implemented Interfaces:
    Distance<NumberVector>, NumberVectorDistance<NumberVector>, PrimitiveDistance<NumberVector>, SpatialPrimitiveDistance<NumberVector>

    @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 HistogramMatchDistance
    extends AbstractNumberVectorDistance
    implements SpatialPrimitiveDistance<NumberVector>
    Distance function based on histogram matching, i.e., Manhattan distance on the cumulative density function.

    If your data is normalized to the 1-norm of 1, use ManhattanDistance 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

    Since:
    0.6.0
    Author:
    Erich Schubert
    • Constructor Detail

      • HistogramMatchDistance

        @Deprecated
        public HistogramMatchDistance()
        Deprecated.
        Use static instance!
        Constructor for the Histogram match distance function.
    • Method Detail

      • isMetric

        public boolean isMetric()
        Description copied from interface: Distance
        Is this distance function metric (satisfy the triangle inequality)
        Specified by:
        isMetric in interface Distance<NumberVector>
        Returns:
        true when metric.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object