Abstract
Estimating the mode of an unknown probability density from a data stream is a significant challenge in statistics. This paper presents an online method using stochastic approximation and kernel-based gradient estimation. By employing a regularization term and analyzing the system via Ordinary Differential Equations (ODEs), the authors demonstrate a stable, $O(1)$ complexity algorithm that converges almost surely to the true mode of a unimodal distribution. Experimental results across various distributions confirm the algorithm's accuracy and robustness to initialization.
Introduction
The "mode"—the most frequent value in a dataset—is a fundamental statistical measure. Unlike the mean, which is sensitive to outliers, the mode provides a robust "typical" value, particularly useful for skewed distributions such as income data. However, finding the mode of an unknown probability density from a continuous stream of data is computationally demanding.
Most existing mode estimation techniques are "offline," requiring the entire dataset to be available upfront and often relying on expensive operations like sorting. This paper addresses the need for an online estimator: one that updates its estimate with each new data point without storing previous samples. This is a non-trivial task because the mode is the maximum of a potentially complex, unknown density function.
Methods
The proposed method frames mode estimation as an optimization problem: finding the point $m$ that maximizes the density function $f(m)$. Since $f(m)$ is unknown, the authors utilize several key strategies:
- Kernel Approximation: A kernel function (e.g., Gaussian, Cauchy, or Fejer) approximates the gradient of the unknown density. By convolving the density with a smooth kernel, the direction toward the "peak" can be estimated using individual samples.
- Stochastic Gradient Ascent: The estimate $m_n$ is updated iteratively based on new samples $X_{n+1}$.
- Regularization: A small regularization term $\lambda$ is added to ensure stability, preventing the algorithm from diverging due to noise.
To guarantee convergence, the authors employ ODE Analysis. They demonstrate that as the sample size grows, the discrete updates of the algorithm behave like a continuous dynamical system. They prove that the distribution's peak is the unique stable equilibrium point of this system.
Experimental Evaluation
The algorithm was evaluated using synthetic samples from several standard distributions, including Univariate (Normal, Gamma, Exponential, Weibull, Beta) and Multivariate (Bivariate Normal, Dirichlet) distributions. The authors used $10^6$ samples per run to observe asymptotic behavior, performing 100 independent runs to ensure statistical significance.
Results and Discussion
The algorithm demonstrated high accuracy across all tested distributions. For a Normal distribution with a true mode of 10, the algorithm yielded an estimate of $9.97 \pm 0.33$. For a Bivariate Normal at $[20; 15]$, it estimated $[20.03; 15.01]$. Notably, the algorithm remained effective even for non-smooth distributions like Exponential and Weibull, which technically violate some theoretical assumptions.
A key finding is the algorithm's robustness to initialization. As shown in the figure below, the estimate converges to the true mode regardless of the starting value (5, 10, or 15 for a distribution centered at 10).
The $O(1)$ complexity per update makes this method significantly more efficient than $O(N \log N)$ sorting-based estimators, making it ideal for high-scale streaming data.
Conclusion
This research provides a mathematically rigorous and computationally efficient framework for online mode estimation. By combining stochastic approximation with ODE stability analysis, the authors offer a method that is both practical and theoretically sound. Future work will explore second-order methods to improve convergence speed and establish finite sample error bounds.
Summary updated