openLGD is a Python powered library for the statistical estimation of Credit Risk Loss (Also loss-given-default or LGD) models.
openLGD can be used both as standalone library or in a federated analysis context where data remain in distinct (separate) servers
- Author: Open Risk
- License: Apache 2.0
- Development website: Github
- Mathematical Documentation of LGD Models: Open Risk Manual
- Discussion: Open Risk Commons
NB: This is an early alpha release. openLGD is still in active development
openLGD aims to support the development of both expert based and statistical LGD Models
In standalone mode openLGD emulates a classic use case where, e.g., a financial institution or other credit provider aims to develop a risk quantification system on the basis of data it has in its possession. Use cases for the standalone mode are both as intended (standalone) LGD model framework system and as a validation framework for federated applications.
The standalone mode is illustrated via the script standalone_run.py
The federated mode essentially facilitates the development of a generic (pooled) LGD model that applies to a wide population (which is assumed homogeneous)
- Clone the repo in a local linux environment
- Install the dependencies in a virtual environment
- Fire up a number of flask servers on different shells. Check the Spawn Cluster Script for how to export the environment. This will fire up several Xterms where server output is logged
- Run the Controller script to perform the demo calculation
Going forward we'll use fabric and yaml to ease deployment. Check Fabfile for preliminary functionality
- The statistical model estimation is currently using scikit-learn / statstmodels components
- The model server is based on the python flask framework.
The complete dependency list in the requirements file
The demo Model Servers are python/flask based servers
- The model servers should start up on ports http://127.0.0.1:500X/ where X is the serial number
- You can check the server is live by pointing your browser to the port
- or by using curl from the console (curl -v http://127.0.0.1:500X/)
The general structure of the simplified API is
- GET http://127.0.0.1:500X/ API Root, indicating the server is live
- GET http://127.0.0.1:500X/start URL to get initial locally estimated parameters (cold start)
- POST http://127.0.0.1:500X/update URL to post current averaged parameters (warm start)