Interface QuantileAccumulator
- All Known Implementing Classes:
FixedBinsAccumulator,FullStorageAccumulator,NoStorageAccumulator,TDigestAccumulator
public interface QuantileAccumulator
Interface for quantile accumulator.
- Author:
- Peter Knoppers
-
Method Summary
Modifier and TypeMethodDescriptiondoublegetCumulativeProbability(Tally tally, double quantile) Get, or estimate fraction of registered values between -infinity up to and including a given quantile.doublegetQuantile(Tally tally, double probability) Compute (or approximate) the value that corresponds to the given fraction (percentile).voidReset (clear all accumulated information).doubleregister(double value) Ingest one value with weight 1.
-
Method Details
-
register
double register(double value) Ingest one value with weight 1. Should be called only from the Tally object and AFTER processing the value in the tally.- Parameters:
value- the value- Returns:
- the registered value
- Throws:
IllegalArgumentException- when the registered value is NaN
-
getQuantile
Compute (or approximate) the value that corresponds to the given fraction (percentile).- Parameters:
tally- the tally object that accumulates mean, minimum, maximum, count, etc.probability- value between 0.0 and 1.0 (both inclusive)- Returns:
- the computed or approximated quantile value
- Throws:
IllegalArgumentException- when the probability is less than 0 or larger than 1NullPointerException- when tally is null
-
getCumulativeProbability
Get, or estimate fraction of registered values between -infinity up to and including a given quantile.- Parameters:
tally- the tally object that accumulates mean, minimum, maximum, count, etc.quantile- the given quantile- Returns:
- the estimated or observed fraction of registered values between -infinity up to and including the given quantile. When this QuantileAccumulator has registered zero values; this method shall return NaN.
- Throws:
IllegalArgumentException- when quantile is NaN
-
initialize
void initialize()Reset (clear all accumulated information).
-