Skip to main content

correlationMatrix

correlationMatrix is a Python powered library for the statistical analysis and visualization of correlation phenomena. It can be used to analyze any dataset that captures timestamped values (timeseries)

Functionality

You can use correlationMatrix to

  • Estimate correlation matrices from historical timeseries using a variety of models

  • Visualize correlation matrices

  • Manipulate correlation matrices (fix problematic matrices, stress matrices etc)

  • Provide standardized data sets for testing

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

Architecture

  • correlationMatrix supports file input/output in json and csv formats

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

  • supports visualization using matplotlib

Installation

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

Dependencies

  • correlationMatrix requires Python 3

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

  • The Visualization API depends on Matplotlib

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

  • correlationMatrix may work with earlier versions of these packages but this has not been tested.

From PyPi

TODO

pip3 install pandas
pip3 install matplotlib
pip3 install correlationMatrix

From sources

Download the sources to your preferred directory:

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

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 (will also install numpy)

pip3 install pandas
pip3 install matplotlib
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:

correlationMatrix The library source code
model.py Main data structures
utils Helper classes and methods
settings.py Settings
examples Usage examples
datasets Contains a variety of datasets useful for getting started with correlationMatrix
tests Testing suite

Testing

It is a good idea to run the test-suite. Before you get started:

  • Adjust the source directory path in correlationMatrix/__init__ and then issue the following in at the root of the distribution

  • Unzip the data files in the datasets directory

python3 test.py

Getting Started

Check the Usage pages in this documentation

Look at the examples directory for a variety of typical workflows.

For more in depth study, the Open Risk Academy has courses elaborating on the use of the library

Metadata

Release files for correlationMatrix 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for correlationMatrix 0.2.0
File Size Uploaded
correlationMatrix-0.2.0.tar.gz 8.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for correlationMatrix 0.2.0
File Interpreter ABI Platform
correlationMatrix-0.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 16.7 MB

Release files / correlationMatrix-0.2.0.tar.gz

Download URL correlationMatrix-0.2.0.tar.gz
Size 8.3 MB
Tags Source
SHA-256 checksum
How to use checksums
b77bc753eda9bee3cbf73f2735ead50c0a541a267e3b4c89b64392d1e6b683f8
BLAKE2b-256 checksum
How to use checksums
39f8ba2ac70ea7ade713f0dea4c0abe59e38a2922cf1e4114f153cd6144da9f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.8.0 tqdm/4.51.0 CPython/3.6.9

Release files / correlationMatrix-0.2.0-py2.py3-none-any.whl

Download URL correlationMatrix-0.2.0-py2.py3-none-any.whl
Size 8.3 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8f985515e406514dfd9ed5fd03862cac09341f222615e4487761a87fa3d96183
BLAKE2b-256 checksum
How to use checksums
83df672f260a784bbc9373dfdc76578238bd797eadc7eaf8c95590ef03672afd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.8.0 tqdm/4.51.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page