Returns a new t-digest with new pair (x, w) included in its sketch.
Returns a new t-digest with new pair (x, w) included in its sketch.
A pair (x, w) where x is the numeric value and w is its weight
the updated sketch
This implements 'algorithm 1' from: Computing Extremely Accurate Quantiles Using t-Digests, Ted Dunning and Otmar Ertl, https://github.com/tdunning/t-digest/blob/master/docs/t-digest-paper/histo.pdf
Returns a new t-digest with value x included in its sketch; td + x is equivalent to td + (x, 1).
Returns a new t-digest with value x included in its sketch; td + x is equivalent to td + (x, 1).
The numeric data value to include in the sketch
the updated sketch
Add this digest to another
Add this digest to another
The right-hand t-digest operand
the result of combining left and right digests
Compute a cumulative probability (CDF) for a numeric value, from the estimated probability distribution represented by this t-digest sketch.
Compute a cumulative probability (CDF) for a numeric value, from the estimated probability distribution represented by this t-digest sketch.
a numeric value
the cumulative probability that a random sample from the distribution is <= x
Compute a cumulative probability (CDF) for a numeric value, from the estimated probability distribution represented by this t-digest sketch, assuming sketch is "discrete" (e.
Compute a cumulative probability (CDF) for a numeric value, from the estimated probability distribution represented by this t-digest sketch, assuming sketch is "discrete" (e.g. if number of clusters <= maxDiscrete setting)
a numeric value
the cumulative probability that a random sample from the distribution is <= x
Compute the inverse cumulative probability (inverse-CDF) for a quantile value, from the estimated probability distribution represented by this t-digest sketch, assuming the sketch is "discrete" (e.
Compute the inverse cumulative probability (inverse-CDF) for a quantile value, from the estimated probability distribution represented by this t-digest sketch, assuming the sketch is "discrete" (e.g. if number of clusters <= maxDiscrete setting)
a quantile value. The value of q is expected to be on interval [0, 1]
the smallest value x such that q <= cdf(x)
Compute the inverse cumulative probability (inverse-CDF) for a quantile value, from the estimated probability distribution represented by this t-digest sketch.
Compute the inverse cumulative probability (inverse-CDF) for a quantile value, from the estimated probability distribution represented by this t-digest sketch.
a quantile value. The value of q is expected to be on interval [0, 1]
the value x such that cdf(x) = q
Perform a random sampling from the distribution as sketched by this t-digest, using "discrete" (PMF) mode if the number of clusters <= maxDiscrete setting, and "density" (PDF) mode otherwise.
Perform a random sampling from the distribution as sketched by this t-digest, using "discrete" (PMF) mode if the number of clusters <= maxDiscrete setting, and "density" (PDF) mode otherwise.
A random number sampled from the sketched distribution
uses the inverse transform sampling method
Perform a random sampling from the distribution as sketched by this t-digest, in "probability density" mode.
Perform a random sampling from the distribution as sketched by this t-digest, in "probability density" mode.
A random number sampled from the sketched distribution
uses the inverse transform sampling method
Perform a random sampling from the distribution as sketched by this t-digest, in "probability mass" (i.
Perform a random sampling from the distribution as sketched by this t-digest, in "probability mass" (i.e. discrete) mode.
A random number sampled from the sketched distribution
uses the inverse transform sampling method
A t-digest sketch of sampled numeric data, as described in: Computing Extremely Accurate Quantiles Using t-Digests, Ted Dunning and Otmar Ertl, https://github.com/tdunning/t-digest/blob/master/docs/t-digest-paper/histo.pdf