Gini coefficient $ G $:

- Top $ 1/5 $ receives $ 4/5 $: $ G = 3/5 $
- Top $ 1/4 $ receives $ 3/4 $: $ G = 1/2 $
- Top $ 1/3 $ receives $ 2/3 $: $ G = 1/3 $

**Wikipedia**: *Gini Coefficient* https://en.wikipedia.org/wiki/Gini_coefficient: "In economics, the Gini coefficient (/ˈdʒiːni/ JEE-nee), sometimes called Gini index, or Gini ratio, is a measure of statistical dispersion intended to represent the income or wealth distribution of a nation's residents, and is the most commonly used measurement of inequality. It was developed by the Italian statistician and sociologist Corrado Gini and published in his 1912 paper Variability and Mutability (Italian: Variabilità e mutabilità) https://link.springer.com/article/10.1007/s10888-011-9188-x...

...The Gini coefficient measures the inequality among values of a frequency distribution (for example, levels of income). A Gini coefficient of zero expresses perfect equality, where all values are the same (for example, where everyone has the same income). A Gini coefficient of 1 (or 100%) expresses maximal inequality among values (e.g., for a large number of people, where only one person has all the income or consumption, and all others have none, the Gini coefficient will be very nearly one). However, a value greater than one may occur if some persons represent negative contribution to the total (for example, having negative income or wealth).... For OECD countries, in the late 20th century, considering the effect of taxes and transfer payments, the income Gini coefficient ranged between 0.24 and 0.49, with Slovenia being the lowest and Chile the highest....

An informative simplified case just distinguishes two levels of income, low and high. If the high income group is a proportion $ u $ of the population and earns a proportion $ f $ of all income, then the Gini coefficient is $ f − u $. An actual more graded distribution with these same values u and f will always have a higher Gini coefficient than $ f − u $...

```
class gini
delong_classes.gini()
delong_classes.gini.upper_class
delong_classes.gini.share
delong_classes.gini.income_ratio
```

In [3]:

```
# class gini, for getting a sense of what a Gini coefficient
# means, at least in the context of a two-class income
# distribution...
#
# I find that the measure I want is some combination of (a)
# how much richer the rich are as a multiple of the wealth
# and income of the poor, divided by something that increases
# as the proportion of the rich in the population goes up.
# My intuition is that a society with a substantial upper-
# middle class is in some sense less unequal than one with
# a small upper class, even if the higher class's wealth and
# income is the same multiple of the lower class's in both
# cases.
#
# This may be wrong. But it is my intuition. And the Gini does
# not really do this...
#
# This class will be kept in delong_classers...
import numpy as np
class gini:
"""
For a two-class distribution of income. Initialize
the class with a size-of-upper-class variable
equal to 1/5 and a share-of-upper-class variable
equal to 4/5
"""
def __init__(self,
upper_class = 1/5, # size of upper class
share = 4/5 # share of upper class
):
self.upper_class = upper_class
self.share = share
self.gini_value = self.share - self.upper_class
self.income_ratio = ((self.share/self.upper_class)/
((1-self.share)/(1-self.upper_class)))
```

In [6]:

```
# print a table calculating the Gini coefficient and the
# wealth of the upper class as a multiple of the wealth
# of the lower class for an upper class of i% that receives
# 1-i% of the income
import pandas as pd
Upper = []
Gini = []
Ratio = []
for i in range(1,51):
working = gini(upper_class=i/100, share=1-i/100)
Upper = Upper + [i/100]
Gini = Gini + [working.gini_value]
Ratio = Ratio + [working.income_ratio]
gini_df = pd.DataFrame()
gini_df['Upper'] = Upper
gini_df['Gini'] = Gini
gini_df['Ratio'] = Ratio
print("")
print("SIZE OF UPPER CLASS, GINI, AND WEALTH RATIO")
print("")
print(gini_df)
```

- Weblog Support https://github.com/braddelong/LS2019/blob/master/2019-09-18-notes-on-gini-coefficients.ipynb
- nbViewer https://nbviewer.jupyter.org/github/braddelong/LS2019/blob/master/2019-09-18-notes-on-gini-coefficients.ipynb