Expand description
Information-theory primitives: entropy, joint entropy, conditional entropy, and mutual information. All values are in bits (base-2 logarithm).
Every function comes in two flavours:
- A checked variant that returns
Result<f64, InfoError>. - An
_uncheckedvariant that panics on error, intended for quick prototyping or when the caller has already validated its inputs.
Enums§
- Info
Error - Errors that can occur when computing information-theoretic quantities.
Functions§
- conditional_
entropy - Conditional entropy H(X|Y) in bits.
- conditional_
entropy_ unchecked - Panic-on-error convenience variant.
- cross_
entropy - Cross-entropy $H(P, Q)$ in bits.
- cross_
entropy_ unchecked - Panic-on-error convenience variant.
- entropy
- Shannon entropy H(X) in bits.
- entropy_
unchecked - Panic-on-error convenience variant of
entropy. - joint_
entropy - Joint entropy H(X,Y) in bits.
- joint_
entropy_ unchecked - Panic-on-error convenience variant.
- js_
divergence - Jensen-Shannon divergence $JSD(P | Q)$ in bits.
- js_
divergence_ unchecked - Panic-on-error convenience variant.
- kl_
divergence - KL divergence $D_{KL}(P | Q)$ in bits.
- kl_
divergence_ unchecked - Panic-on-error convenience variant.
- mutual_
information - Mutual information I(X;Y) in bits.
- mutual_
information_ unchecked - Panic-on-error convenience variant of
mutual_information.