Almost Optimal Streaming Quantiles Algorithms

Streaming approximation of quantiles is a widely performed operation and, as a result, a well studied problem. The goal is to construct a data structure for approximately answering quantile queries in one pass under strict memory constraints. For $\varepsilon$ approximating a single quantile query with probability $1-\delta$ we obtain a $O((1/\varepsilon)\log \log (1/\delta))$ space algorithm and a matching lower bound. We also provide a $O((1/\varepsilon)\log^2 \log (1/\delta))$ sketch which is fully mergeable. These give non-mergeable and mergeable summaries for simultaneously approximating all quantiles in space $O((1/\varepsilon)\log \log (1/\varepsilon\delta))$ and $O((1/\varepsilon)\log^2 \log (1/\varepsilon\delta))$ respectively. The algorithms operate in the comparison model and are simple to implement.