Class JeffreyDivergenceDistance
- java.lang.Object
-
- elki.distance.AbstractNumberVectorDistance
-
- elki.distance.probabilistic.JeffreyDivergenceDistance
-
- All Implemented Interfaces:
Distance<NumberVector>
,NumberVectorDistance<NumberVector>
,PrimitiveDistance<NumberVector>
,SpatialPrimitiveDistance<NumberVector>
- Direct Known Subclasses:
JensenShannonDivergenceDistance
@Reference(authors="H. Jeffreys",title="An invariant form for the prior probability in estimation problems",booktitle="Proc. Royal Society A: Mathematical, Physical and Engineering Sciences 186(1007)",url="https://doi.org/10.1098/rspa.1946.0056",bibkey="doi:10.1098/rspa.1946.0056") @Reference(authors="J. Puzicha, J. M. Buhmann, Y. Rubner, C. Tomasi",title="Empirical evaluation of dissimilarity measures for color and texture",booktitle="Proc. 7th IEEE International Conference on Computer Vision",url="https://doi.org/10.1109/ICCV.1999.790412",bibkey="DBLP:conf/iccv/PuzichaRTB99") @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") @Reference(authors="D. M. Endres, J. E. Schindelin",title="A new metric for probability distributions",booktitle="IEEE Transactions on Information Theory 49(7)",url="https://doi.org/10.1109/TIT.2003.813506",bibkey="DBLP:journals/tit/EndresS03") @Alias("j-divergence") public class JeffreyDivergenceDistance extends AbstractNumberVectorDistance implements SpatialPrimitiveDistance<NumberVector>
Jeffrey Divergence forNumberVector
s is a symmetric, smoothened version of theKullbackLeiblerDivergenceAsymmetricDistance
. Topsøe called this "capacitory discrimination".\[JD(\vec{x},\vec{y}):= \sum\nolimits_i x_i\log\tfrac{2x_i}{x_i+y_i}+y_i\log\tfrac{2y_i}{x_i+y_i} = KL(\vec{x},\tfrac12(\vec{x}+\vec{y})) + KL(\vec{y},\tfrac12(\vec{x}+\vec{y}))\]
Reference:
H. Jeffreys
An invariant form for the prior probability in estimation problems
Proc. Royal Society A: Mathematical, Physical and Engineering Sciences 186(1007)J. Puzicha, J. M. Buhmann, Y. Rubner, C. Tomasi
Empirical evaluation of dissimilarity measures for color and texture
Proc. 7th IEEE International Conference on Computer VisionF. Topsøe
Some inequalities for information divergence and related measures of discrimination
IEEE Transactions on information theory, 46(4)D. M. Endres, J. E. Schindelin
A new metric for probability distributions
IEEE Transactions on Information Theory 49(7)TODO: add support for sparse vectors + varying length
- Since:
- 0.5.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JeffreyDivergenceDistance.Par
Parameterization class, using the static instance.
-
Field Summary
Fields Modifier and Type Field Description static JeffreyDivergenceDistance
STATIC
Static instance.
-
Constructor Summary
Constructors Constructor Description JeffreyDivergenceDistance()
Deprecated.Use static instance!
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
Methods inherited from class elki.distance.AbstractNumberVectorDistance
dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, getInputTypeRestriction
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface elki.distance.Distance
isMetric, isSymmetric
-
Methods inherited from interface elki.distance.PrimitiveDistance
getInputTypeRestriction
-
Methods inherited from interface elki.distance.SpatialPrimitiveDistance
instantiate
-
-
-
-
Field Detail
-
STATIC
public static final JeffreyDivergenceDistance STATIC
Static instance. Use this!
-
-
Constructor Detail
-
JeffreyDivergenceDistance
@Deprecated public JeffreyDivergenceDistance()
Deprecated.Use static instance!Constructor for the Jeffrey divergence - useSTATIC
instead.
-
-
Method Detail
-
distance
public double distance(NumberVector v1, NumberVector v2)
Description copied from interface:PrimitiveDistance
Computes the distance between two given DatabaseObjects according to this distance function.- Specified by:
distance
in interfaceNumberVectorDistance<NumberVector>
- Specified by:
distance
in interfacePrimitiveDistance<NumberVector>
- Parameters:
v1
- first DatabaseObjectv2
- second DatabaseObject- Returns:
- the distance between two given DatabaseObjects according to this distance function
-
minDist
public double minDist(SpatialComparable mbr1, SpatialComparable mbr2)
Description copied from interface:SpatialPrimitiveDistance
Computes the distance between the two given MBRs according to this distance function.- Specified by:
minDist
in interfaceSpatialPrimitiveDistance<NumberVector>
- Parameters:
mbr1
- the first MBR objectmbr2
- the second MBR object- Returns:
- the distance between the two given MBRs according to this distance function
-
isSquared
public boolean isSquared()
Description copied from interface:Distance
Squared distances, that would become metric after square root.E.g. squared Euclidean.
- Specified by:
isSquared
in interfaceDistance<NumberVector>
- Returns:
true
when squared.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-