https://github.com/open-risk/concentrationmetrics
A python library for the computation of various concentration, inequality and diversity indices
https://github.com/open-risk/concentrationmetrics
concentration concentration-index diversity-measurement gini-index inequality python shannon
Last synced: 4 months ago
JSON representation
A python library for the computation of various concentration, inequality and diversity indices
- Host: GitHub
- URL: https://github.com/open-risk/concentrationmetrics
- Owner: open-risk
- License: mit
- Created: 2015-03-26T22:10:12.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2025-01-30T21:25:32.000Z (over 1 year ago)
- Last Synced: 2025-08-31T06:43:32.551Z (10 months ago)
- Topics: concentration, concentration-index, diversity-measurement, gini-index, inequality, python, shannon
- Language: Python
- Homepage: https://www.openriskmanual.org/wiki/Concentration_Index
- Size: 765 KB
- Stars: 44
- Watchers: 3
- Forks: 16
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://concentrationMetrics.readthedocs.io/en/latest/?badge=latest)

[](https://github.com/Naereen/StrapDown.js/blob/master/LICENSE)
[](http://isitmaintained.com/project/Naereen/badges "Percentage of issues still open")
Intro
==========================
concentrationMetrics is a python library for the computation of various concentration, diversification and inequality indices. The library aims to implement the computation of all well known indexes of inequality and concentration along with confidence intervals.
You can use concentrationMetrics to:
- Access an exhaustive collection of concentration, inequality and diversity indexes and metrics
- Perform file input/output in both json and csv formats
- Compute indexes with confidence intervals via bootstraping
- Visualize using matplotlib
Key Information
================
* Author: [Open Risk]()
* License: MIT
* Mathematical Documentation: [Open Risk Manual]()
* Code Documentation: [Read The Docs](https://concentrationmetrics.readthedocs.io/en/latest/index.html)
* Development website: [Github](https://github.com/open-risk/concentrationMetrics)
* Discussions: [Open Risk Commons](https://www.openriskcommons.org/c/open-source/concentrationmetrics/17)
**NB: concentrationMetrics is still in active development. If you encounter issues please raise them in our GitHub repository**
List of Implemented Indexes
===============================
An overview of the implemented metrics (indexes) and their relationships is available at the [Open Risk Manual](https://www.openriskmanual.org/wiki/Concentration_Index)
The below list provides more specific documentation URL's for each one of the implement indexes:
* [Atkinson Index](https://www.openriskmanual.org/wiki/Atkinson_Index)
* [Berger-Parker Index](https://www.openriskmanual.org/wiki/Berger-Parker_Index)
* [Concentration Ratio](https://www.openriskmanual.org/wiki/Concentration_Ratio)
* [Ellison-Glaeser Index](https://www.openriskmanual.org/wiki/Ellison-Glaeser_Index)
* [Gini Index](https://www.openriskmanual.org/wiki/Gini_Index)
* [Theil Index](https://www.openriskmanual.org/wiki/Theil_Index)
* [Hannah-Kay Index](https://www.openriskmanual.org/wiki/Hannah_Kay_Index)
* [Hoover Index](https://www.openriskmanual.org/wiki/Hoover_Index)
* [Herfindahl-Hirschman Index](https://www.openriskmanual.org/wiki/Herfindahl-Hirschman_Index) and related indexes such as Simpson and Inverse Simpson
* [Shannon Index](https://www.openriskmanual.org/wiki/Shannon_Index)
* [Generalized Entropy Index (Renyi)](https://www.openriskmanual.org/wiki/Generalized_Entropy_Index)
* [Kolm Index](https://www.openriskmanual.org/wiki/Kolm_Index)
Support and Training
=========================
The Open Risk Academy has free courses demonstrating the use of the library: [Open Risk Academy](https://www.openriskacademy.com)
Examples
========
Comparing two indexes across a range of input portfolio data

Calculating industrial and geographic concentrations

Contributions
=============
* Check the [TODO list](docs/source/todo.rst) for immediate TODO items
* Check the [Roadmap](docs/source/roadmap.rst) for the bigger picture