Giter Site home page Giter Site logo

open-risk / concentrationmetrics Goto Github PK

View Code? Open in Web Editor NEW
40.0 4.0 15.0 696 KB

A python library for the computation of various concentration, inequality and diversity indices

Home Page: https://www.openriskmanual.org/wiki/Concentration_Index

License: MIT License

Python 94.48% Makefile 0.36% R 4.79% Shell 0.38%
concentration inequality python diversity index shannon hacktoberfest

concentrationmetrics's Introduction

Documentation Status

Intro

concentrationMetrics is a python library for the computation of various concentration, diversification and inequality indices. The library implements the computation of all well known indexes of inequality and concentration.

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

NB: concentrationMetrics is still in active development. If you encounter issues please raise them in our github repository

Full Description

List of Implemented Indexes

An overview of the implemented metrics (indexes) and their relationships is available at the Open Risk Manual

The below list provides more specific documentation URL's for each one of the implement indexes:

Support and Training

The Open Risk Academy has free courses demonstrating the use of the library: Open Risk Academy

Examples

Comparing two indexes across a range of input portfolio data

image

Calculating industrial and geographic concentrations

image

Contributions

  • Check the TODO list for immediate TODO items
  • Check the Roadmap for the bigger picture

concentrationmetrics's People

Contributors

dependabot[bot] avatar michael-e-rose avatar open-risk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

concentrationmetrics's Issues

Error instead of termination

If input criteria are not of the expected form (such as that the input is not a numpy array), the object throws a message and then terminates the execution. Neither is standard or desirable. Instead, the object should throw an exception (probably AttributeError) and nothing else.

Document installation

This looks like a fine library! I think it can help me a lot.

Alas, I don't know how to get it. Your documentation doesn't state how to get it, it just starts with import concentrationMetrics as cl. But neither concentrationMetrics nor concentrationmetrics (package names should be all lower-case as per PEP8!) exist on PyPI. If you want users to download a script you should tell them.

Gini formula looks wrong (but works)

Looking for the formula here http://www.openriskmanual.org/wiki/Gini_Index

image

It seem that this code is wrong (but it works perfectly)

(1.0 - 2.0 * np.multiply(i, weights).sum())/n + 1.0

I think the right code would be:

(2.0 * np.multiply(i/n, weights).sum()) - (n - 1.0)/n

or following the other formula

image

(n + 1.0)/n - (2.0 * np.multiply((n + 1 - i)/n, weights).sum())

Those two codes that match the formulas have a problem, they get the results as negative numbers

.

.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.