Table of Contents
Fetching ...

A Fast, Closed-Form Bandwidth Selector for the Beta Kernel Density Estimator

Johan Hallberg Szabadváry

TL;DR

The paper tackles boundary bias in kernel density estimation for unit-interval data by advocating the Beta kernel as superior to Gaussian approaches. It introduces the Beta Reference Rule, a fast closed-form bandwidth selector derived from the AMISE of a Beta reference distribution, supplemented by a MoM-based parameter estimation and a principled fallback for U-/J-shaped densities, achieving $O(1)$ computation. Empirical results show the rule matches or surpasses slower LSCV-based methods in accuracy while delivering massive speedups, with real-world validation demonstrating reduced boundary artifacts. The authors also provide an open-source Python package (beta-kde) to facilitate immediate adoption and discuss directions for extending the framework to multivariate and other asymmetric kernels.

Abstract

The Beta kernel estimator offers a theoretically superior alternative to the Gaussian kernel for unit interval data, eliminating boundary bias without requiring reflection or transformation. However, its adoption remains limited by the lack of a reliable bandwidth selector; practitioners currently rely on iterative optimization methods that are computationally expensive and prone to instability. We derive the ``\rot,'' a fast, closed-form bandwidth selector based on the unweighted Asymptotic Mean Integrated Squared Error (AMISE) of a beta reference distribution. To address boundary integrability issues, we introduce a principled heuristic for U-shaped and J-shaped distributions. By employing a method-of-moments approximation, we reduce the bandwidth selection complexity from iterative optimization to $\mathcal{O}(1)$. Extensive Monte Carlo simulations demonstrate that our rule matches the accuracy of numerical optimization while delivering a speedup of over 35,000 times. Real-world validation on socioeconomic data shows that it avoids the ``vanishing boundary'' and ``shoulder'' artifacts common to Gaussian-based methods. We provide a comprehensive, open-source Python package to facilitate the immediate adoption of the Beta kernel as a drop-in replacement for standard density estimation tools.

A Fast, Closed-Form Bandwidth Selector for the Beta Kernel Density Estimator

TL;DR

The paper tackles boundary bias in kernel density estimation for unit-interval data by advocating the Beta kernel as superior to Gaussian approaches. It introduces the Beta Reference Rule, a fast closed-form bandwidth selector derived from the AMISE of a Beta reference distribution, supplemented by a MoM-based parameter estimation and a principled fallback for U-/J-shaped densities, achieving computation. Empirical results show the rule matches or surpasses slower LSCV-based methods in accuracy while delivering massive speedups, with real-world validation demonstrating reduced boundary artifacts. The authors also provide an open-source Python package (beta-kde) to facilitate immediate adoption and discuss directions for extending the framework to multivariate and other asymmetric kernels.

Abstract

The Beta kernel estimator offers a theoretically superior alternative to the Gaussian kernel for unit interval data, eliminating boundary bias without requiring reflection or transformation. However, its adoption remains limited by the lack of a reliable bandwidth selector; practitioners currently rely on iterative optimization methods that are computationally expensive and prone to instability. We derive the ``\rot,'' a fast, closed-form bandwidth selector based on the unweighted Asymptotic Mean Integrated Squared Error (AMISE) of a beta reference distribution. To address boundary integrability issues, we introduce a principled heuristic for U-shaped and J-shaped distributions. By employing a method-of-moments approximation, we reduce the bandwidth selection complexity from iterative optimization to . Extensive Monte Carlo simulations demonstrate that our rule matches the accuracy of numerical optimization while delivering a speedup of over 35,000 times. Real-world validation on socioeconomic data shows that it avoids the ``vanishing boundary'' and ``shoulder'' artifacts common to Gaussian-based methods. We provide a comprehensive, open-source Python package to facilitate the immediate adoption of the Beta kernel as a drop-in replacement for standard density estimation tools.
Paper Structure (20 sections, 2 theorems, 37 equations, 7 figures, 4 tables, 1 algorithm)

This paper contains 20 sections, 2 theorems, 37 equations, 7 figures, 4 tables, 1 algorithm.

Key Result

Proposition 1

Let $h$ be the smoothing bandwidth and assume that the true density $f$ is twice continuously differentiable on $[0,1]$. The expected total probability mass of the unnormalized beta kernel estimator $\widehat{f}_2$ satisfies

Figures (7)

  • Figure 1: Beta kernels $K^*_{x,h}(t)$ for bandwidth $h=0.2$.
  • Figure 2: Mean LSCV score as a function of sample size ($n$) across all eight test distributions. Our proposed method, Beta Reference Rule (red dashed line), is highly competitive in this regard. It closely tracks the performance of the best slow-optimization methods on the "nice" distributions (e.g., $B(2,12)$) while demonstrating superior performance and stability on the "hard" (e.g., $B(0.5, 0.5)$) and "bimodal" distributions as $n$ increases.
  • Figure 3: Mean ISE (log-scale) as a function of sample size ($n$, log-scale) for the "nice" and "bimodal" distributions. This plot visually confirms the findings presented in Table \ref{['tab:main_table_ise']}. Our proposed rule, Beta Reference Rule (red dashed line), is shown to be highly accurate, with its performance line consistently tracking just above the oracle methods (Beta ISE-optimal estimator, Beta Oracle estimator) and visibly outperforming all competing fast rules (Logit-Silverman estimator , Reflection-Silverman estimator) and the slow Beta LSCV estimator.
  • Figure 4: Mean computation time (log-scale) as a function of sample size ($n$, log-scale) across all eight test distributions. This plot visually illustrates the results in Table \ref{['tab:main_table_time']}. It shows a clear separation between the two performance classes: the fast (Rule) methods (dashed lines), including our Beta Reference Rule (Beta (Ref)), which are clustered at the bottom with a near-constant cost of approximately $10^{-4}$ s. In contrast, all Slow (LSCV) and Benchmark (Oracle) methods (dotted and dash-dot lines) are orders of magnitude slower, and their computational cost clearly increases with the sample size $n$.
  • Figure 5: Mean selected bandwidth ($h$, log-scale) as a function of sample size ($n$, log-scale) for the "nice" and "bimodal" distributions. This plot compares the bandwidth selected by our proposed fast rule ("Beta (Ref)") to the optimal bandwidths derived from the oracle methods (Beta ISE-optimal estimator, "Beta (ISE-min)" and Beta Oracle estimator, "Beta (Oracle)"). The Beta Reference Rule bandwidth (dashed line) is shown to closely track the optimal oracle bandwidths across all distributions and sample sizes, visually confirming the accuracy of its derivation.
  • ...and 2 more figures

Theorems & Definitions (6)

  • Remark 1: Mass Conservation
  • Proposition 1
  • proof
  • Proposition 2
  • proof
  • Remark 2