freealg.kde#
- freealg.kde(eig, xs, lam_m, lam_p, h, kernel='beta', plot=False)#
Kernel density estimation of eigenvalues.
- Parameters:
- eignumpy.array
1D array of samples of size n.
- xsnumpy.array
1D array of evaluation grid (must lie within
[lam_m, lam_p])- lam_mfloat
Lower end of the support endpoints with
lam_m < lam_p.- lam_pfloat
Upper end of the support endpoints with
lam_m < lam_p.- hfloat
Kernel bandwidth in rescaled units where
0 < h < 1.- kernel{
'gaussian','beta'}, default='beta' Kernel function using either Gaussian or Beta distribution.
- plotbool, default=False
If True, the KDE is plotted.
- Returns:
- pdfnumpy.ndarray
Probability distribution function with the same length as
xs.
See also
Notes
In Beta kernel density estimation, the shape parameters “a” and “b” of the Beta(a, b)) distribution are computed for each data point “u” as:
a = (u / h) + 1.0 b = ((1.0 - u) / h) + 1.0
This is a standard way of using Beta kernel (see R-package documentation: https://search.r-project.org/CRAN/refmans/DELTD/html/Beta.html
These equations are derived from “moment matching” method, where
Mean(Beta(a,b)) = u Var(Beta(a,b)) = (1-u) u h
Solving these two equations for “a” and “b” yields the relations above. See paper (page 134) https://www.songxichen.com/Uploads/Files/Publication/Chen-CSD-99.pdf