Gini Coefficient

\begin{document}
	\begin{tikzpicture}[scale=6]
	  % Draw axes
	  \draw[->] (0,0) -- (1.1,0) node[right] {Cumulative \% of Population};
	  \draw[->] (0,0) -- (0,1.1) node[above] {Cumulative \% of Wealth};
	  
	  % Draw grid
	  \foreach \x in {0,0.2,0.4,0.6,0.8,1.0}
	    \draw[gray!30, very thin] (\x,0) -- (\x,1);
	  \foreach \y in {0,0.2,0.4,0.6,0.8,1.0}
	    \draw[gray!30, very thin] (0,\y) -- (1,\y);
	  
	  % Axis tick labels
	  \foreach \x in {0,20,40,60,80,100}
	    \node[below] at (\x/100,-0.02) {\tiny \x};
	  \foreach \y in {0,20,40,60,80,100}
	    \node[left] at (-0.02,\y/100) {\tiny \y};
	  
	  % Line of Perfect Equality (diagonal)
	  \draw[blue, thick, dashed] (0,0) -- (1,1) node[above right, pos=0.8] {\small Perfect Equality};
	  
	  % Lorenz Curve showing inequality
	  % Using a smooth curve that bows below the diagonal
	  \draw[red, thick] (0,0) 
	    .. controls (0.2,0.05) and (0.4,0.15) .. (0.5,0.25)
	    .. controls (0.6,0.35) and (0.7,0.50) .. (0.8,0.65)
	    .. controls (0.9,0.82) .. (1,1);
	  
	  % Label for Lorenz Curve
	  \node[red] at (0.65,0.35) {\small Inequality};
	  \node[red] at (0.65,0.31) {\small (Lorenz Curve)};
	  
	  % Shaded area between curves (representing inequality)
	  \fill[red!10, opacity=0.5] (0,0) 
	    .. controls (0.2,0.05) and (0.4,0.15) .. (0.5,0.25)
	    .. controls (0.6,0.35) and (0.7,0.50) .. (0.8,0.65)
	    .. controls (0.9,0.82) .. (1,1)
	    -- (0,0);
	  \fill[blue!10, opacity=0.3] (0,0) -- (1,1) -- (1,0) -- cycle;
	  
	  % Origin label
	  \node[below left] at (0,0) {0};
	  
	  % Data points for perfect equality
	  \foreach \p in {0,10,20,30,40,50,60,70,80,90,100}
	    \fill[blue] (\p/100,\p/100) circle (0.01);
	    
	\end{tikzpicture}
\end{document}

Discrete

\text{Population %} & & \text{Income %} & \
\text{Cumulative} & \text{Margin} & \text{Cumulative} & \text{Margin} \
0 & - & 0 & - \
20 & 20 & 10 & 10 \
50 & 30 & 31 & 21 \
60 & 10 & 40 & 9 \
100 & 400 & 100 & 6
\end

- Graph the Lorenz Curve ```tikz \begin{document} \begin{tikzpicture}[scale=0.7, every node/.style={font=\small}] % Draw a light gray grid for readability \draw[step=1, gray!30, thin] (0,0) grid (10,10); % Draw the axes \draw[thick, ->] (0,0) -- (11,0) node[below right] {Cumulative Population (\%)}; \draw[thick, ->] (0,0) -- (0,11) node[above left, rotate=90] {Cumulative Income (\%)}; % Draw the Line of Equality (Perfect Equality) \draw[dashed, thick, gray] (0,0) -- (10,10) node[midway, above left, rotate=45, color=black] {Line of Equality}; % Plot the Lorenz Curve based on cumulative data \draw[ultra thick, blue!80!black, mark=*] plot coordinates { (0,0) (2,1) (5,3.1) (6,4) (10,10) }; % Add labels for specific data points to clarify the curve \filldraw[blue!80!black] (2,1) circle (2pt); \filldraw[blue!80!black] (5,3.1) circle (2pt); \filldraw[blue!80!black] (6,4) circle (2pt); \filldraw[blue!80!black] (10,10) circle (2pt); % X-axis labels \foreach \x in {0, 20, 40, 60, 80, 100} \node at (\x/10, -0.5) {\x}; % Y-axis labels \foreach \y in {0, 20, 40, 60, 80, 100} \node at (-0.7, \y/10) {\y}; % Title \node[draw, fill=white, thick] at (5, -2) {Lorenz Curve: Visualisation of Income Distribution}; % Curve label \node[color=blue!80!black] at (7, 3) {Lorenz Curve}; \end{tikzpicture} \end{document} ``` - Area: $(0.2-0)(0.1+0)+(0.5-0.2)(0.41)+(0.10)(0.71)+(0.40)(1.4) = 0.774$ - $\text{Base}\times\text{Midpoint Height}$ - $1-0.774 = 0.226$ ## Continuous - $x=p$ and $y=w$ - $w=p^{2}$ ```tikz \begin{document} \begin{tikzpicture}[scale=5, every node/.style={font=\small}] % Define coordinates \coordinate (O) at (0,0); \coordinate (A_top) at (1,1); \coordinate (B_bottom) at (1,0); % Fill Area B (under the curve) \fill[color=gray!20] (0,0) -- plot[domain=0:1, samples=100] (\x, {\x*\x}) -- (1,0) -- cycle; % Fill Area A (between diagonal and curve) \fill[color=gray!40] (0,0) -- (1,1) -- plot[domain=1:0, samples=100] (\x, {\x*\x}) -- cycle; % Draw the axes \draw[->, thick] (-0.1,0) -- (1.2,0) node[right] {$p$}; \draw[->, thick] (0,-0.1) -- (0,1.2) node[above] {$w$}; % Draw the Line of Perfect Equality (w = p) \draw[thick, dashed] (0,0) -- (1,1) node[midway, above left, rotate=45] {$w = p$}; % Draw the Lorenz Curve (w = p^2) \draw[blue, thick, domain=0:1, samples=100] plot (\x, {\x*\x}); \node[blue, right] at (0.8, 0.5) {$w = p^2$}; % Labels for Area A and B \node at (0.5, 0.35) {\textbf{A}}; \node at (0.65, 0.15) {\textbf{B}}; % Draw the unit square border \draw (1,0) -- (1,1) -- (0,1); \node[below] at (1,0) {$1$}; \node[left] at (0,1) {$1$}; \end{tikzpicture} \end{document} ``` - $\text{Gini}= \frac{A}{A+B}=\frac{A}{\frac{1}{2}}=2A$ - $A=\frac{1}{2}-B$ - $2A=1-2B$ - $\text{Gini}=1-2\int_{0}^{1} p^{2} \, \differential p$ - $\int_{0}^{1} p^{2} \, \differential p=\left[ \frac{1}{3}p^{3} \right]{_{0}^{1}}=\frac{1}{3}$ - $\text{Gini}=1-\frac{2}{3} = \frac{1}{3}$ -