Class 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 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.