Class FullStorageAccumulator
java.lang.Object
org.djutils.stats.summarizers.quantileaccumulator.FullStorageAccumulator
- All Implemented Interfaces:
QuantileAccumulator
public class FullStorageAccumulator extends Object implements QuantileAccumulator
Quantile accumulator that stores all values and computes exact (within a few ULP) results.
- Author:
- Peter Knoppers
-
Constructor Summary
Constructors Constructor Description FullStorageAccumulator()Construct a new FullStorageAccumulator. -
Method Summary
Modifier and Type Method Description doublegetQuantile(Tally tally, double probability)Compute (or approximate) the value that corresponds to the given fraction (percentile).doubleingest(double value)Ingest one value with weight 1.voidinitialize()Reset (clear all accumulated information).StringtoString()
-
Constructor Details
-
FullStorageAccumulator
public FullStorageAccumulator()Construct a new FullStorageAccumulator.
-
-
Method Details
-
ingest
public double ingest(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:
ingestin interfaceQuantileAccumulator- Parameters:
value- double; the value- Returns:
- double; the ingested value
-
getQuantile
Compute (or approximate) the value that corresponds to the given fraction (percentile).- Specified by:
getQuantilein interfaceQuantileAccumulator- 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
-
initialize
public void initialize()Reset (clear all accumulated information).- Specified by:
initializein interfaceQuantileAccumulator
-
toString
-