Kernel Density Estimation (KDE) is a powerful non-parametric technique used to estimate the probability density function of a random variable without relying on rigid structural assumptions (such as the bell curve of a Normal distribution). The behavior of a KDE model depends primarily on two components: the kernel function-typically a standard Gaussian distribution that assigns local probability weights based on distance, and the bandwidth parameter h.
The bandwidth h acts as a crucial smoothing parameter that dictates sensitivity of the model. If h is too small, the estimator overfits the data, creating a noisy, wiggling curve. Conversely, if h is too large, the estimator undersmooths (underfits) the data, washing away genuine structural details into a flat, uninformative curve Scott, 2012.
While numerous methodologies have been developed to optimize h, the plug-in approach by Sheather & Jones (1991) remains a benchmark standard, reliably minimizing the Asymptotic Mean Integrated Squared Error (AMISE) across a wide array of complex, non-parametric distributions Eidous et al., 2010.
Initially, the input data vector X is partitioned into discrete bins to calculate a bin-step density (detailed in Bin-step density). This binning strategy dramatically reduces the computational cost of evaluating the double summations required by the pilot bandwidth estimators when performing the secondary bandwidth α estimation detailed in the secondary bandwidth (α) estimator.
From that, the roughness functionals are estimated, allowing the optimal primary bandwidth h to be found (as described in the primary bandwidth h) by solving the derivative of the AMISE equation, the core metric evaluating the accuracy of estimation. The underlying mathematical theories are detailed in the boxes below.
First, the data is partitioned into N discrete bins (the default is 1000) to determine the individual bin frequencies (bk, where 0≤k≤N−1). These frequencies are used to efficiently compute the total number of data point pairs at each specific bin-step.
For the baseline case where the distance between bins is zero (i=0), the value c0 represents the pairs residing within the exact same bin, described in Equation (11).
Equation (12) is transformed from equation (9), where both kernel function K and L follows Probability Density Function (PDF) of Normal Distribution. Additionally, R(f′′) and R(f′′′) are estimated to S^D(a) and T^D(b) perspectively using the method of Jones & Sheather (1991) with the heuristic pilot bandwidth a and b. The practical computation of S^D(a) and T^D(b) details in The first pilot bandwidth and The second pilot bandwidth correspondently.
By Equation (8), assuming both the kernel function L and the true density function f follow normal distributions, the heuristic bandwidth a for bias optimization is obtained as Equation (13) with λ^ is the estimated interquartile.
The pilot roughness estimator S^D(a) of Equation (12) is estimated following Equation (14), which originates from Equation (5). Practically, due to using bin-step density (ci) with the bin width d calculated while dividing bins, it reduces complexity from O(k2) (k is the data size) to O(N) comparing to the theoretical formula.
Simmilarly, R(f′′′) is estimated and canceled out bias by using specific bandwidth b. Subsequently, assuming both kernel functions follow normal scale model, the heuristic bandwidth b is computed following Equation (16).
Likewise to the first pilot bandwidth, the component T^D(b) estimated for R(f′′′) in Equation (12) is computed by Equation (17). Note that ϕvi(t) is the 6-th derivative of the PDF of Normal Distribution.
Ultimately, the optimal bandwidth h is found by Equation (18), which originates from Equation (2) with K following normal scale model and the substitution of R(f′′) by S^D(α^(h)). Noticeably, data size n is replaced by the number of bins N.
Finally, Equation (18) is solved using Brent’s method Brent, 2013 to find optimized bandwidth h.
Overall, the Sheather-Jones method optimizes the bandwidth parameter (h) by minimizing the AMISE. The primary challenge of this approach lies in estimating the unknown curvature of the true underlying density function f. This is achieved by utilizing a pilot estimation step (a secondary KDE) with an auxiliary bandwidth, which effectively cancels the asymptotic biases of the roughness estimator.
In practice, the implementations utilize a linear binning technique to drastically reduce the computational complexity. Furthermore, while Sheather & Jones (1991) originally outlined a Newton-Raphson framework to solve for the final bandwidth, the practical implementation employs Brent’s method. This numerical root-finding approach guarantees convergence and computational robustness when solving Equation (18).
However, the primary theoretical drawback of this method is its circularity: it relies on the assumption that the real unknown density function f can be approximated well enough by an initial normal-scaled kernel estimator.
Scott, D. W. (2012). Multivariate Density Estimation and Visualization. In J. E. Gentle, W. K. Härdle, & Y. Mori (Eds.), Handbook of Computational Statistics: Concepts and Methods (pp. 549–569). Springer Berlin Heidelberg. 10.1007/978-3-642-21551-3_19
Sheather, S. J., & Jones, M. C. (1991). A Reliable Data-Based Bandwidth Selection Method for Kernel Density Estimation. Journal of the Royal Statistical Society Series B: Statistical Methodology, 53(3), 683–690. 10.1111/j.2517-6161.1991.tb01857.x
Eidous, O. M., Marie, M. A. A. S., & Ebrahem, M. H. B. A.-H. (2010). A Comparative Study for Bandwidth Selection in Kernel Density Estimation. Journal of Modern Applied Statistical Methods, 9(1), 263–273. 10.22237/jmasm/1272687900
Jones, M. C., & Sheather, S. J. (1991). Using Non-Stochastic Terms to Advantage in Kernel-Based Estimation of Integrated Squared Density Derivatives. Statistics & Probability Letters, 11(6), 511–514. 10.1016/0167-7152(91)90116-9
Brent, R. P. (2013). Algorithms for minimization without derivatives. Courier Corporation.