public class JensenShannonDistance extends java.lang.Object implements Metric<double[]>, java.io.Serializable
The Jensen-Shannon divergence is a symmetrized and smoothed version of the Kullback-Leibler divergence . It is defined by
J(P||Q) = (D(P||M) + D(Q||M)) / 2
where M = (P+Q)/2 and D(·||·) is KL divergence. Different from the Kullback-Leibler divergence, it is always a finite value.
The square root of the Jensen-Shannon divergence is a metric, which is calculated by this class.
| Modifier and Type | Method and Description |
|---|---|
double |
d(double[] x,
double[] y)
Returns the distance measure between two objects.
|
java.lang.String |
toString() |