View source: R/belief_trajectory.R
| entropy_log10 | R Documentation |
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).
entropy_log10(p, epsilon = 1e-20)
p |
Numeric vector. Probability distribution (must sum to 1, entries
in |
epsilon |
Numeric scalar. Small positive constant to avoid
|
Numeric scalar. Shannon entropy H(p) = -\sum_i p_i
\log_{10} p_i in bans.
kl_divergence_log10,
trajectory_metrics.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.