Package elki.distance.probabilistic
Class KullbackLeiblerDivergenceAsymmetricDistance
- java.lang.Object
-
- elki.distance.AbstractNumberVectorDistance
-
- elki.distance.probabilistic.KullbackLeiblerDivergenceAsymmetricDistance
-
- All Implemented Interfaces:
Distance<NumberVector>
,NumberVectorDistance<NumberVector>
,PrimitiveDistance<NumberVector>
@Reference(authors="S. Kullback", title="Information theory and statistics", booktitle="", bibkey="books/dover/Kullback59") @Alias("kl") public class KullbackLeiblerDivergenceAsymmetricDistance extends AbstractNumberVectorDistance
Kullback-Leibler divergence, also known as relative entropy, information deviation, or just KL-distance (albeit asymmetric).\[KL(\vec{x},\vec{y}):=\sum\nolimits_i x_i\log\tfrac{x_i}{y_i}\]
For a version with the arguments reversed, see
KullbackLeiblerDivergenceReverseAsymmetricDistance
.For a symmetric version, see
JeffreyDivergenceDistance
.Reference:
S. Kullback
Information theory and statistics- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KullbackLeiblerDivergenceAsymmetricDistance.Par
Parameterization class, using the static instance.
-
Field Summary
Fields Modifier and Type Field Description static KullbackLeiblerDivergenceAsymmetricDistance
STATIC
Static instance.
-
Constructor Summary
Constructors Constructor Description KullbackLeiblerDivergenceAsymmetricDistance()
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 vectors according to this distance function.boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
isSymmetric()
Is this function symmetric?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.PrimitiveDistance
instantiate
-
-
-
-
Field Detail
-
STATIC
public static final KullbackLeiblerDivergenceAsymmetricDistance STATIC
Static instance. Use this!
-
-
Method Detail
-
distance
public double distance(NumberVector v1, NumberVector v2)
Description copied from interface:NumberVectorDistance
Computes the distance between two given vectors according to this distance function.- Parameters:
v1
- first vectorv2
- second vector- Returns:
- the distance between two given vectors according to this distance function
-
isSymmetric
public boolean isSymmetric()
Description copied from interface:Distance
Is this function symmetric?- Returns:
true
when symmetric
-
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
-
-