An Online Sample Based Method for Mode Estimation using ODE Analysis of Stochastic Approximation Algorithms
Chandramouli Kamanchi, Raghuram Bharadwaj Diddigi, Prabuchandran K., J., Shalabh Bhatnagar

TL;DR
This paper introduces an online, sample-based iterative algorithm for estimating the mode of a unimodal density, using ODE analysis to prove convergence and stability, suitable for real-time applications with unknown density functions.
Contribution
It presents a novel, computationally efficient online mode estimation method that does not require prior knowledge of the density's analytical form or batch processing.
Findings
Algorithm converges asymptotically to the true mode.
Proven stability of the mode estimates via regularization.
Experimental results confirm effectiveness in practical scenarios.
Abstract
One of the popular measures of central tendency that provides better representation and interesting insights of the data compared to the other measures like mean and median is the metric mode. If the analytical form of the density function is known, mode is an argument of the maximum value of the density function and one can apply the optimization techniques to find mode. In many of the practical applications, the analytical form of the density is not known and only the samples from the distribution are available. Most of the techniques proposed in the literature for estimating the mode from the samples assume that all the samples are available beforehand. Moreover, some of the techniques employ computationally expensive operations like sorting. In this work we provide a computationally effective, on-line iterative algorithm that estimates the mode of a unimodal smooth density given…
| Name of the Kernel | Analytical Form |
|---|---|
| Gaussian | |
| Cauchy | |
| Fejer | |
| Multivariate Gaussian |
| Distribution | Actual Mode | Estimated Mode Std.Dev |
|---|---|---|
| Normal | 10 | 9.971783 0.333930 |
| Gamma | 5 | 5.182626 0.306337 |
| Exponential | 0 | 0.697886 0.007722 |
| Weibull | 0 | 0.697192 0.007544 |
| Beta | 1 | 0.900645 0.001356 |
| Bivariate Normal | [20; 15] | [20.030044; 15.015614 ] [0;0] |
| Dirichlet | [0.5; 0.5] | [0.498404; 0.501579] [0;0] |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
An Online Sample Based Method for Mode Estimation using ODE Analysis of Stochastic Approximation Algorithms
Chandramouli Kamanchi1 Raghuram Bharadwaj Diddigi2 Prabuchandran K.J.3 Shalabh Bhatnagar4,5 1 Department of Computer Science and Automation, Indian Institute of Science, Bangalore, India. [email protected]2 Department of Computer Science and Automation, Indian Institute of Science, Bangalore, India. [email protected]3 Amazon-IISc Postdoctoral fellow, Indian Institute of Science, Bangalore, India. [email protected]4 Department of Computer Science and Automation and Department of Robert Bosch Centre for Cyber-Physical Systems, Indian Institute of Science, Bangalore, India. [email protected]5 Supported by RBCCPS, IISc and a grant from the Department of Science and Technology, India.
Abstract
One of the popular measures of central tendency that provides better representation and interesting insights of the data compared to the other measures like mean and median is the metric mode. If the analytical form of the density function is known, mode is an argument of the maximum value of the density function and one can apply optimization techniques to find the mode. In many of the practical applications, the analytical form of the density is not known and only the samples from the distribution are available. Most of the techniques proposed in the literature for estimating the mode from the samples assume that all the samples are available beforehand. Moreover, some of the techniques employ computationally expensive operations like sorting. In this work we provide a computationally effective, on-line iterative algorithm that estimates the mode of a unimodal smooth density given only the samples generated from the density. Asymptotic convergence of the proposed algorithm using an ordinary differential equation (ODE) based analysis is provided. We also prove the stability of estimates by utilizing the concept of regularization. Experimental results further demonstrate the effectiveness of the proposed algorithm.
Index Terms:
Statistical learning, Optimization algorithms, Machine learning.
©2019 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. This paper is accepted at IEEE Control Systems Letters DOI: 10.1109/LCSYS.2019.2916467
I Introduction
There are many metrics that are used to represent the central tendency of the data. Among them, the popular ones are mean, median and mode. Mean is extensively studied due to its simplicity, linearity and ease of estimation via sample averages. However mean is susceptible to outliers. For example, when we are estimating the mean from a finite number of samples, one bad outlier can shift the estimate far away from the original mean. Also, in some of the applications, mean may not be the desired quantity to analyze. For example, it is often interesting to know the income that majority of the population in a country earns rather than the average income of the country which is a skewed quantity.
In this work, we focus on finding the mode of a density when the analytical form of it is not known. That is, we are given only the samples of the distribution and we need to estimate the mode from these samples. We utilize stochastic approximation techniques to solve this problem. Stochastic approximation is a popular paradigm that is applied sucessfully to analyze random iterative models [1, 2, 3].
We first discuss some of the works that have been reported in the literature for estimating the mode. This problem of estimation of the mode of a unimodal density has been first considered in [4] where a sequence of density functions is iteratively constructed from the samples and the respective modes are calculated as maximum likelihood estimates. It is shown that these estimates of mode converge in probability to the actual mode.
We can broadly classify the solution techniques for the mode estimation problem into two groups. The first group comprises a non-parametric way of estimating the mode where the mode is estimated directly from the sample data without constructing the density function. The second group of methods comprises the parametric way of estimation in which the density function is approximately constructed and the mode is computed using optimization techniques.
In [5], a non-parametric estimator (popularly known as Grenander’s estimate) for estimating the mode directly from the samples is proposed. The later developments of mode estimation methods are based on the idea that the mode is situated at the center of an interval of selected length that contains majority of observed points. A sequence of nested intervals and intermediate mode estimates is constructed based on the above described idea and mode is taken to be the point that these intermediate estimates of mode converge to. Different ways of selecting the interval lengths are studied in [6, 7] along with their convergence properties. A variant of this idea involves selecting the interval of shortest length that contains some desired number of points instead of deciding the lengths of interval. The estimation methods in [8, 9, 10] are based on this idea. Detailed survey of the above discussed techniques along with their robustness is extensively studied in [11, 12].
In [13], a parametric method of estimating the mode is proposed. The idea here is to fit the samples to a normal distribution. Then the mode is estimated by calculating the mean of this fitted normal distribution. This idea is recently extended to find the multivariate mode in [14]. In [15], multivariate mean shift algorithm is proposed for estimating the multivariate mode from the samples. The idea here is to iteratively shift the estimated mode towards the actual mode using Gaussian kernels. In [16], a minimum volume peeling method is proposed to estimate the multivariate mode from the sample data. The idea here is to iteratively construct subsets of the set of samples with minimum volume and discard the remaining points. The mode is then calculated by averaging the points in the constructed subset. This is based on the observation that mode is generally situated in the minimum volume set of a given fixed number of samples. An effective way of selecting the subset of points is discussed in [16].
Most of the algorithms considered in the literature so far make the assumption that all the samples are available upfront. These techniques cannot be extended to the case of streaming data where the samples arrive online one at a time. Also, the non-parametric techniques (refer [12]) require the samples to be in a sorted order.
Our proposed algorithm is fundamentally different from the above algorithms in the sense that ours is an online algorithm that works with the data as it becomes available. This enables us to work with online samples without storing them in the memory. Also, we do not resort to any computationally expensive operations like sorting. In addition, our algorithm works for both univariate and multivariate distributions. We provide a convergence analysis of our proposed technique and show the robustness of our technique using simulation results.
Our work is closest to [17]. In [17] a gradient-like recursive procedure for estimating the mode is proposed and convergence is provided utilizing the theory of martingales. In our work to mitigate the lack of analytical form of density, we construct a kernel based representation (refer section II) of the density function and use stochastic gradient ascent to calculate mode. Our work is different from [17] in the following ways.
- •
Our proposed algorithm is based on assumptions different from those of [17]. Moreover, we prove the stability of the mode estimates by introducing the concept of regularization [18].
- •
We demonstrate the effectiveness of our algorithm by providing empirical evaluation on well-known distributions.
- •
Our convergence proof utilizes the well-known ODE based analysis of stochastic approximation algorithms. To the best of our knowledge, ours is the first work that makes use of ODE based analysis in the context of mode estimation.
II Background and Preliminaries
To begin, suppose we have a probability space and a random vector with a smooth density function A mode of the random vector is defined as an argument of the maximum of Suppose we have a unique mode i.e. has a unique maximizer then the mode is a measure of central tendency of the distribution of A natural problem that arises is the estimation of the mode given a sequence of independent and identically distributed samples of denoted by In what follows we provide necessary formal definitions and prove some properties that are utilized in the motivation and the convergence of our proposed algorithm to solve this problem.
II-A Approximation of Identity
Definition 1
The convolution of two functions and on is defined as
[TABLE]
Definition 2
Given a function and we define
[TABLE]
For a given function as above, the family of functions is called approximation of the identity.
Lemma 1
Suppose . Then, given any
* * 2. 2.
* as , for any fixed *
Proof:
For statement 1 choose So Then we have
[TABLE]
Again for statement 2, let and choose Now
[TABLE]
Since and as , the proof is complete. ∎
Theorem 1
Let , where and as . Then as at each point of continuity of
Proof:
Let be continuous at By the definition of continuity, given there exists such that if Since from Lemma 1 and hypothesis we have,
[TABLE]
The third term approaches zero with by Lemma 1. It is enough to show that the second term approaches zero. From the hypothesis for some non-negative where as We have
[TABLE]
Again from the hypothesis \mu\big{(}\frac{t}{\epsilon}\big{)}\to 0 as So \sup\displaylimits_{||t||\geq\delta}\mu\big{(}\frac{t}{\epsilon}\big{)}\to 0 as . This concludes the proof. This theorem is utilized to obtain an approximate analytical form for the gradient of density (refer Section IV). ∎
Corollary 1
Let , where and as . Then as at each point of continuity of Here the convolution, , is performed component wise.
Proof:
The result is obtained by applying Theorem 1 to each component of . ∎
II-B Stochastic Gradient Ascent
Stochastic gradient ascent [19] deals with the study of iterative algorithms of the type
[TABLE]
Here are the parameters that are updated according to (1). The function is an underlying cost function whose maximum we are interested in finding. Also, is a prescribed step-size sequence. Further, constitute the noise terms. We state here a theorem that is utilized in the convergence analysis of our algorithm. Consider the following assumptions [19, 20].
- A1.
The step-sizes , satisfy the requirements:
[TABLE] 2. A2.
The sequence is a martingale difference sequence with respect to the following increasing sequence of sigma fields:
[TABLE]
Thus, in particular, ,
[TABLE]
Further are square integrable and
[TABLE]
for a given constant 3. A3.
The function is Lipschitz continuous. 4. A4.
The functions , satisfy as , uniformly on compacts. Furthermore, the o.d.e
[TABLE]
has the origin as the unique globally asymptotically stable equilibrium.
Consider the ordinary differential equation
[TABLE]
Let denote the compact set of asymptotically stable equilibrium points of the ODE (3).
Theorem 2
Under (A1)-(A4), (stability) a.s. Further almost surely as .
Proof:
Follows as a consequence of Theorem 2 in chapter 2 and Theorem 7 in chapter 3 of [19]. ∎
III Motivation and Algorithm
In this section we motivate and present our iterative algorithm for estimating the mode of a unimodal density. The idea of computing the mode is described below. Let denote the unimodal density function. As mode is the maximizer of the density function, we can estimate the mode by gradient ascent as follows:
[TABLE]
where and are the step-size and current mode estimate, respectively, at time .
We introduce a function defined as follows:
[TABLE]
where is the regularization coefficient [18]. The idea is to find an that maximizes the function . This is done to maintain the stability of the estimates in our algorithm (refer proposition 3 in Section IV). Therefore the gradient ascent update is performed as follows:
[TABLE]
It remains to be shown that solution obtained using this update equation (7) converges to the mode obtained using the update equation (4) as . Let
[TABLE]
and
[TABLE]
It is easy to see that
[TABLE]
From the continuity of function given by the Maximum Theorem [21] we have as ,
[TABLE]
The update equation (7), however, needs the information of , which is not known. We therefore make use of the ideas in section II to estimate as follows. To make the notations easy, we replace with and derive Applying Corollary 1 to with the kernel we get for small ,
[TABLE]
By the properties of convolution
[TABLE]
Note that there are several valid choices for function (also called kernel) to obtain approximation of identity.
Now, (7) can be re-written using stochastic gradient ascent as follows:
[TABLE]
where is the sample obtained at time .
In the following table, we indicate some of the popular kernels [22].
It is easily verified that the kernels defined in Table I satisfy the hypotheses of Corollary 1. The full algorithm for estimating the mode from online streaming data is described in Algorithm 1.
Let denote an initial mode estimate and , a small constant. The algorithm works as follows. At time , the algorithm takes as input the current mode estimate and the sample . It then computes the direction and updates current approximation of the mode along as shown in step 2. The output of the algorithm is the updated mode estimate computed from samples obtained so far, i.e., . We prove the convergence of the algorithm in the next section.
IV Convergence Analysis
Let be a sequence of sigma fields. Observe that forms a filtration. Let Note that is -measurable. Moreover is integrable i.e. under the assumption that is integrable. Now the basic algorithm can be written as
[TABLE]
where is a mean zero term. Also, constitutes a martingale difference sequence (see proof of Proposition 1). Here is the expectation with respect to the density
Our convergence analysis rests on Theorem 2. Our algorithm is in the form of the general iterative scheme (1) with and . We choose Gaussian kernel for our analysis of the algorithm. Similar analysis can be carried out for other choice of kernels. We first validate the assumptions of Theorem 2 below.
The choice assures assumption A1. The following proposition validates assumption A2.
Proposition 1
* is a martingale difference sequence with*
[TABLE]
for all and for some .
Proof:
It is easy to see that From the foregoing, is measurable and integrable . So clearly is a martingale difference sequence. Now
[TABLE]
The first inequality follows from the simple identity , while the second inequality follows from a simple application of Jensen’s inequality. Since the higher derivatives and in particular Hessian of is bounded, it follows that is Lipschitz continuous. We have
[TABLE]
where is the Lipschitz constant. Hence for all ,
[TABLE]
where Therefore,
[TABLE]
where and This completes the proof. ∎
The following lemma is useful in proving assumption A3 (see Proposition 2).
Lemma 2
**
Proof:
Now Also is analytic and has a power series expansion around Using power series of , linearity of the expectation and independence of from we obtain ∎
Owing to Lemma 2 our iterative update (11) transforms into and we validate assumption A3 below.
Proposition 2
* is Lipschitz continuous.*
Proof:
Now for any and
[TABLE]
where is the Lipschitz constant of ∎
The following proposition proves assumption A4.
Proposition 3
The ODE has the origin as its unique globally asymptotically stable equilibrium point.
Proof:
From the definition of , see assumption A4, we have
[TABLE]
Here
[TABLE]
where the facts that and are utilized. By the application of Dominated Convergence Theorem [22] we have
[TABLE]
So we have that
Now for the system , clearly the origin is an equilibrium point. Also for any initial point , is the solution of the system and as . Therefore the origin is the unique globally asymptotically stable equilibrium point of the system. This concludes the proof. ∎
Remark 1
Note that the regularization coefficient plays a key role in establishing the stability of the mode estimates. To see the effect of the regularization term consider the iterates
[TABLE]
The corresponding to this update equation is identically 0 thereby violating assumption A4.
Consider now the following ODE:
[TABLE]
Let be the set of asymptotically stable equilibrium points of (13).
Remark 2
From our assumptions as for every point of continuity and as .
We have the following as our main result.
Theorem 3
* obtained from Algorithm 1 satisfies a.s.*
Proof:
The result follows from the foregoing and Theorem 2. ∎
V Experiments
In this section, we discuss the numerical performance of our algorithm. We implement our algorithm on known popular distributions. We collect samples from a known distribution and apply our algorithm for estimating the mode. The initial mode estimate is selected as the average of initial 1000 points. We consider Gaussian kernel for univariate distributions and multivariate Gaussian kernel for bivariate normal and Dirchlet distributions (see Table I) for our experiments. The regularization coefficient is chosen to be and is set to 1. We perform 100 runs of the experiment and estimated mode is calculated as the mean of modes obtained over the 100 runs. The following Table II illustrates the performance of our algorithm (estimated mode) on standard distributions. We have also indicated the actual mode of the distribution in the Table II. The code for our experiments can be found at https://github.com/raghudiddigi/Mode-Estimation.
It is interesting to note that, though Exponential and Weibull densities are not smooth and do not satisfy our assumptions, the estimated mode obtained by our algorithm is closer to the actual mode.
In Figure 1, we show the performance of our algorithm with different initial points. For this purpose, we select Normal distribution with mean 10. We implement our algorithm with initial points 5,10 and 15 and plot the estimated mode over initial 50,000 iterations. We observe that the estimates of the mode in all the three cases converge towards the actual mode having value 10 as the number of iterations increase. This shows that the proposed algorithm is not very sensitive with respect to the initial mode estimate. These results thus confirm the practical utility of our algorithm.
VI Conclusions and Future Work
In this paper, we proposed an online computationally efficient algorithm for computing the mode from the samples of an unknown density. We have provided the proofs for the stability of the iterates and convergence of our algorithm. Next, we showed results of experiments on standard distributions that demonstrate the effectiveness of our algorithm in practice.
In future, we wish to propose second order algorithms based on the Newton’s method in the place of gradient ascent. Newton’s method is known to converge faster than the gradient ascent method. Another interesting future direction would be to obtain finite sample error bounds and rate of convergence for our algorithm by utilizing central limit theorem for stochastic approximation.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] T. Jaakkola, M. I. Jordan, and S. P. Singh, “Convergence of stochastic iterative dynamic programming algorithms,” in Advances in neural information processing systems , 1994, pp. 703–710.
- 2[2] Z. Zhou, P. Mertikopoulos, N. Bambos, S. Boyd, and P. W. Glynn, “Stochastic mirror descent in variationally coherent optimization problems,” in Advances in Neural Information Processing Systems , 2017, pp. 7040–7049.
- 3[3] Z. Zhou, P. Mertikopoulos, N. Bambos, S. Boyd, and P. Glynn, “Mirror descent in non-convex stochastic programming,” ar Xiv preprint ar Xiv:1706.05681 , 2017.
- 4[4] E. Parzen, “On estimation of a probability density function and mode,” The annals of mathematical statistics , vol. 33, no. 3, pp. 1065–1076, 1962.
- 5[5] U. Grenander, “Some direct estimates of the mode,” The Annals of Mathematical Statistics , pp. 131–138, 1965.
- 6[6] H. Chernoff, “Estimation of the mode,” Annals of the Institute of Statistical Mathematics , vol. 16, no. 1, pp. 31–41, 1964.
- 7[7] E. J. Wegman, “A note on the estimation of the mode,” The Annals of Mathematical Statistics , pp. 1909–1915, 1971.
- 8[8] T. Dalenius, “The mode–a neglected statistical parameter,” Journal of the Royal Statistical Society. Series A (General) , pp. 110–117, 1965.
