Class FullStorageAccumulator
java.lang.Object
org.djutils.stats.summarizers.quantileaccumulator.FullStorageAccumulator
- All Implemented Interfaces:
QuantileAccumulator
Quantile accumulator that stores all values and computes exact (within a few ULP) results.
- Author:
- Peter Knoppers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getCumulativeProbability
(Tally tally, double quantile) Get, or estimate fraction of registered values between -infinity up to and including a given quantile.double
getQuantile
(Tally tally, double probability) Compute (or approximate) the value that corresponds to the given fraction (percentile).void
Reset (clear all accumulated information).double
register
(double value) Ingest one value with weight 1.toString()
-
Constructor Details
-
FullStorageAccumulator
public FullStorageAccumulator()Construct a new FullStorageAccumulator.
-
-
Method Details
-
register
public double register(double value) Description copied from interface:QuantileAccumulator
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 interfaceQuantileAccumulator
- Parameters:
value
- double; the value- Returns:
- double; the registered value
-
getQuantile
Description copied from interface:QuantileAccumulator
Compute (or approximate) the value that corresponds to the given fraction (percentile).- Specified by:
getQuantile
in 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
-
getCumulativeProbability
Description copied from interface:QuantileAccumulator
Get, or estimate fraction of registered values between -infinity up to and including a given quantile.- Specified by:
getCumulativeProbability
in interfaceQuantileAccumulator
- 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.
-
initialize
public void initialize()Description copied from interface:QuantileAccumulator
Reset (clear all accumulated information).- Specified by:
initialize
in interfaceQuantileAccumulator
-
toString
-