Stream Quantiles via Maximal Entropy Histograms

Ognjen Arandjelovic, Duc-Son Pham, Svetha Venkatesh

Introduction

Estimating quantiles (such as the 95th percentile) in real-time data streams is a critical task for applications ranging from network monitoring to surveillance. However, traditional methods often struggle with two primary constraints: limited memory and non-stationary data distributions. When data characteristics shift over time—a common occurrence in real-world environments—standard algorithms like $P^2$ or reservoir sampling frequently fail to adapt, leading to significant estimation errors. This paper presents a novel approach using "Maximal Entropy" histograms to provide robust, memory-efficient quantile estimation in dynamic environments.

Methodology: Maximal Entropy Histograms

The core innovation lies in maintaining a histogram where bin boundaries evolve to maximize entropy. In this context, maximal entropy is achieved when every bin has an equal probability of receiving a new data point (equiprobable bins). This ensures that the histogram dynamically allocates more resolution to the most active parts of the data distribution, preventing any segment of the data from being ignored.

Figure 2: Illustration of the bin update process. When a new data point arrives, a temporary bin is created, and neighboring bins are merged to maintain the maximal entropy invariant.

The authors evaluate two specific implementations:

  1. Interpolated Bins (Method 1): Readjusts boundaries using linear interpolation after every point. While theoretically sound, it is prone to cumulative interpolation drift over time.
  2. Data-Aligned Bins (Method 2): The preferred approach. It merges the pair of neighboring bins that results in the highest entropy, keeping boundaries tied to actual observed data points. This "Data-Aligned" method avoids the drift issues of Method 1 and proves more robust in practice.

Evaluation and Results

The algorithms were tested against highly non-stationary streams, including CCTV motion statistics from surveillance systems in Mexico and Australia. These datasets feature sudden spikes and gradual shifts in values, providing a rigorous test for adaptability.

Figure 4: Comparative performance of quantile estimation algorithms on non-stationary data. The proposed methods (a, b) track the ground truth closely, while traditional methods like the $P^2$ algorithm (c) and uniform histograms (e) exhibit massive errors.

The results demonstrate a stark contrast in performance:

  • Accuracy: The Data-Aligned method achieved a mean relative error of just 0.5% on non-stationary streams. In comparison, the widely used $P^2$ algorithm reached errors as high as 45.6%.
  • Efficiency: The proposed method maintains high accuracy even with as few as 12 bins, making it exceptionally memory-efficient for large-scale streaming applications.
  • Adaptability: Unlike sampling-based methods or fixed histograms that "ghost" old data or fail after spikes, the maximal entropy approach recovers almost instantly from distribution shifts, staying virtually indistinguishable from the ground truth.

Conclusion

By leveraging the principle of maximal entropy, these new histogram-based algorithms provide a superior solution for stream quantile estimation. They offer a rare combination of high accuracy, minimal memory footprint, and the ability to adapt to rapidly changing data distributions, making them ideal for modern real-time analytics.

Summary updated

BibTeX
@inproceedings{arandjelovic2014stream,
  author = {Ognjen Arandjelovic and Duc-Son Pham and Svetha Venkatesh},
  title = {{Stream Quantiles via Maximal Entropy Histograms}},
  booktitle = {ICONIP},
  year = {2014},
  url = {https://openreview.net/forum?id=sxfT0Ig9yCv},
}
Figure