Package jline.lib.butools.fitting
Class RelativeEntropy
java.lang.Object
jline.lib.butools.fitting.RelativeEntropy
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubleempiricalRelativeEntropy(double[] p1, double[] p2) Returns the empirical relative entropy using trace data.static doublerelativeEntropy(double[] p1, double[] p2) Returns the relative entropy (aka Kullback-Leibler divergence) of two vectors.
-
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 vectorp2- 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
-