Code covered by the BSD License  

Highlights from
Inequality Package

5.0

5.0 | 1 rating Rate this file 38 Downloads (last 30 days) File Size: 7.57 KB File ID: #19968
image thumbnail

Inequality Package

by

 

18 May 2008 (Updated )

Inequality Metrics: Gini Coefficient associated to the Lorenz Curve, Theil and Atkinson indexes

| Watch this File

File Information
Description

Package on Inequality Metrics: the Gini Coefficient associated to the Lorenz Curve, the Theil and the Atkinson indexes.

For more references:
http://en.wikipedia.org/wiki/Lorenz_curve
http://en.wikipedia.org/wiki/Gini_coefficient
http://en.wikipedia.org/wiki/Theil_index
http://en.wikipedia.org/wiki/Atkinson_index

***************************

Note that contributions #15376 and #28080 DO NOT return the correct Gini coefficient, while #26452 does not apply to populations but only to individuals.

***************************

The zip file contains:
ginicoeff.m
lorenzcurve.m
theilt.m
theill.m
atkinsonineq.m

***************************

% Example for ginicoeff.m:
N = 1000;
p = rand(N, 1); w = rand(N, 1);
y = ginicoeff(p, w)

% ***************************

% Example for lorenzcurve.m:
N = 1000;
p = rand(N, 1);
w = exp(randn(N, 1));
h = lorenzcurve(p, w);

% ***************************

% Example for theilt.m:
N = 1000;
w = rand(N, 1);
y = theilt(w)

% ***************************

% Example for theill.m:
N = 1000;
w = rand(N, 1);
y = theill(w)

% ***************************

% Example for atkinsonineq.m:
N = 1000;
w = rand(N, 1);
epsilon = rand;
y = atkinsonineq(w, epsilon)

Acknowledgements

Gini Coefficient Population Weighted inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
06 Jun 2012 Francesco Pozzi

@Martin, thank you for your comment but check it again: the Gini coefficient of your example IS NOT zero but some random number.

@Robert, thank you for your comment - I would use random data or the GDP and Population of a selection of countries.

16 May 2012 Robert Root

Excited to find this package. I'd like to use it in my courses. Where can I find actual data in the format this package accepts?

30 Aug 2011 martin

I want ask a question, why I set p=rand(100,1); w=p, and the GiniCoeff(p,w) is not o. Theoratically, the answer should be zero!

30 Aug 2011 martin

very good, Thank you!

Updates
08 Feb 2009

I have made two major corrections to the functions GiniCoeff and plotLorenzCurve

18 Sep 2012

All functions have been entirely re-written.

Contact us