scikit-rmt: Random Matrix Theory in Python
Citation. Alejandro Santorum Varela. scikit-rmt, a Python package for random matrix theory. GitHub: AlejandroSantorum/scikit-rmt, version 2.2.3, released on 19 November 2026, BSD 3-Clause licence. The documentation is on Read the Docs. The README says the package began as a computer science degree project at the Autonomous University of Madrid. It asks users to cite the GitHub repository (Santorum, 2021). It names no paper about the package. The repository holds notebooks named for JSS and SoftwareX submissions, but no published article.
Status. Not applicable. The project already computes the one quantity it needs from random matrix theory, the Marchenko–Pastur edge, in open_familyoffice/independence.py (noise_edge, #89). The package's pins don't fit the project's NumPy, SciPy and scikit-learn. It also has no covariance estimators for finance.
Read. Read on 2026-11-28 from the repository at v2.2.3, through the GitHub API. I read the file tree, the README, CITATION.cff and pyproject.toml. I also read the code of the Marchenko–Pastur law (skrmt/ensemble/spectral_law.py), the Tracy–Widom approximator and the MP-PCA denoiser (skrmt/denoise/mp_pca.py). I didn't run it, and I read the notebooks only by name.
Summary
Claim. A library for random matrix theory: random ensembles, their spectral laws, and a denoiser that thresholds singular values at the Marchenko–Pastur edge.
What it has.
- Ensembles. Gaussian, Wishart, Manova and circular ensembles, for β = 1, 2 and 4, with their eigenvalues and joint densities. It samples them, with tridiagonal forms for speed.
- Spectral laws. Wigner's semicircle, Marchenko–Pastur, Tracy–Widom and the Manova law, each as a SciPy distribution with a density and a CDF. The Marchenko–Pastur law takes the ratio p/n, β and a scale σ as given, with edges β·σ²·(1 ± √ratio)². It doesn't fit them to data, and it warns that a ratio of 1 or more "may cause numerical instability".
- Tracy–Widom. An approximator for β = 1, 2 and 4, based on Yao-Yuan Mao's MIT-licensed code.
- Denoising.
MarchenkoPasturPCADenoiser, a scikit-learn transformer that denoises stacks of images, such as repeated MRI scans. It keeps the singular values above σ²(1 + √γ)². σ can be estimated from the data by the bulk median, the smallest eigenvalue, or a least-squares fit of the bulk. - Covariance. The README's introduction mentions "estimation of covariance matrices", but the package tree has none: only a notebook,
simulations/covariance_sims.ipynb. - Dependencies.
numpy>=1.21.6,<=1.26.4,scipy>=1.7.3,<=1.12.0,matplotlib>=3.5.3,<=3.8.4andscikit-learn>=1.3.0,<=1.7.0, for Python 3.8 to 3.12.
Findings. It is a software package, with no study and no reported results for finance.
Where the claims go beyond the evidence
The covariance tools are gone. The introduction still promises "estimation of covariance matrices". The release has no estimator: no eigenvalue clipping, no shrinkage and no rotationally invariant estimator (Bun, Bouchaud & Potters, 2017).
The pins are old. The package caps NumPy at 1.26.4 and SciPy at 1.12.0. The project runs NumPy 2.4.6, SciPy 1.18.1 and scikit-learn 1.9.1, so installing the package would downgrade all three, or fail to resolve.
The laws assume Gaussian noise. The Marchenko–Pastur and Tracy–Widom laws hold for independent entries of equal variance. Financial returns have fat tails and volatility that clusters. The package doesn't test how far the edges move for such data, and its denoiser is tuned on images.
Credit. The code cites its sources (Veraart et al. for MP-PCA, Mao and Bejan for Tracy–Widom). It is tested in CI, and it is still maintained.
Use in this repo
The edge already has one home. independence.noise_edge gives (1 + √(M/T))² for a correlation matrix, and above_noise counts the eigenvalues above it, with a Jacobi solver in plain Python (#89). That is the formula that the package's MarchenkoPasturDistribution holds, with σ = 1. A second copy would break the rule of one definition for each formula.
The count measures factors, not trials. The calibration's extensions (#307, papers/evaluator-calibration/) found that the eigenvalue count gave 1 effective trial for families that share a benchmark. On their independent active returns, it gave 0. So the count of eigenvalues above the edge measures common factors, not independent bets, and #325 records that. A better random matrix library wouldn't change this.
Tracy–Widom is the one idea that carries over. With finite T, the largest noise eigenvalue fluctuates around the edge on the Tracy–Widom scale, of order T^(−2/3). A test of whether the largest eigenvalue beats noise would use its quantile, not the bare edge. That bears on the dependency graph's null (#187), and I'll note it on #325. It doesn't justify the dependency: the quantiles are tabulated, and the project needs one or two of them.
Denoising for portfolios is skfolio's job. Covariance denoising and detoning for portfolios are in skfolio, which #259 reviews. That fits the portfolio work better than an image denoiser.