theil_index
cellseg_gsontools.diversity.theil_index(x)
¶
Compute the Theil index of inequality for species.
Theil-index: $$ T = \sum_{i=1}^n \left( \frac{y_i}{\sum_{i=1}^n y_i} \ln \left[ N \frac{y_i} {\sum_{i=1}^n y_i} \right]\right) $$
where \(y_i\) is the count of species \(i\) and \(N\) is the total count of species.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Sequence
|
The input value-vector. Shape (n, ) |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The computed Theil index. |