Skip to main content

expected_subsample_entropy

Function expected_subsample_entropy 

Source
pub fn expected_subsample_entropy(profile: &CountProfile, size: u64) -> f64
Expand description

Expected plug-in entropy (bits) of a with-replacement subsample of size sequences drawn from the position’s empirical k-mer distribution: E[H(Multinomial(size, p̂))].

By linearity, E[H] = Σ_k E[h(X_k)] with X_k ~ Binomial(size, c_k/N) and h(x) = −(x/size) log₂(x/size); each binomial expectation is evaluated exactly (to 10⁻¹⁸ of the probability mass) by walking the pmf from its mode.