Skip to content

Rakeshks7/RMT-Portfolio-Optimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random Matrix Theory (RMT) for Portfolio Optimization

Python License Status

The Problem: Correlation Noise

In modern portfolio optimization, the standard correlation matrix is full of noise. When optimizing a portfolio of 100+ assets, Markowitz Mean-Variance Optimization often mistakes random coincidences for true economic relationships. This leads to unstable portfolios that perform poorly out-of-sample (maximization of error).

The Solution: Physics + Machine Learning

This project implements a "Theoretical Quant" pipeline that cleans the input data using Random Matrix Theory (Physics) and allocates capital using Hierarchical Risk Parity (Machine Learning).

Core Methodologies:

  1. Marchenko-Pastur Distribution: Fits a theoretical probability density function to the eigenvalues of the correlation matrix.
  2. Eigenvalue Clipping: Identifies eigenvalues that fall within the "Noise Band" and replaces them with a constant average, preserving only true signals (Market Mode + Sector Clusters).
  3. Hierarchical Risk Parity (HRP): Uses clustering (linkage) to group assets and allocate risk recursively, avoiding the instability of matrix inversion.

Key Results

In a high-noise synthetic environment ($N=150, T=1200$), the "God Tier" strategy (RMT Denoising + HRP) consistently outperforms standard baselines:

Strategy OOS Sharpe Ratio
RMT + HRP (Proposed) 1.842
Standard HRP 1.650
RMT + Markowitz 1.420
Standard Markowitz 1.105

> Improvement over baseline: ~66%

Visualizations

  1. Eigenvalue Spectrum (Signal vs. Noise) The histogram represents empirical eigenvalues. The Red Curve is the theoretical noise limit. Everything to the left is noise.

  2. Asset Clustering (HRP) Dendrogram showing how the algorithm groups assets into economic clusters.

Disclaimer

This project is for educational and research purposes only. Nothing herein constitutes financial advice or a recommendation to buy or sell any security.

About

A quantitative finance engine that uses Random Matrix Theory (Marchenko-Pastur) to denoise correlation matrices and Hierarchical Risk Parity (HRP) for robust portfolio allocation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages