Alpha diversity measures (skbio.diversity.alpha)#

This package provides implementations of various alpha diversity [1] metrics, including measures of richness, diversity, evenness, dominance, and coverage.

Some functions generate confidence intervals (CIs). These functions have the suffix _ci.

Richness metrics#

Richness [2] measures the number of species (taxa) in a community.

Due to incomplete sampling, the number of observed species (sobs) in a sample is usually lower than the true number of species in the community. Metrics have been proposed to estimate the latter based on the distribution of observed species in the sample.

ace(counts[, rare_threshold])

Calculate the ACE metric (Abundance-based Coverage Estimator).

chao1(counts[, bias_corrected])

Calculate Chao1 richness estimator.

chao1_ci(counts[, bias_corrected, zscore])

Calculate Chao1 confidence interval.


Calculate number of double-occurrence taxa (doubletons).

faith_pd(counts[, taxa, tree, validate, otu_ids])

Calculate Faith's phylogenetic diversity (Faith's PD) metric.


Calculate Margalef's richness index.


Calculate Menhinick's richness index.

michaelis_menten_fit(counts[, num_repeats, ...])

Calculate Michaelis-Menten fit to rarefaction curve of observed taxa.


Calculate the number of distinct features.


Calculate the number of distinct OTUs.


Calculate observed taxa, singletons, and doubletons.


Calculate number of single-occurrence taxa (singletons).


Calculate the observed species richness of a sample.

Diversity metrics#

Diversity [3] measures the number and relative abundances of species (taxa) in a community. It combines richness and evenness.

Some diversity metrics describe the effective number of species (a.k.a., true diversity) – the number of equally-abundant species that produce the same diversity measurement.


Calculate Brillouin's diversity index.

enspie(counts[, finite])

Calculate ENS_pie alpha diversity measure.


Calculate Fisher's alpha, a metric of diversity.

hill(counts[, order])

Calculate Hill number.

inv_simpson(counts[, finite])

Calculate inverse Simpson index.

kempton_taylor_q(counts[, lower_quantile, ...])

Calculate Kempton-Taylor Q index of alpha diversity.

phydiv(counts[, taxa, tree, rooted, weight, ...])

Calculate generalized phylogenetic diversity (PD) metrics.

renyi(counts[, order, base])

Calculate Renyi entropy.

shannon(counts[, base, exp])

Calculate Shannon's diversity index.

simpson(counts[, finite])

Calculate Simpson's diversity index.

tsallis(counts[, order])

Calculate Tsallis entropy.

Evenness metrics#

Evenness [4] (or equitability) measures the closeness of species (taxa) in a community in terms of abundance (number of individuals within the species). The calculation of evenness involves the relative abundances of species.


Calculate Heip's evenness measure.


Calculate McIntosh's evenness measure.

pielou_e(counts[, base])

Calculate Pielou's evenness index.


Calculate Simpson's evenness index.

Dominance metrics#

Dominance [5] (or concentration) measures the degree that one or a few most abundant species (taxa) represent the great majority of a community. It can be considered as a measure of community unevenness.

It should be noted that higher dominance corresponds to lower biodiversity.


Calculate Berger-Parker dominance index.

dominance(counts[, finite])

Calculate Simpson's dominance index.

gini_index(data[, method])

Calculate the Gini index.


Calculate McIntosh dominance index.

simpson_d(counts[, finite])

Calculate Simpson's dominance index, a.k.a.


Calculate Strong's dominance index.

Coverage metrics#

Coverage [6] measures the proportion of individuals of a community that have been observed (or unobserved) in a sample. It describes the completeness of sampling.


Calculate Esty's confidence interval of Good's coverage estimator.


Calculate Good's coverage estimator.

lladser_ci(counts, r[, alpha, f, ci_type])

Calculate single CI of the conditional uncovered probability.

lladser_pe(counts[, r])

Calculate single point estimate of conditional uncovered probability.


Calculate Robbins' estimator for probability of unobserved outcomes.