Relative Error Streaming Quantiles

Graham Cormode, Zohar Karnin, Edo Liberty, Justin Thaler, Pavel Veselý
4/3/2020
52 citations
cs.DS

Official code: edoliberty/streaming-quantiles (59 stars, Jupyter Notebook, Apache-2.0, last commit 2022-11-19).

Abstract

Estimating ranks, quantiles, and distributions over streaming data is a central task in data analysis and monitoring. Given a stream of $n$ items from a data universe equipped with a total order, the task is to compute a sketch (data structure) of size polylogarithmic in $n$.

Show full abstract

Given the sketch and a query item $y$, one should be able to approximate its rank in the stream, i.e., the number of stream elements smaller than or equal to $y$. Most works to date focused on additive $\varepsilon n$ error approximation, culminating in the KLL sketch that achieved optimal asymptotic behavior. This paper investigates multiplicative $(1\pm\varepsilon)$-error approximations to the rank. Practical motivation for multiplicative error stems from demands to understand the tails of distributions, and hence for sketches to be more accurate near extreme values. The most space-efficient algorithms due to prior work store either $O(\log(\varepsilon^2 n)/\varepsilon^2)$ or $O(\log^3(\varepsilon n)/\varepsilon)$ universe items. We present a randomized sketch storing $O(\log^{1.5}(\varepsilon n)/\varepsilon)$ items that can $(1\pm\varepsilon)$-approximate the rank of each universe item with high constant probability; this space bound is within an $O(\sqrt{\log(\varepsilon n)})$ factor of optimal. Our algorithm does not require prior knowledge of the stream length and is fully mergeable, rendering it suitable for parallel and distributed computing environments.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Implements the Karnin-Lang-Liberty (KLL) algorithm in python

5922Jupyter Notebook, PythonMar 22, 20164 years agoApache-2.0

Similar Papers

Cite this paper

@article{cormode2020relative,
  title  = {Relative Error Streaming Quantiles},
  author = {Graham Cormode and Zohar Karnin and Edo Liberty and Justin Thaler and Pavel Veselý},
  year   = {2020},
  eprint = {2004.01668},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2004.01668}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2004.01668.svg)](https://codeofpaper.com/paper/2004.01668)

Discussion