Implementation of the t-digest algorithm for streaming quantile estimation. Based on the MergingDigest variant from https://github.com/tdunning/t-digest
Implementation of the t-digest algorithm for streaming quantile estimation. Based on the MergingDigest variant from https://github.com/tdunning/t-digest
(add-point digest value)(add-point {:keys [temp-centroids] :as digest} value weight)Adds a single value with weight to the digest
Adds a single value with weight to the digest
(cdf {:keys [centroids] :as digest} x)Returns cumulative probability at x. Returns NaN if digest is empty.
Returns cumulative probability at x. Returns NaN if digest is empty.
(compress digest)Merges any buffered points into the digest.
Merges any buffered points into the digest.
(histogram digest iqr)Returns a histogram of the digest using centroid centers as bin locations.
Returns a histogram of the digest using centroid centers as bin locations. - counts: Number of samples in each bin - centers: Bin center locations - widths: Width of each bin - density: Normalized density (count/width) for each bin - n: Total sample count - num-bins: Number of bins - min: Minimum value - max: Maximum value
(new-digest)(new-digest compression)(new-digest compression buffer-size)Creates a new t-digest with given compression factor.
Creates a new t-digest with given compression factor.
(quantile {:keys [centroids] :as digest} q)Returns estimated value at given quantile (0-1). Returns NaN if digest is empty.
Returns estimated value at given quantile (0-1). Returns NaN if digest is empty.
(variance digest)(variance {:keys [centroids] :as digest} mean)Returns the sample variance of the distribution represented by the t-digest. Uses n-1 in the denominator (Bessel's correction).
Returns the sample variance of the distribution represented by the t-digest. Uses n-1 in the denominator (Bessel's correction).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |