View source: R/belief_trajectory.R
| shannon_concentration | R Documentation |
Computes a concentration measure based on the Shannon entropy of the
normalized per-step contributions. Robustness alternative to
concentration_index and herfindahl_index.
shannon_concentration(weights)
weights |
Numeric vector of per-step contributions. |
Defined as
C_S(w) = 1 - \frac{H(p)}{\log T}, \qquad p_k = \frac{|w_k|}{\sum_j |w_j|},
where H(p) = -\sum_k p_k \log p_k is the natural-log Shannon
entropy of the normalized contributions. This is the complement of the
normalized Shannon entropy: uniform weights give C_S = 0,
single-step dominance gives C_S \to 1.
Numeric scalar in [0, 1]. Returns 0 for uniform weights
and approaches 1 for single-step dominance. Returns 0 if all weights
are zero.
concentration_index,
herfindahl_index.
shannon_concentration(rep(1, 10)) # 0
shannon_concentration(c(10, rep(0.01, 9))) # ~0.95
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.