[ANN] BetaKDE.jl: Boundary-Corrected Beta Kernel Density Estimation

I am pleased to announce the release of BetaKDE.jl, a package for boundary-corrected density estimation on the unit interval [0,1].

Standard KDE with Gaussian kernels suffers from severe boundary bias when applied to data with strict compact support (e.g., proportions, probabilities, or copula data). To address this, this package implements Chen’s beta kernel estimator alongside a newly derived closed-form Beta Reference Rule for bandwidth selection. This provides a rigorous rule-of-thumb solution that avoids the instability and computational overhead of numerical optimization routines like LSCV.

Key Features:

  • Implements Chen’s beta kernel for strictly bounded data in [0,1].
  • Natively provides the closed-form Beta Reference Rule bandwidth selector.
  • Ecosystem compatibility: Includes a Plots.jl recipe, StatsBase.jl fit support, Distributions.jl point evaluations (pdf, logpdf), and full DensityInterface.jl compatibility for use in Bayesian workflows.
  • For cross-language workflows, this method is also available in Python via beta-kde. Furthermore, it has been integrated as the default bandwidth selector (under the identifier “HS”) for beta kernels in the standard R package kdensity (v1.2.0+).

The mathematical derivation of the bandwidth rule has been accepted for publication in the Journal of Computational and Graphical Statistics (JCGS). The preprint is available on arXiv: https://arxiv.org/abs/2601.19553

Feedback and pull requests are welcome!