rheon.corr.mp_density¶
- rheon.corr.mp_density(lam: Any, n: int, m: int, sigma2: float = 1.0) Any[source]¶
Compute the Marchenko-Pastur density at given eigenvalues.
Use it to draw a correlation matrix’s spectrum against the curve pure noise would give. For the edges alone, use
mp_edge().Parameters
lamAn eigenvalue, or an array of them.
n,m,sigma2As for
mp_edge().
Returns
A float array of
lam’s shape, 0 outside the edges:(Q / (2 pi sigma2)) * sqrt((lam_plus - lam) * (lam - lam_minus)) / lam
with
Q,lam_plusandlam_minusthose ofmp_edge().Raises
ValueErrorAs for
mp_edge().
Examples
print(rp.corr.mp_density([0.1, 1.0, 3.0], n=400, m=100).round(3))
[0. 0.616 0. ]
See also
mp_edge(), the edges.