Expand description
Random matrix theory: GOE, GUE, Wishart matrices, eigenvalue computation, and spectral distribution analysis (Wigner semicircle, Marchenko-Pastur).
Structs§
- Eigenvalue
Renderer - Render eigenvalue distribution as a glyph histogram.
- Random
Matrix - A dense matrix stored in row-major order.
Functions§
- eigenvalues
- Compute eigenvalues of a real symmetric matrix using the QR algorithm with Wilkinson shifts.
- eigenvalues_
jacobi - Compute eigenvalues using a simpler Jacobi rotation method for small symmetric matrices. More robust than QR for our purposes.
- goe
- Gaussian Orthogonal Ensemble: symmetric matrix with N(0,1) off-diagonal and N(0,2) diagonal entries, divided by sqrt(2n).
- gue
- Gaussian Unitary Ensemble (real approximation): symmetric matrix similar to GOE but with different normalization. For a real approximation, we use the same structure as GOE with scale 1/sqrt(n).
- level_
spacing_ ratios - Level spacing ratio: r_i = min(s_i, s_{i+1}) / max(s_i, s_{i+1}) where s_i = lambda_{i+1} - lambda_i.
- marchenko_
pastur - Marchenko-Pastur distribution: eigenvalues of large Wishart matrices. For ratio gamma = p/n, support is [(1-sqrt(gamma))^2, (1+sqrt(gamma))^2].
- marchenko_
pastur_ density - Marchenko-Pastur theoretical density.
- random_
correlation - Generate a random correlation matrix of size n.
- semicircle_
density - Wigner semicircle theoretical density at x with radius R.
- wigner_
semicircle - Wigner semicircle law: eigenvalues of GOE(n) should follow rho(x) = (2/(pi*R^2)) * sqrt(R^2 - x^2) for |x| <= R, where R = 2.
- wishart
- Wishart matrix: W = X^T * X / n where X is a p x n matrix with iid N(0,1).