skbio.diversity.alpha.simpson#
- skbio.diversity.alpha.simpson(counts, finite=False)[source]#
Calculate Simpson’s diversity index.
Simpson’s diversity index, a.k.a., Gini-Simpson index, or Gini impurity, is defined as:
\[1 - \sum_{i=1}^S{p_i^2}\]where \(S\) is the number of taxa and \(p_i\) is the proportion of the sample represented by taxon \(i\).
Therefore, Simpson’s diversity index is also denoted as \(1 - D\), in which \(D\) is the Simpson’s dominance index.
Simpson’s diversity index can be interpreted as the probability that two randomly selected individuals belong to different taxa. It is also known as Hurlbert’s probability of interspecific encounter (PIE).
- Parameters:
- counts1-D array_like, int
Vector of counts.
- finitebool, optional
If
True
, correct for finite sampling when calculating \(D\).
- Returns:
- float
Simpson’s diversity index.
See also
Notes
Simpson’s diversity index was originally described in [1].
Hurlbert’s probability of interspecific encounter was described in [2].
References