@Reference(authors="F. Tops\u00f8e", title="Some inequalities for information divergence and related measures of discrimination", booktitle="IEEE Transactions on information theory, 46(4)", url="https://doi.org/10.1109/18.850703", bibkey="DBLP:journals/tit/Topsoe00") public class TriangularDiscriminationDistanceFunction extends AbstractNumberVectorDistanceFunction implements SpatialPrimitiveDistanceFunction<NumberVector>
\[\text{Triangular-Discrimination}(\vec{x},\vec{y}):= \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.
See also TriangularDistanceFunction
for a metric version.
Reference:
F. Topsøe
Some inequalities for information divergence and related measures of
discrimination
IEEE Transactions on information theory, 46(4).
TODO: support sparse vectors, varying length
Modifier and Type | Class and Description |
---|---|
static class |
TriangularDiscriminationDistanceFunction.Parameterizer
Parameterization class, using the static instance.
|
Modifier and Type | Field and Description |
---|---|
static TriangularDiscriminationDistanceFunction |
STATIC
Static instance.
|
Constructor and Description |
---|
TriangularDiscriminationDistanceFunction()
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 |
isSquared()
Squared distances, that would become metric after square root.
|
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
isMetric, isSymmetric
public static final TriangularDiscriminationDistanceFunction STATIC
@Deprecated public TriangularDiscriminationDistanceFunction()
STATIC
instead.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 isSquared()
DistanceFunction
isSquared
in interface DistanceFunction<NumberVector>
true
when squared.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.