nkremerh / sugarscape

Development repository for the Digital Terraria Lab implementation of the Sugarscape agent-based societal simulation.
https://github.com/digital-terraria-lab/sugarscape
MIT License
7 stars 11 forks source link

Fixes negative Gini coefficient for smaller populations #104

Closed colinhanrahan closed 1 month ago

colinhanrahan commented 1 month ago

The current Gini coefficient is inaccurate for smaller populations—the rectangular area of the wealthiest agent can spill over the equality line and result in a negative ratio. Using trapezoidal area instead ensures that the Lorenz curve area is more accurate and always stays under the equality line.