Package elki.distance

Class BrayCurtisDistance

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

    @Reference(authors="J. R. Bray, J. T. Curtis",title="An ordination of the upland forest communities of southern Wisconsin",booktitle="Ecological monographs 27.4",url="https://doi.org/10.2307/1942268",bibkey="doi:10.2307/1942268") @Reference(authors="T. S\u00f8rensen",title="A method of establishing groups of equal amplitude in plant sociology based on similarity of species and its application to analyses of the vegetation on Danish commons",booktitle="Kongelige Danske Videnskabernes Selskab, Biologiske Skrifter 5(4)",bibkey="journals/misc/Sorensen48") @Reference(authors="L. R. Dice",title="Measures of the Amount of Ecologic Association Between Species",booktitle="Ecology 26 (3)",url="https://doi.org/10.2307/1932409",bibkey="doi:10.2307/1932409")
    @Alias({"bray-curtis","braycurtis","sorensen","dice","sorensen-dice"})
    public class BrayCurtisDistance
    extends AbstractNumberVectorDistance
    implements SpatialPrimitiveDistance<NumberVector>
    Bray-Curtis distance function / Sørensen–Dice coefficient for continuous vector spaces (not only binary data).

    Reference:

    J. R. Bray, J. T. Curtis
    An ordination of the upland forest communities of southern Wisconsin
    Ecological monographs 27.4

    Also:

    T. Sørensen
    A method of establishing groups of equal amplitude in plant sociology based on similarity of species and its application to analyses of the vegetation on Danish commons
    Kongelige Danske Videnskabernes Selskab, Biologiske Skrifter 5(4)

    and:

    L. R. Dice
    Measures of the Amount of Ecologic Association Between Species
    Ecology 26 (3)

    Note: we modified the usual definition of Bray-Curtis for use with negative values. In essence, this function is defined as:

    ManhattanDistance(v1, v2) / (ManhattanNorm(v1) + ManhattanNorm(v2))

    This obviously limits the usefulness of this distance function for cases where this kind of normalization is desired. In particular in low dimensional data it should be used with care.

    TODO: add a version optimized for sparse vectors / binary data.

    Since:
    0.6.0
    Author:
    Erich Schubert
    • Field Detail

      • STATIC_CONTINUOUS

        public static final BrayCurtisDistance STATIC_CONTINUOUS
        Static instance.
    • Constructor Detail

      • BrayCurtisDistance

        @Deprecated
        public BrayCurtisDistance()
        Deprecated.
        Use STATIC_CONTINUOUS instance instead.
        Constructor.
    • Method Detail

      • 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