2

So I have some trouble concerning Lorenz-curves and PSTricks. I've extended the example in pst-func to a MWE:

 \documentclass[12pt]{scrartcl}
 \usepackage[latex={-interaction=nonstopmode -shell-escape},%
 pspdf={-dALLOWPSTRANSPARENCY},%
 pdfcrop={--hires},crop=on]{auto-pst-pdf}

 \usepackage{pst-func}

 \begin{document}
 \centerline{%
 \begin{postscript}
 \psset{lly=-6mm,llx=-5mm} 
 \psgraph[Dx=0.2,Dy=0.2,axesstyle=frame](0,0)(1,1){6cm}{6cm} 
 \psline[linestyle=dashed](1,1) 
 \psLorenz*[linecolor=blue!30,linewidth=1.5pt]{0.50 0.10 0.3 0.09 0.01 } 
 \psLorenz[linecolor=blue!30,plotstyle=bezier]{0.50 0.10 0.3 0.09 0.01 } 
 \psLorenz[linecolor=red,linewidth=1.5pt]{0.50 0.10 0.3 0.09 0.01 } 
 \endpsgraph
 \end{postscript}}

 \centerline{%
 \begin{postscript}
 \psset{lly=-6mm,llx=-5mm} 
 \psgraph[Dx=0.2,Dy=0.2,axesstyle=frame](0,0)(1,1){6cm}{6cm} 
 \psline[linestyle=dashed](1,1) 
 \psLorenz*[linecolor=blue!30,linewidth=1.5pt]{1 1 1 1 1 } 
 \psLorenz[linecolor=red,linewidth=1.5pt]{1 1 1 1 1 } 
 \endpsgraph
 \end{postscript}}
 \end{document}

The second Lorenz-curve is actually the from (0,0) to (1,1).

enter image description here

The ordered x-data are 0.01, 0.09, 0.1, 0.3, 0.5, hence the distribution is 0.01, 0.1, 0.2, 0.5, 1.0. So shouldn't the Lorenz-curve be the polygon through

(0,0), (0.2,0.01), (0.4,0.1), (0.6, 0.2), (0.8,0.5), and (1,1)?

2
  • It would be much easier to try to answer this if you would add a full minimal working example and not just a fragment of a TeX document. Oct 28, 2021 at 17:02
  • Yes, that looks buggy, I'll have alook. However, it may be a good idea if you could try your own code first with a full example ...
    – user187802
    Oct 28, 2021 at 18:00

1 Answer 1

4

This is the output for the fixed version of pst-func which will be uploaded to CTAN later:

enter image description here

12
  • Excellent! That was fast, thank you very much. Oct 29, 2021 at 15:19
  • There's still a bug: \psLorenz[Gini,linecolor=red,linewidth=1.5pt]<.2 .2 .2 .2 .2>{.1 .1 .1 .35 .35 } reports correctly 0.3 as Gini-coefficient. In case you omit the x-data \psLorenz[Gini,linecolor=red,linewidth=1.5pt{.1 .1 .1 .35 .35 } the coefficient becomes -1.85, which is absurd. Oct 30, 2021 at 11:50
  • I see, used wrong variable. Will be fixed ...
    – user187802
    Oct 30, 2021 at 13:59
  • and uploaded to CTAN ...
    – user187802
    Oct 31, 2021 at 10:10
  • Thanks a lot again! Oct 31, 2021 at 10:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .