Skip to main content
QUICK REVIEW

[Paper Review] Computing Extremely Accurate Quantiles Using t-Digests

Ted Dunning, Otmar Ertl|arXiv (Cornell University)|Feb 11, 2019
Distributed and Parallel Computing SystemsComputer Science3 references42 citations
TL;DR

The paper introduces t-digests, an online data structure for accurate quantile estimation with small memory, especially near tails, and shows how to merge digests and use different scale functions for controlled error bounds.

ABSTRACT

We present on-line algorithms for computing approximations of rank-based statistics that give high accuracy, particularly near the tails of a distribution, with very small sketches. Notably, the method allows a quantile $q$ to be computed with an accuracy relative to $\max(q, 1-q)$ rather than absolute accuracy as with most other methods. This new algorithm is robust with respect to skewed distributions or ordered datasets and allows separately computed summaries to be combined with no loss in accuracy. An open-source Java implementation of this algorithm is available from the author. Independent implementations in Go and Python are also available.

Motivation & Objective

  • Provide online algorithms to approximate rank-based statistics with high accuracy, especially at distribution tails.
  • Achieve constant memory usage with constant relative error for quantile estimates.
  • Allow merging of independent digests without loss of accuracy for scalable analytics.
  • Enable flexible processing modes (buffer-then-merge and streaming clustering) to build t-digests from large or partitioned datasets.

Proposed method

  • Define a t-digest as a partition of samples into clusters with a mean and weight.
  • Use a scale function k(q) to bound cluster sizes and ensure small tail clusters for tail accuracy.
  • Provide two construction methods: buffer-and-merge and point-by-point nearest-cluster clustering.
  • Allow merging independent t-digests while preserving the size guarantees and relative accuracy.
  • Describe interpolation methods for the empirical CDF between clusters under various cluster configurations.
  • Offer alternative scale functions (k0, k1, k2, k3) with guarantees on the number of centroids and digest merge properties.
  • Present an algorithm for progressively merging a data buffer into an existing t-digest (Algorithm 1) and a clustering variant (Algorithm 2).

Experimental results

Research questions

  • RQ1How can online quantile estimation achieve high accuracy with constant memory, especially near distribution tails?
  • RQ2Can independently computed digests be merged without sacrificing accuracy or ordering properties?
  • RQ3What scale functions best control cluster sizes to balance tail accuracy, overall error, and digest size?
  • RQ4How do different digest construction approaches (buffer-merge vs clustering) affect accuracy and performance in practice?
  • RQ5What interpolation schemes yield accurate quantile estimates given clustered data?

Key findings

  • t-digests provide constant memory with nearly constant relative error for quantiles, especially near tails.
  • The scale function bounds cluster sizes so extreme quantiles use small clusters, improving tail accuracy without exploding the number of clusters.
  • Merging independent t-digests yields a valid digest with preserved accuracy under certain scale functions, enabling parallel and OLAP use.
  • Different scale functions (k0, k1, k2, k3) offer trade-offs between digest size, accuracy, and tail behavior; k2/k3 tighten tail clustering.
  • Interpolation schemes between clusters handle cases with multi-sample and singleton clusters to improve CDF estimates.
  • Empirical results show tails achieve single-digit ppm errors for q near 0 or 1 with δ=100, while mid-range accuracy favors certain scales (k1 vs k2/k3).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.