# Gini Index

## Definition

For the purpose of measuring name, sector or geographic concentration, the Gini Index (also Gini coefficient) is an index defined in terms of the Lorentz curve of the exposures. More precisely, if we have n exposures $E_i$ summing up to a total exposure of

$E_T = \sum^{n}_{i=1} E_{i}$

and the fractional exposures $w_i$ are defined as

$w_{i} = \frac{E_i}{E_T}$

Then the Gini index is defined as the area under the Lorenz curve which is geometrically reduced to

$G = 1 + \frac{1}{n} \sum^{n}_{i=1} (1 - 2 i) w_{i}$

NB: Sometimes the formula appears also with the opposite sign!

## Implementations

Open Source implementations of the Gini index are available in