# Lorenz Curve for Insurance Pure Premium

I'm testing various pure premium models and want to make a Lorenz curve to compare the models. The goal is to show underwriters which models are better. I'm not sure if I'm doing it correctly.

I'm using my baseline as the 45 degree line. The y axis is percentage of actual cumulative pure premium ordered by my predicted pure premium and the x axis is percentage of cumulative exposure ordered by my predicted pure premium

The code looks like this

o <- with(glm.predictions, order(glm.predict))
x <- with(testData, cumsum(Exposure[o]) / sum(TIV_Pol_TermITV[o]))