Skip to main content

Module quantile

Module quantile 

Source
Available on crate feature alloc only.
Expand description

Greenwald-Khanna streaming quantile sketch for bin edge computation.

The GK sketch maintains a compact summary of a data stream that answers quantile queries with bounded error epsilon. It stores tuples (value, gap, delta) where gap is the minimum rank difference from the predecessor and delta is the maximum rank uncertainty.

Space complexity: O((1/epsilon) * log(epsilon * N)) Per-insert time: O(log(1/epsilon) + (1/epsilon)) amortized (binary search + compress) Query time: O(1/epsilon) (linear scan of summary)

Structs§

QuantileBinning
Greenwald-Khanna streaming quantile sketch.