Package net.royalur.stats
Enum Class SummaryStat
- All Implemented Interfaces:
Serializable
,Comparable<SummaryStat>
,Constable
A statistic that can be used to summarise a set of measurements.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe maximum of all the measurements.The mean of all the measurements.The median of all measurements.The minimum of all the measurements.The 25th percentile of measurements.The 5th percentile of measurements.The 75th percentile of measurements.The 95th percentile of measurements.The standard deviation of all the measurements.The sum of all the measurements.The variance of all the measurements. -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]
compute
(double[] measurements) Computes all summary statistics for the measurements inmeasurements
.static SummaryStat
Returns the enum constant of this class with the specified name.static SummaryStat[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MIN
The minimum of all the measurements. -
MAX
The maximum of all the measurements. -
SUM
The sum of all the measurements. -
MEAN
The mean of all the measurements. -
VARIANCE
The variance of all the measurements. -
STD_DEV
The standard deviation of all the measurements. -
MEDIAN
The median of all measurements. -
PERCENTILE_5
The 5th percentile of measurements. -
PERCENTILE_25
The 25th percentile of measurements. -
PERCENTILE_75
The 75th percentile of measurements. -
PERCENTILE_95
The 95th percentile of measurements.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
compute
public static double[] compute(double[] measurements) Computes all summary statistics for the measurements inmeasurements
. The indices into the returned array represent the ordinal of the SummaryStat enum entries.- Parameters:
measurements
- The measurements to summarise.- Returns:
- The summary statistics for the measurements in
measurements
.
-