Package com.bayesserver.statistics
Class JensenShannon
- java.lang.Object
-
- com.bayesserver.statistics.JensenShannon
-
public final class JensenShannon extends Object
Methods for computing the Jensen Shannon divergence, which measures the similarity between probability distributions. The Jensen Shannon divergence is symmetric and finite. The square root is a metric.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
divergence(Distribution p, Distribution q, LogarithmBase logarithm)
Calculates the Jensen Shannon divergence between two distributions.
-
-
-
Method Detail
-
divergence
public static double divergence(Distribution p, Distribution q, LogarithmBase logarithm)
Calculates the Jensen Shannon divergence between two distributions.- Parameters:
p
- The first distribution.q
- The second distribution.logarithm
- The logarithm base to use in the calculations.- Returns:
- The Jensen Shannon divergence.
-
-