This article is translated from a Chinese article on my Zhihu account. The original article was posted at 2021-04-25 10:06 +0800.
First, define the Lorenz curve: it is the curve that consists of all points ( u , v ) (u,v) ( u , v ) such that the poorest u u u portion of population in the country owns v v v portion of the total wealth.
The Gini coefficient G / μ G/\mu G / μ is defined as the area between the Lorenz curve and the line u = v u=v u = v divided by the area enclosed by the three lines u = v u=v u = v , v = 0 v=0 v = 0 , and u = 1 u=1 u = 1 .
Now, suppose the wealth distribution in the country is p ( X ) p(X) p ( X ) , where p ( x ) d x p\!\left(x\right)\mathrm dx p ( x ) d x is the portion of population that has wealth in the range [ x , x + d x ] [x,x+\mathrm dx] [ x , x + d x ] .
Then, the Lorenz curve is the graph of the function g g g defined as
g ( F ( x ) ) = 1 μ ∫ − ∞ x t p ( t ) d t , g(F(x))=\frac1\mu\int_{-\infty}^xtp\!\left(t\right)\mathrm dt, g ( F ( x )) = μ 1 ∫ − ∞ x tp ( t ) d t ,
where
F ( x ) ≔ ∫ − ∞ x p ( t ) d t F\!\left(x\right)\coloneqq\int_{-\infty}^xp\!\left(t\right)\mathrm dt F ( x ) : = ∫ − ∞ x p ( t ) d t
is the cumulative distribution function of p ( X ) p(X) p ( X ) , and
μ ≔ ∫ − ∞ + ∞ t p ( t ) d t \mu\coloneqq\int_{-\infty}^{+\infty}tp\!\left(t\right)\mathrm dt μ : = ∫ − ∞ + ∞ tp ( t ) d t
( 1 ) (1) ( 1 )
is the average wealth of the population, which is just E [ X ] \mathrm E[\mathrm X] E [ X ] (X X X is a random variable such that X ∼ p ( X ) X\sim p(X) X ∼ p ( X ) ).
Then, the Lorenz curve is
v = g ( u ) ≔ 1 μ ∫ − ∞ F − 1 ( u ) t p ( t ) d t . v=g(u)\coloneqq\frac1\mu\int_{-\infty}^{F^{-1}(u)}tp\!\left(t\right)\mathrm dt. v = g ( u ) : = μ 1 ∫ − ∞ F − 1 ( u ) tp ( t ) d t .
According to the definition of the Gini coefficient,
G ≔ 2 μ ∫ 0 1 ( u − g ( u ) ) d u = μ − 2 μ ∫ 0 1 g ( u ) d u = μ − 2 ∫ u = 0 1 ∫ t = − ∞ F − 1 ( u ) t p ( t ) d t d u . \begin{align*}
G&\coloneqq2\mu\int_0^1\left(u-g(u)\right)\mathrm du\\
&=\mu-2\mu\int_0^1g\!\left(u\right)\mathrm du\\
&=\mu-2\int_{u=0}^1\int_{t=-\infty}^{F^{-1}(u)}tp\!\left(t\right)\mathrm dt\,\mathrm du.
\end{align*} G : = 2 μ ∫ 0 1 ( u − g ( u ) ) d u = μ − 2 μ ∫ 0 1 g ( u ) d u = μ − 2 ∫ u = 0 1 ∫ t = − ∞ F − 1 ( u ) tp ( t ) d t d u .
Interchange the order of integration, and we have
G = μ − 2 ∫ t = − ∞ + ∞ ∫ u = F ( t ) 1 t p ( t ) d t d u = μ − 2 ∫ − ∞ + ∞ ( 1 − F ( t ) ) t p ( t ) d t . \begin{align*}
G&=\mu-2\int_{t=-\infty}^{+\infty}\int_{u=F(t)}^1tp\!\left(t\right)\mathrm dt\,\mathrm du\\
&=\mu-2\int_{-\infty}^{+\infty}\left(1-F(t)\right)tp\!\left(t\right)\mathrm dt.
\end{align*} G = μ − 2 ∫ t = − ∞ + ∞ ∫ u = F ( t ) 1 tp ( t ) d t d u = μ − 2 ∫ − ∞ + ∞ ( 1 − F ( t ) ) tp ( t ) d t .
Substitute Equation 1 into the above equation, and we have
G = ∫ − ∞ + ∞ 2 t F ( t ) p ( t ) d t − μ = ∫ − ∞ + ∞ ( 2 t F ( t ) − 1 ) t p ( t ) d t = ∫ 0 1 ( 2 u − 1 ) F − 1 ( u ) d u . \begin{align*}
G&=\int_{-\infty}^{+\infty}2tF\!\left(t\right)p\!\left(t\right)\mathrm dt-\mu\\
&=\int_{-\infty}^{+\infty}\left(2tF\!\left(t\right)-1\right)tp\!\left(t\right)\mathrm dt\\
&=\int_0^1\left(2u-1\right)F^{-1}\!\left(u\right)\mathrm du.
\end{align*} G = ∫ − ∞ + ∞ 2 tF ( t ) p ( t ) d t − μ = ∫ − ∞ + ∞ ( 2 tF ( t ) − 1 ) tp ( t ) d t = ∫ 0 1 ( 2 u − 1 ) F − 1 ( u ) d u .
Now here is the neat part. Separate it into two parts, and write them in double integrals:
G = ∫ 0 1 u F − 1 ( u ) d u − ∫ 0 1 ( 1 − u ) F − 1 ( u ) d u = ∫ u 2 = 0 1 ∫ u 1 = 0 u 2 F − 1 ( u 2 ) d u 1 d u 2 − ∫ u 1 = 0 1 ∫ u 2 = u 1 1 F − 1 ( u 1 ) d u 1 d u 2 . \begin{align*}
G&=\int_0^1uF^{-1}\!\left(u\right)\mathrm du-\int_0^1\left(1-u\right)F^{-1}\!\left(u\right)\mathrm du\\
&=\int_{u_2=0}^1\int_{u_1=0}^{u_2}F^{-1}\!\left(u_2\right)\mathrm du_1\,\mathrm du_2
-\int_{u_1=0}^1\int_{u_2=u_1}^1F^{-1}\!\left(u_1\right)\mathrm du_1\,\mathrm du_2.
\end{align*} G = ∫ 0 1 u F − 1 ( u ) d u − ∫ 0 1 ( 1 − u ) F − 1 ( u ) d u = ∫ u 2 = 0 1 ∫ u 1 = 0 u 2 F − 1 ( u 2 ) d u 1 d u 2 − ∫ u 1 = 0 1 ∫ u 2 = u 1 1 F − 1 ( u 1 ) d u 1 d u 2 .
Interchange the order of integration of the second term, and we have
G = ∫ u 2 = 0 1 ∫ u 1 = 0 u 2 ( F − 1 ( u 2 ) − F − 1 ( u 1 ) ) d u 1 d u 2 = 1 2 ∫ u 2 = 0 1 ∫ u 1 = 0 1 ∣ F − 1 ( u 2 ) − F − 1 ( u 1 ) ∣ d u 1 d u 2 = 1 2 ∫ − ∞ + ∞ ∫ − ∞ + ∞ ∣ x 2 − x 1 ∣ p ( x 1 ) p ( x 2 ) d x 1 d x 2 = 1 2 E [ ∣ X 2 − X 1 ∣ ] , \begin{align*}
G&=\int_{u_2=0}^1\int_{u_1=0}^{u_2}\left(F^{-1}\!\left(u_2\right)-F^{-1}\!\left(u_1\right)\right)\mathrm du_1\,\mathrm du_2\\
&=\frac12\int_{u_2=0}^1\int_{u_1=0}^1\left|F^{-1}\!\left(u_2\right)-F^{-1}\!\left(u_1\right)\right|\mathrm du_1\,\mathrm du_2\\
&=\frac12\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}\left|x_2-x_1\right|p\!\left(x_1\right)p\!\left(x_2\right)\mathrm dx_1\,\mathrm dx_2\\
&=\frac12\mathrm E\!\left[\left|X_2-X_1\right|\right],
\end{align*} G = ∫ u 2 = 0 1 ∫ u 1 = 0 u 2 ( F − 1 ( u 2 ) − F − 1 ( u 1 ) ) d u 1 d u 2 = 2 1 ∫ u 2 = 0 1 ∫ u 1 = 0 1 F − 1 ( u 2 ) − F − 1 ( u 1 ) d u 1 d u 2 = 2 1 ∫ − ∞ + ∞ ∫ − ∞ + ∞ ∣ x 2 − x 1 ∣ p ( x 1 ) p ( x 2 ) d x 1 d x 2 = 2 1 E [ ∣ X 2 − X 1 ∣ ] ,
where X 1 X_1 X 1 and X 2 X_2 X 2 are two independent random variables with p p p being their respective distribution functions: ( X 1 , X 2 ) ∼ p ( X 1 ) p ( X 2 ) \left(X_1,X_2\right)\sim p\!\left(X_1\right)p\!\left(X_2\right) ( X 1 , X 2 ) ∼ p ( X 1 ) p ( X 2 ) .
By this result, we can easily see how the Gini coefficient represents the statistical dispersion.
We can apply similar tricks to the variance σ X 2 \sigma_X^2 σ X 2 .
σ X 2 = E [ X 2 ] − E [ X ] 2 = ∫ − ∞ + ∞ t 2 p ( t ) d t − ( ∫ − ∞ + ∞ t p ( t ) d t ) 2 = ∫ 0 1 F − 1 ( u ) 2 d u − ( ∫ 0 1 F − 1 ( u ) d u ) 2 . \begin{align*}
\sigma_X^2&=\mathrm E\!\left[X^2\right]-\mathrm E\!\left[X\right]^2\\
&=\int_{-\infty}^{+\infty}t^2p\!\left(t\right)\mathrm dt
-\left(\int_{-\infty}^{+\infty}tp\!\left(t\right)\mathrm dt\right)^2\\
&=\int_0^1F^{-1}\!\left(u\right)^2\,\mathrm du
-\left(\int_0^1F^{-1}\!\left(u\right)\mathrm du\right)^2.
\end{align*} σ X 2 = E [ X 2 ] − E [ X ] 2 = ∫ − ∞ + ∞ t 2 p ( t ) d t − ( ∫ − ∞ + ∞ tp ( t ) d t ) 2 = ∫ 0 1 F − 1 ( u ) 2 d u − ( ∫ 0 1 F − 1 ( u ) d u ) 2 .
Separate the first into two halves, and write the altogether three terms in double integrals:
σ X 2 = 1 2 ∫ 0 1 F − 1 ( u 2 ) 2 d u 2 ∫ 0 1 d u 1 = − ∫ 0 1 F − 1 ( u 1 ) d u 1 ∫ 0 1 F − 1 ( u 2 ) d u 2 = + 1 2 ∫ 0 1 F − 1 ( u 1 ) 2 d u 1 ∫ 0 1 d u 2 = 1 2 ∫ 0 1 ∫ 0 1 ( F − 1 ( u 2 ) 2 − 2 F − 1 ( u 1 ) F − 1 ( u 2 ) + F − 1 ( u 1 ) 2 ) d u 1 d u 2 = 1 2 ∫ − ∞ + ∞ ∫ − ∞ + ∞ ( x 2 − x 1 ) 2 p ( x 1 ) p ( x 2 ) d x 1 d x 2 = 1 2 E [ ( X 2 − X 1 ) 2 ] . \begin{align*}
\sigma_X^2&=\frac12\int_0^1F^{-1}\!\left(u_2\right)^2\,\mathrm du_2\int_0^1\mathrm du_1\\
&\phantom{=~}{}-\int_0^1F^{-1}\!\left(u_1\right)\mathrm du_1\int_0^1F^{-1}\!\left(u_2\right)\mathrm du_2\\
&\phantom{=~}{}+\frac12\int_0^1F^{-1}\!\left(u_1\right)^2\,\mathrm du_1\int_0^1\mathrm du_2\\
&=\frac12\int_0^1\int_0^1
\left(F^{-1}\!\left(u_2\right)^2-2F^{-1}\!\left(u_1\right)F^{-1}\!\left(u_2\right)+F^{-1}\!\left(u_1\right)^2\right)
\mathrm du_1\,\mathrm du_2\\
&=\frac12\int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty}
\left(x_2-x_1\right)^2p\!\left(x_1\right)p\!\left(x_2\right)\mathrm dx_1\,\mathrm dx_2\\
&=\frac12\mathrm E\!\left[\left(X_2-X_1\right)^2\right].
\end{align*} σ X 2 = 2 1 ∫ 0 1 F − 1 ( u 2 ) 2 d u 2 ∫ 0 1 d u 1 = − ∫ 0 1 F − 1 ( u 1 ) d u 1 ∫ 0 1 F − 1 ( u 2 ) d u 2 = + 2 1 ∫ 0 1 F − 1 ( u 1 ) 2 d u 1 ∫ 0 1 d u 2 = 2 1 ∫ 0 1 ∫ 0 1 ( F − 1 ( u 2 ) 2 − 2 F − 1 ( u 1 ) F − 1 ( u 2 ) + F − 1 ( u 1 ) 2 ) d u 1 d u 2 = 2 1 ∫ − ∞ + ∞ ∫ − ∞ + ∞ ( x 2 − x 1 ) 2 p ( x 1 ) p ( x 2 ) d x 1 d x 2 = 2 1 E [ ( X 2 − X 1 ) 2 ] .
Then we can derive the relationship between the Gini coefficient and the variance:
2 σ X 2 − 4 G 2 = σ ∣ X 2 − X 2 ∣ 2 . 2\sigma_X^2-4G^2=\sigma_{\left|X_2-X_2\right|}^2. 2 σ X 2 − 4 G 2 = σ ∣ X 2 − X 2 ∣ 2 .