[Paper Review] Kernel Estimator and Bandwidth Selection for Density and its Derivatives: The kedd Package
The kedd R package provides a comprehensive, object-oriented framework for kernel density estimation and its derivatives, offering advanced bandwidth selection methods including AMISE, cross-validation variants (UCV, BCV, CCV, MCV, TCV), and support for multiple kernel functions. It enables accurate, flexible, and user-friendly nonparametric density and derivative estimation with S3 model objects for extensibility and visualization.
The kedd package providing additional smoothing techniques to the R statistical system. Although various packages on the Comprehensive R Archive Network (CRAN) provide functions useful to nonparametric statistics, kedd aims to serve as a central location for more specifically of a nonparametric functions and data sets. The current feature set of the package can be split in four main categories: compute the convolutions and derivatives of a kernel function, compute the kernel estimators for a density of probability and its derivatives, computing the bandwidth selectors with different methods, displaying the kernel estimators and selection functions of the bandwidth. Moreover, the package follows the general R philosophy of working with model objects. This means that instead of merely returning, say, a kernel estimator of rth derivative of a density, many functions will return an object containing, it's functions are S3 classes (S3method). The object can then be manipulated at one's will using various extraction, summary or plotting functions. Whenever possible, we develop a graphical user interface of the various functions of a coherent whole, to facilitate the use of this package.
Motivation & Objective
- To address the lack of a centralized, user-friendly R package for nonparametric density and derivative estimation with consistent interface design.
- To implement a wide range of bandwidth selection methods for the rth derivative of a density function, including AMISE, UCV, BCV, CCV, MCV, and TCV.
- To provide a unified S3 object-oriented framework for kernel estimators and bandwidth selectors, enabling consistent extraction, summary, and plotting operations.
- To support multiple kernel functions (Gaussian, Epanechnikov, Uniform, Triangular, Triweight, Tricube, Biweight, Cosine) with analytical derivatives and convolutions.
- To enhance usability through graphical interfaces and integrated visualization tools for bandwidth selection functions and kernel properties.
Proposed method
- Uses S3 classes to encapsulate kernel estimators and bandwidth selectors, enabling consistent object-oriented manipulation via extraction, summary, and plotting functions.
- Implements kernel derivatives via analytical computation using Hermite polynomials for the Gaussian kernel and numerical methods for others.
- Computes kernel convolutions using numerical integration of the product of derivative kernels, essential for cross-validation criteria.
- Applies multiple bandwidth selectors: AMISE (asymptotic mean integrated squared error), UCV (unbiased cross-validation), BCV (biased cross-validation), CCV (complete cross-validation), MCV (modified cross-validation), and TCV (trimmed cross-validation).
- Employs the formula for the rth derivative of the kernel: $ K^{(r)}(x) = \frac{d^r}{dx^r} K(x) $, and its convolution: $ K^{(r)} * K^{(r)}(x) = \int_{\mathbb{R}} K^{(r)}(x) K^{(r)}(x-y) dy $.
- Uses the TCV criterion: $ \mathrm{TCV}(h,r) = \frac{\mathrm{R}(K^{(r)})}{n h^{2r+1}} + \frac{(-1)^r}{n(n-1)h^{2r+1}} \sum_{i \neq j} \varphi^{(r)}\left(\frac{X_j - X_i}{h}\right) $, with $ \varphi^{(r)}(c) = \left[K^{(r)} * K^{(r)} - 2K^{(2r)} \cdot 1(|c| > c_n / h^{2r+1}) \right](c) $, where $ c_n = 1/n $.
Experimental results
Research questions
- RQ1How can a unified, extensible R package be designed to support kernel density estimation and its derivatives with consistent S3 object-oriented principles?
- RQ2Which bandwidth selection methods (AMISE, UCV, BCV, CCV, MCV, TCV) yield optimal performance for estimating the rth derivative of a density function?
- RQ3How do different kernel functions (Gaussian, Epanechnikov, Uniform, etc.) affect the accuracy and stability of density and derivative estimators?
- RQ4What is the impact of bandwidth selection on the visualization and interpretation of density derivatives, particularly for multimodal distributions?
- RQ5Can a graphical user interface improve accessibility and usability of advanced nonparametric density estimation techniques for applied researchers?
Key findings
- The kedd package successfully implements seven bandwidth selectors (AMISE, UCV, BCV, CCV, MCV, TCV, and MLCV) for the rth derivative of a density, with h.tcv returning a bandwidth of 0.257 for the 0th derivative (density) of a bimodal dataset.
- For the first derivative (r=1), the TCV method selects a bandwidth of 0.510, indicating increased smoothing is needed for derivative estimation compared to density estimation.
- The second derivative (r=2) selects a bandwidth of 0.656, and the third derivative (r=3) selects 0.745, showing a systematic increase in bandwidth with derivative order, as expected due to higher variance in higher-order derivatives.
- The package's S3 object system allows seamless extraction of bandwidths, estimators, and summaries, with functions like h.mcv and h.tcv returning both optimal bandwidth and minimal criterion values.
- The TCV method achieves a minimal criterion value of -3.962 for the third derivative, indicating strong performance in minimizing estimation error under the trimmed cross-validation criterion.
- The package supports visualization of kernel derivatives and convolutions, such as the first derivative of the Gaussian kernel and its convolution, which are critical for understanding the behavior of bandwidth selectors.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.