Class InformationTheory

java.lang.Object
org.episteme.core.mathematics.statistics.InformationTheory

public final class InformationTheory extends Object
Information theory primitives.
  • Method Details

    • shannonEntropy

      public static Real shannonEntropy(Map<?,Real> probabilities)
      Calculates the Shannon entropy of a discrete probability distribution. H(X) = -sum(p(x) * log2(p(x)))
      Parameters:
      probabilities - Map of outcomes to their probabilities.
      Returns:
      Entropy in bits.
    • stringEntropy

      public static Real stringEntropy(String s)
      Calculates the entropy of a string based on character frequency.
      Parameters:
      s - The input string.
      Returns:
      Entropy in bits per character.