# Additional thoughts about ‘Lorenz curves’ to compare models

A few month ago, I did mention a graph, of some so-called Lorenz curves to compare regression models, see e.g. Progressive’s slides (thanks Guillaume for the reference)

The idea is simple. Consider some model for the pure premium (in insurance, it is the quantity that we like to model), i.e. the conditional expected valeur

$m(\boldsymbol{x})=\mathbb{E}[Y\vert \boldsymbol{X}=\boldsymbol{x}]$

On some dataset, we have our predictions,$\widehat{y}_i=m(\boldsymbol{x}_i)$ as well as observed quantities, $y_i$. The curve are obtained simply :

• sort the observations so that

$\widehat{y}_1\geq \widehat{y}_2 \geq \cdots \geq \widehat{y}_i \geq \cdots\geq \widehat{y}_n$

• based on that ordering (from high risks to low risks, based on our predictions), we plot Lorenz curve

$\left(\frac{i}{n},\frac{\displaystyle\sum_{k=1}^i y_k}{\displaystyle\sum_{k=1}^n y_k}\right)$

# “Improving Segmentation” (using Lorenz curves, or sort of)

This afternoon, André did send me an interesting graph about the use of Lorenz curve in the context of insurance pricing (and modeling)

It is some sort of Lorenz curve, upside-down, with on the x-axis the proportion of the population, and on the y-axis the proportion of the losses. The important point is that the population is sorted according the their risk, i.e. their premium. The code to generate such a curve is actually quite simple,

L <- function(u,varx="premium",vary="losses"){
base=base[order(base[,varx],decreasing=TRUE),]
base$cum=(1:nrow(base))/nrow(base) return(sum(base[base$cum<=u,vary])/
sum(base[,vary]))}

vu=seq(0,1,by=.01)
vv=Vectorize(function(u) L(u))(vu)

My concern was more on two labels on the figure, with on the top-left “perfect pricing” and on the first diagonal “average pricing“. What could that possibly mean? Is there even such a thing as a “perfect pricing“? In order to understand what we plot here, let us generate some dataset, and fit some model. Including things that might be seen as the “perfect model“: the price base on the parameters used to generate the data, and the model used to generate the data, fitted on the data.

# Inequalities, course 3

Tomorrow, we will discuss inequality indices, from a statistical perspective, and also an axiomatic point of view. In order to illustrate, we will use to following dataset,

> income <- read.csv("http://www.vcharite.univ-mrs.fr/pp/lubrano/cours/fes96.csv",sep=";",header=FALSE)\$V1

Slides can be found online. Since it is the first year I give this course, all comments are welcome…

# Modeling Incomes and Inequalities

Last week, in our Inequality course, we’ve been looking at data. We started with some simulated data, only a few of them

> library("ineq")
> (income=sort(income))
[1]  19233  23707  53297  61667 218662

How could we say that there is inequality in this sample? If we look at the wealth owned by the poorest, the poorest person (1 out of 5) owns 5% of the wealth; the bottom two (2 out of 5) own 11%, etc

> income[1]/sum(income)
[1] 0.05107471
> sum(income[1:2])/sum(income)
[1] 0.1140305
> sum(income[1:3])/sum(income)
[1] 0.2555648
> sum(income[1:4])/sum(income)
[1] 0.4193262

If we plot those values, we get Lorenz curve

> plot(Lc(income))
> points(c(0:5)/5,c(0,cumsum(income)/sum(income)),pch=19,col="blue")


# Welfare, Inequality and Poverty

This week, we will start the crash course on Welfare, Inequality and Poverty. I will upload the slides soon. Reference for the course are the following,

See also Emmanuel Flachaire’s ECON-473 webpage, as well as Michel Lubrano’s notes. In the introductionary course, I will also mention Le Monde, 2012 (on poverty), with the pdf. An interesting video is based on Norton & Ariely, 2011