Package elki.distance.probabilistic
Class KullbackLeiblerDivergenceReverseAsymmetricDistance
- java.lang.Object
-
- elki.distance.AbstractNumberVectorDistance
-
- elki.distance.probabilistic.KullbackLeiblerDivergenceReverseAsymmetricDistance
-
- All Implemented Interfaces:
Distance<NumberVector>
,NumberVectorDistance<NumberVector>
,PrimitiveDistance<NumberVector>
@Reference(authors="S. Kullback", title="Information theory and statistics", booktitle="", bibkey="books/dover/Kullback59") @Alias("kli") public class KullbackLeiblerDivergenceReverseAsymmetricDistance extends AbstractNumberVectorDistance
Kullback-Leibler divergence, also known as relative entropy, information deviation or just KL-distance (albeit asymmetric).\[KL_R(\vec{x},\vec{y}):=\sum\nolimits_i y_i\log\tfrac{y_i}{x_i} = KL(\vec{y},\vec{x})\]
This version has the arguments reversed, see
KullbackLeiblerDivergenceAsymmetricDistance
for the "forward" version.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
KullbackLeiblerDivergenceReverseAsymmetricDistance.Par
Parameterization class, using the static instance.
-
Field Summary
Fields Modifier and Type Field Description static KullbackLeiblerDivergenceReverseAsymmetricDistance
STATIC
Static instance.
-
Constructor Summary
Constructors Constructor Description KullbackLeiblerDivergenceReverseAsymmetricDistance()
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 KullbackLeiblerDivergenceReverseAsymmetricDistance 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
-
-