Package jline.lib.butools.fitting
Class RelativeEntropyKt
-
- All Implemented Interfaces:
public final class RelativeEntropyKt
-
-
Method Summary
Modifier and Type Method Description final static DoublerelativeEntropy(DoubleArray p1, DoubleArray p2)Returns the relative entropy (aka Kullback-Leibler divergence) of two vectors. final static DoubleempiricalRelativeEntropy(DoubleArray p1, DoubleArray p2)Returns the empirical relative entropy using trace data. -
-
Method Detail
-
relativeEntropy
final static Double relativeEntropy(DoubleArray p1, DoubleArray 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
final static Double empiricalRelativeEntropy(DoubleArray p1, DoubleArray 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
-
-
-
-