entropy_log10: Shannon entropy in base-10 (bans)

View source: R/belief_trajectory.R

entropy_log10R Documentation

Shannon entropy in base-10 (bans)

Description

Computes the Shannon entropy of a probability distribution, using base-10 logarithm so the result is expressed in bans (the forensic convention for weight-of-evidence units).

Usage

entropy_log10(p, epsilon = 1e-20)

Arguments

p

Numeric vector. Probability distribution (must sum to 1, entries in [0, 1]).

epsilon

Numeric scalar. Small positive constant to avoid \log(0) for zero-probability outcomes. Default 10^{-20}.

Value

Numeric scalar. Shannon entropy H(p) = -\sum_i p_i \log_{10} p_i in bans.

See Also

kl_divergence_log10, trajectory_metrics.

Examples

entropy_log10(c(0.5, 0.5))          # log10(2)
entropy_log10(rep(1/12, 12))        # log10(12)
entropy_log10(c(1, 0, 0, 0))        # ~0


mispitools documentation built on Aug. 26, 2026, 1:08 a.m.