Class TriangularDistance

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

    @Reference(authors="R. Connor, F. A. Cardillo, L. Vadicamo, F. Rabitti",
               title="Hilbert Exclusion: Improved Metric Search through Finite Isometric Embeddings",
               booktitle="arXiv preprint arXiv:1604.08640",
               url="http://arxiv.org/abs/1604.08640",
               bibkey="DBLP:journals/corr/ConnorCVR16")
    public class TriangularDistance
    extends TriangularDiscriminationDistance
    Triangular Distance has relatively tight upper and lower bounds to the (square root of the) Jensen-Shannon divergence, but is much less expensive.

    \[\text{Triangular-Distance}(\vec{x},\vec{y}):=\sqrt{ \sum\nolimits_i \tfrac{|x_i-y_i|^2}{x_i+y_i}}\]

    This distance function is meant for distribution vectors that sum to 1, and does not work on negative values.

    This differs from TriangularDistance simply by the square root, which makes it a proper metric and a good approximation for the much more expensive SqrtJensenShannonDivergenceDistance.

    Reference:

    R. Connor, F. A. Cardillo, L. Vadicamo, F. Rabitti
    Hilbert Exclusion: Improved Metric Search through Finite Isometric Embeddings
    arXiv preprint arXiv:1604.08640

    TODO: support sparse vectors, varying length

    Since:
    0.7.5
    Author:
    Erich Schubert