inequality / inequality / inequality-2.0.x

Released by inequality on 2007-07-10 at 16:08.

inequality-2.0.1.lua_and_python.zip10.3 KB
The Lua 5.1 script "inequality-2.0.0" builds on "inequality-1.4.0".
In the new script the display of redundancies ("Theil" and "symmetric")
has been reactivated and the computation of averages for resources
(e.g. income) has been added: Mean, median and welfare functions.

In case of the median also the amount of quantiles is displayed and the
quantile where the median has been found is indicated. If there are only
few quantiles, you decide, wether the median makes sense.

The formulas for the inequalities and redundancies are explained in (The "Platon" inequality is an experiment. will tell you more.
And explains the
"Europe" inequality.)

The "Welfare Function" is computed as W=mean*(1-Z), where Z is an
inequality. Amartya Sen initially took the Gini inequality for Z, James E.
Foster proposed an Atkinson inequality (or Z=1-exp(-R) with Henri Theil's
redundancy R) and I propose the symmetric inequality for Z.

G.Kluge, 2007-07-10

Example: Quantile data set:


Result computed by inequality-2.0.1 for Lua 5.1:
-- Inequalities --
symmetric inequality: 36.6%
Atkinson inequality: 35.4%
Gini inequality: 44.4%
Europe inequality: 61.5%
Hoover inequality: 31.0%
Platon inequality: 45.9%
-- Redundancies --
symmetric redundancy: 0.455
Theil redundancy: 0.437
-- Averages --
27683079 quantile elements
Mean:    2.4586E+00
Median:  1.7024E+00 at #7/18 and #8/18
Welfare: 1.3670E+00 (using Gini)
Welfare: 1.5880E+00 (using Atkinson)
Welfare: 1.5591E+00 (using symm.)

remark: The Platon inequality presently is not displayed,
but the program computes it anyway.

=== Platon inequality ===
*  "Platon" inequality: ZP
*  "Symmetric" redundancy (or distance): SYMR
   *  E[i] is e.g. total income in a quantile[i]
   *  A[i] is e.g. the population in a quantile[i]
   *  sumE = sum(E[i]), e.g. income of a society
   *  sumA = sum(A[i]), e.g. population of a society
   *  i is the index of the quantiles (containing A[i] and E[i])
      in a set of quantiles which e.g. describes the resource
      distribution in a society.
   *  SYMR = sum(ln(sumE/sumA)*(E[i]/sumE-A[i]/sumA)/2
*  "Symmetric" inequality: SYMI = 1 - exp(-SYMR)
*  "Pareto" equality: q
*  ZP and SYMR are relative inequalities between 0 and 1
*  q is a relative equality between 0 and 0.5
*  As q is between 0 and 0.5 and indicates equality, the transformation
   ZP = 1 - 2*q is between 0 and 1 and indicates inequality.
*  SYMR is a redundancy >= 0
   (redundancy = max.entropy - entropy)
*  pi = 3.1415....
Definition of Platon inequality:
*  SYMI = 1 - (2/(ZP+1)-1)^(ZP).
Approximation (error < 0.002 below ZP=0.78) yields inverse function:
*  ZP = 1 - arcsin((1-SYMI)^(SYMI*0.06+0.61))*2/pi
   (The program reduces the error to <0.00001)
Meaning (if q = (1-ZP)/2 with q between 0 and 0.5):
*  A society in which
     a share of q people hold a share of 1-q of the resources and
     a share of 1-q people hold a share of q of the resources
   is entropywise equivalent to a society with
   SYMI = 1 - (1/q-1)^(2*q-1).

Changes: === 2.0.0 === In the new script the display of redundancies ("Theil" and "symmetric") has been reactivated and the computation of averages for recources (e.g. income) has been added: Mean, median and welfare functions. === 2.0.1 === - Python script added to Lua script (core of - Display of Median improved - Coulter not displayed anymore - Avoidance of numeric computation errors on some platforms - inequalities.html (small calculus) added to zip archive