Skip to main content

A Python powered library for statistical analysis and visualization of state transition phenomena

Project description

The transitionMatrix Library

../../examples/overview.png

transitionMatrix is a pure Python powered library for the statistical analysis and visualization of state transition phenomena. It can be used to analyze any dataset that captures timestamped transitions in a discrete state space.

Functionality

You can use transitionMatrix to:

  • Estimate transition matrices from historical event data using a variety of estimators

  • Characterise transition matrices (identify their key properties)

  • Visualize event data and transition matrices

  • Manipulate transition matrices (derive generators, perform comparisons, stress transition rates etc.)

  • Access standardized Datasets for testing

  • Extract and work with credit default curves (absorbing states)

  • Map credit ratings using mapping tables

  • More (still to be documented :-)

Architecture

  • transitionMatrix provides intuitive objects for handling transition matrices individually and as sets (based on numpy arrays)

  • supports file input/output in json and csv formats

  • it has a powerful API for handling event data (based on pandas and numpy)

  • supports visualization using matplotlib

Installation

You can install and use the transitionMatrix package in any system that supports the Scipy ecosystem of tools

Dependencies

  • TransitionMatrix requires Python 3 (currently 3.7)

  • It depends on numerical and data processing Python libraries (Numpy, Scipy, Pandas).

  • The Visualization API depends on Matplotlib.

  • The precise dependencies are listed in the requirements.txt file.

  • TransitionMatrix may work with earlier versions of python / these packages but it is not tested.

From PyPI

pip3 install transitionMatrix

From sources

Download the sources in your preferred directory:

git clone https://github.com/open-risk/transitionMatrix

Using virtualenv

It is advisable to install the package in a virtualenv so as not to interfere with your system’s python distribution

virtualenv -p python3 tm_test
source tm_test/bin/activate

If you do not have pandas already installed make sure you install it first (this will also install numpy and other required dependencies).

pip3 install -r requirements.txt

Finally issue the install command and you are ready to go!

python3 setup.py install

File structure

The distribution has the following structure:

| transitionMatrix/     Directory with the library source code
| -- model.py           File with main data structures
| -- estimators/        Directory with the estimator methods
| -- statespaces/       Directory with state space objects and methods
| -- creditratings/     Directory with predefined credit rating structures
| -- generators/        Directory with data generator methods
| -- utils/             Directory with helper classes and methods
| -- examples/          Directory with usage examples
| ---- python/          Examples as standalone python scripts
| ---- notebooks/       Examples as jupyter notebooks
| -- datasets/          Directory with a variety of datasets useful for getting started
| -- tests/             Directory with the testing suite

Other similar open source software

  • etm, an R package for estimating empirical transition matrices

  • msSurv, an R Package for Nonparametric Estimation of Multistate Models

  • msm, Multi-state modelling with R

  • mstate, competing risks and multistate models in R

  • lifelines, python survival package

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

transitionMatrix-0.5.1.tar.gz (5.1 MB view details)

Uploaded Source

Built Distribution

transitionMatrix-0.5.1-py2.py3-none-any.whl (4.2 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file transitionMatrix-0.5.1.tar.gz.

File metadata

  • Download URL: transitionMatrix-0.5.1.tar.gz
  • Upload date:
  • Size: 5.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.5

File hashes

Hashes for transitionMatrix-0.5.1.tar.gz
Algorithm Hash digest
SHA256 8aa438f21db23f49b6c3b7d957151dba43b626a9b847858b4099654904d6ad6d
MD5 249d73cc44c5135899b368ac8cbf3c08
BLAKE2b-256 4c7e9dd31942415b9dda7540a009daadf2dfb35598f448698f09d71aa65dc7e9

See more details on using hashes here.

File details

Details for the file transitionMatrix-0.5.1-py2.py3-none-any.whl.

File metadata

  • Download URL: transitionMatrix-0.5.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.2 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.5

File hashes

Hashes for transitionMatrix-0.5.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b33465328f0b1400a3cb3d4334b069433930a9c99faf90e8b20b718beb9fd775
MD5 3ada3be52129516107bb721fa2e69180
BLAKE2b-256 e3ae748b24328266a66d2a6c407c5d7d06cc8003eea588b5be4d2c778104e5cf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page