Class TDigestAccumulator
java.lang.Object
org.djutils.stats.summarizers.quantileaccumulator.TDigestAccumulator
- All Implemented Interfaces:
QuantileAccumulator
TDigestAccumulator.java.
Copyright (c) 2020-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html.
Copyright (c) 2020-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe compression used by the parameter-less constructor. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new TDigestAccumulator with compression set toDEFAULT_COMPRESSION.TDigestAccumulator(int compression) Construct a new TDigestAccumulator. -
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.final StringtoString()
-
Field Details
-
DEFAULT_COMPRESSION
public static final int DEFAULT_COMPRESSIONThe compression used by the parameter-less constructor.- See Also:
-
-
Constructor Details
-
TDigestAccumulator
public TDigestAccumulator(int compression) Construct a new TDigestAccumulator.- Parameters:
compression- the number of bins to compress the data into
-
TDigestAccumulator
public TDigestAccumulator()Construct a new TDigestAccumulator with compression set toDEFAULT_COMPRESSION.
-
-
Method Details
-
register
public double register(double value) Description copied from interface:QuantileAccumulatorIngest one value with weight 1. Should be called only from the Tally object and AFTER processing the value in the tally.- Specified by:
registerin interfaceQuantileAccumulator- Parameters:
value- the value- Returns:
- the registered value
-
getQuantile
Description copied from interface:QuantileAccumulatorCompute (or approximate) the value that corresponds to the given fraction (percentile).- Specified by:
getQuantilein interfaceQuantileAccumulator- 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
-
getCumulativeProbability
Description copied from interface:QuantileAccumulatorGet, or estimate fraction of registered values between -infinity up to and including a given quantile.- Specified by:
getCumulativeProbabilityin interfaceQuantileAccumulator- 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.
-
initialize
public void initialize()Description copied from interface:QuantileAccumulatorReset (clear all accumulated information).- Specified by:
initializein interfaceQuantileAccumulator
-
toString
-