rheon.corr.mp_edge¶
- rheon.corr.mp_edge(n: int, m: int, sigma2: float = 1.0) tuple[float, float][source]¶
Compute the Marchenko-Pastur edges for
nobservations ofmseries.Use it to tell a correlation matrix’s eigenvalues from noise: eigenvalues between the edges are what pure noise produces, and only those above the upper edge carry information (Laloux, Cizeau, Bouchaud and Potters, 1999). For the density between the edges, use
mp_density().Parameters
nThe number of observations, above 0.
mThe number of series, above 0.
sigma2The noise variance. Default 1, a correlation matrix’s.
Returns
(lam_minus, lam_plus), two floats:lam_pm = sigma2 * (1 +- 1/sqrt(Q))**2, Q = n / m
Q = 1gives(0, 4 sigma2).Raises
ValueErrornormnot above 0, orsigma2not a finite number above 0.
Examples
lo, hi = rp.corr.mp_edge(n=400, m=100) print(round(lo, 3), round(hi, 3))
0.25 2.25
See also
mp_density(), the curve between the edges.spectral(), the eigenvalues to compare with them.