Class RelativeEntropy

java.lang.Object
jline.lib.butools.fitting.RelativeEntropy

public final class RelativeEntropy extends Object
  • Method Details

    • relativeEntropy

      public static double relativeEntropy(double[] p1, double[] p2)
      Returns the relative entropy (aka Kullback-Leibler divergence) of two vectors.
      Parameters:
      p1 - The first vector
      p2 - The second vector
      Returns:
      The relative entropy calculated as sum(p1_i * |log(p1_i/p2_i)|)
    • empiricalRelativeEntropy

      public static double empiricalRelativeEntropy(double[] p1, double[] p2)
      Returns the empirical relative entropy using trace data.
      Parameters:
      p1 - The first vector (from empirical data)
      p2 - The second vector (from model)
      Returns:
      The relative entropy