skbio.diversity.alpha.
gini_index
(data, method='rectangles')[source]¶Calculate the Gini index.
State: Experimental as of 0.4.0.
The Gini index is defined as
where \(A\) is the area between \(y=x\) and the Lorenz curve and \(B\) is the area under the Lorenz curve. Simplifies to \(1-2B\) since \(A+B=0.5\).
Parameters: | data : 1-D array_like
method : {‘rectangles’, ‘trapezoids’}
|
---|---|
Returns: | double
|
Raises: | ValueError
|
Notes
The Gini index was introduced in [R5959]. The formula for
method='rectangles'
is
The formula for method='trapezoids'
is
References
[R5959] | (1, 2) Gini, C. (1912). “Variability and Mutability”, C. Cuppini, Bologna, 156 pages. Reprinted in Memorie di metodologica statistica (Ed. Pizetti E, Salvemini, T). Rome: Libreria Eredi Virgilio Veschi (1955). |