Class TDigestAccumulator

    • Field Detail

      • DEFAULT_COMPRESSION

        public static final int DEFAULT_COMPRESSION
        The compression used by the parameter-less constructor.
        See Also:
        Constant Field Values
    • Constructor Detail

      • TDigestAccumulator

        public TDigestAccumulator​(int compression)
        Construct a new TDigestAccumulator.
        Parameters:
        compression - int; the number of bins to compress the data into
      • TDigestAccumulator

        public TDigestAccumulator()
        Construct a new TDigestAccumulator with compression set to DEFAULT_COMPRESSION.
    • Method Detail

      • register

        public 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.
        Specified by:
        register in interface QuantileAccumulator
        Parameters:
        value - double; the value
        Returns:
        double; the registered value
      • getQuantile

        public double getQuantile​(Tally tally,
                                  double probability)
        Compute (or approximate) the value that corresponds to the given fraction (percentile).
        Specified by:
        getQuantile in interface QuantileAccumulator
        Parameters:
        tally - Tally; the tally object that accumulates mean, minimum, maximum, count, etc.
        probability - double; value between 0.0 and 1.0 (both inclusive)
        Returns:
        double; the computed or approximated quantile value
      • getCumulativeProbability

        public double getCumulativeProbability​(Tally tally,
                                               double quantile)
        Get, or estimate fraction of registered values between -infinity up to and including a given quantile.
        Specified by:
        getCumulativeProbability in interface QuantileAccumulator
        Parameters:
        tally - Tally; the tally object that accumulates mean, minimum, maximum, count, etc.
        quantile - double; the given quantile
        Returns:
        double; 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.