Visualizing Inequalities in a 3-Person Economy

Yesterday, in the course on inequalities, I mentioned (too) briefly the 3-person Economy. I wanted to spend some time in a short post on visualisations of inequalities in such a context. As mentioned in the slides,  it is possible to use a ternary plot representation. In the case where we believe that the scale independence principle makes sense, i.e.\lambda\boldsymbol{x})=I(\boldsymbol{x}). A distribution of incomes can be represented as a barycenter in an equilateral triangle (also called de Finetti diagram). The midpoint is the equal situation: the three agents share the same wealth. Because of the scale independence property, we can look at distribution of wealth on the simplex. A wealth distribution is a vector\boldsymbol{\omega}=(\omega_A,\omega_B,\omega_C) where each component is one of the (red) distance below. A is on top of the triangle, and the vertical distance is proportional to the wealth of A. The closer to the bottom line, the poorer A is.

To visualize this distribution of wealth, we can use the trifield package. To add the point and the three segments, the code is

  C <- abc2xy(matrix(p,1,3))
  C1 <- abc2xy(matrix(p1,1,3))
  C2 <- abc2xy(matrix(p2,1,3))
  C3 <- abc2xy(matrix(p3,1,3))

For instance, to visualize the equal case (inequality indices are defined as a distance to this situation)


For a case where there is inequality, use for instance


We’ve seen in the course that there was a natural ordering, based on Lorenz curve. In the case of a 3-person economy, Lorenz curve is juste based on 2 points,


An income distribution\boldsymbol{x} is more unequal than distribution\boldsymbol{y} if{%20\boldsymbol{x}}(u)%20\leq%20L_{%20\boldsymbol{y}}(u) for all\in[0,1]. What it means is simply that\frac{x_1}{x_1+x_2+x_3}%20\leq%20\frac{y_1}{y_1+y_2+y_3}

and at the same time\frac{x_1+x_2}{x_1+x_2+x_3}%20\leq%20\frac{y_1+y_2}{y_1+y_2+y_3}

For instance, for this distribution of wealth

we have non-ambuigity about the ordering : this new distribution is more unequal

Because it is simple to compare we can use a simple function to compare two distributions

  if(sum(ss1>ss2)==2) dom=1 
  if(sum(ss1<ss2)==2) dom=-1 

where +1 means more unequal, -1 means less unequal, and 0 means that it is an ambiguous situation, and curves cannot be compared (there is a single crossing here).

Thus, given a reference distribution, it would be nice to visualize all distributions that are more unequal and less unequal. The first step is to get a grid

grid.size = 128
tg = ternary.grid(grid.size)

Then , define function

f = function(x) lorenz_dominance(x,c(1,2,3))

which compares all points with our reference.  Then we use some sort of ‘apply’ function, to compute that function on all points of the grid

z = ternary.apply(tg, f)

and then we simply plot the contour plot of that output

tf = ternary.field(tg, z)

I can add the reference point on the map


The output is nice, isn’t? The code here is natural, based on what I would do on a standard cartesian representation… But the output is not valid. And I could not find why… To check, let us draw randomly some incomes, and then plot them

for(s in 1:50000){
 x=rexp(3); x=x/sum(x)

The output is rather different…  If my reference is (20,10,1)

for(s in 1:50000){
  x=rexp(3); x=x/sum(x)

which is comparable with a graph one can find is some slides of Economics 1391 (but no reference is mentioned)

I still don’t undertand what went wrong with the initial code…

Actually, we can visualize almost anything, like iso-curves for Gini index. Again, using simulations, I get

for(s in 1:50000){
 x=rexp(3); x=x/sum(x); g=Gini(x)

But this time, if I use functions of the trifield package, it seems to be fine (and consistent with graph one can find in various papers, e.g. in  some slides of Economics 1391)

f = function(x) Gini(x)
z = ternary.apply(tg, f)
tf = ternary.field(tg, z)

And we can visualize iso-inequality curves for any inequality index, for instance Theil index

f = function(x) Theil(x)
z = ternary.apply(tg, f)
tf = ternary.field(tg, z)

or the generalized entropy,

f = function(x) entropy(x,2)
z = ternary.apply(tg, f)
tf = ternary.field(tg, z)

That sounds promising, and I believe nice visualizations can be obtained in that 3-person economy, but I still have to understand why the Lorenz-comparison graph did not work…

Leave a Reply

Your email address will not be published. Required fields are marked *