public final class DescriptiveStatistics extends Object
| Modifier and Type | Method and Description |
|---|---|
static double |
mean(List<Double> dataList)
Calculates the mean of a list of doubles.
|
static double |
median(List<Double> dataList)
Calculates the median of a list of doubles.
|
static <T> T |
percentile(List<T> dataList,
double percentile)
Returns the nth percentile value from the list.
|
static double |
rootMeanSquare(List<Double> dataList)
Calculates the root mean square (RMS) of a list of doubles.
|
static double |
standardDeviation(List<Double> dataList)
Calculates the standard deviation of a list of doubles.
|
static double |
standardDeviationNMinusOne(List<Double> dataList)
Calculates the standard deviation of a list of doubles using the N-1 algorithm.
|
static double |
standardError(List<Double> dataList)
The standard error is the Standard deviation of the mean.
|
public static double rootMeanSquare(@Nonnull List<Double> dataList)
dataList - The list of doubles to use to calculate the RMS.ArgumentNullException - Thrown when dataList is null.ArgumentException - Thrown when dataList is empty.public static double mean(@Nonnull List<Double> dataList)
dataList - The list of doubles to use to calculate the mean.ArgumentNullException - Thrown when dataList is null.ArgumentException - Thrown when dataList is empty.public static double median(@Nonnull List<Double> dataList)
dataList - The list of doubles to use to calculate the median.ArgumentNullException - Thrown when dataList is null.ArgumentException - Thrown when dataList is empty.public static double standardDeviation(@Nonnull List<Double> dataList)
dataList - The list of doubles to use to calculate the standard deviation.ArgumentNullException - Thrown when dataList is null.ArgumentException - Thrown when dataList is empty.public static double standardDeviationNMinusOne(@Nonnull List<Double> dataList)
dataList
has one element, returns DescriptiveStatistics.standardDeviation(List).dataList - The list of doubles to use to calculate the standard deviation (N-1).ArgumentNullException - Thrown when dataList is null.ArgumentException - Thrown when dataList is empty.public static double standardError(@Nonnull List<Double> dataList)
DescriptiveStatistics.standardDeviationNMinusOne(List) method.dataList - The list of doubles to use to calculate the standard error.ArgumentNullException - Thrown when dataList is null.ArgumentException - Thrown when dataList is empty.public static <T> T percentile(@Nonnull List<T> dataList, double percentile)
T - The type of element in the list.dataList - The sorted list from which to find the nth value.percentile - The percentile you seek (1-100).ArgumentNullException - Thrown when dataList is null.ArgumentException - Thrown when dataList is empty.ArgumentOutOfRangeException - Thrown when the parameter percentile is not between 1 and 100.