rollinggroupcorrelation

A function that calculates the rolling window mean multi correlation between all columns of a Pandas DataFrame.


Keywords
correlation, multi, rolling, group, mean
License
AGPL-3.0
Install
pip install rollinggroupcorrelation==0.4

Documentation

RollingGroupCorrelation

General Information

This is a library that calculates the rolling group correlation for a set of time series. I got the idea for this kind of statistical measurement a couple of months ago but could not find anything similar in academic papers or forums (please let me know if this or something similar already exists). This tool has really added value for me when modeling portfolio risk. It has also increased the accuracy of some of my ML models when used for feature engineering.

Installation

pip install RollingGroupCorrelation

Example

The image below plots the rolling group correlation of a set of financial instruments (stocks, crypto, commodities and bonds) over 2019 and 2020. Check out Example.ipynb for the full example. alt text