agi.foundation
(agi.foundation.core-2019r4.jar)

Class DescriptiveStatistics

• ```public final class DescriptiveStatistics
extends Object```
Provides descriptive statistic methods.
• Method Summary

All Methods
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.
• Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• Method Detail

• rootMeanSquare

```public static double rootMeanSquare(@Nonnull
List<Double> dataList)```
Calculates the root mean square (RMS) of a list of doubles.
Parameters:
`dataList` - The list of doubles to use to calculate the RMS.
Returns:
The root mean square value.
Throws:
`ArgumentNullException` - Thrown when `dataList` is `null`.
`ArgumentException` - Thrown when `dataList` is empty.
• mean

```public static double mean(@Nonnull
List<Double> dataList)```
Calculates the mean of a list of doubles.
Parameters:
`dataList` - The list of doubles to use to calculate the mean.
Returns:
The mean value.
Throws:
`ArgumentNullException` - Thrown when `dataList` is `null`.
`ArgumentException` - Thrown when `dataList` is empty.
• median

```public static double median(@Nonnull
List<Double> dataList)```
Calculates the median of a list of doubles.
Parameters:
`dataList` - The list of doubles to use to calculate the median.
Returns:
The median value.
Throws:
`ArgumentNullException` - Thrown when `dataList` is `null`.
`ArgumentException` - Thrown when `dataList` is empty.
• standardDeviation

```public static double standardDeviation(@Nonnull
List<Double> dataList)```
Calculates the standard deviation of a list of doubles.
Parameters:
`dataList` - The list of doubles to use to calculate the standard deviation.
Returns:
The standard deviation value.
Throws:
`ArgumentNullException` - Thrown when `dataList` is `null`.
`ArgumentException` - Thrown when `dataList` is empty.
• standardDeviationNMinusOne

```public static double standardDeviationNMinusOne(@Nonnull
List<Double> dataList)```
Calculates the standard deviation of a list of doubles using the N-1 algorithm. If `dataList` has one element, returns `DescriptiveStatistics.standardDeviation(List)`.
Parameters:
`dataList` - The list of doubles to use to calculate the standard deviation (N-1).
Returns:
The (N-1) standard deviation value.
Throws:
`ArgumentNullException` - Thrown when `dataList` is `null`.
`ArgumentException` - Thrown when `dataList` is empty.
• standardError

```public static double standardError(@Nonnull
List<Double> dataList)```
The standard error is the Standard deviation of the mean. This implementation uses the `DescriptiveStatistics.standardDeviationNMinusOne(List)` method.
Parameters:
`dataList` - The list of doubles to use to calculate the standard error.
Returns:
The standard error value.
Throws:
`ArgumentNullException` - Thrown when `dataList` is `null`.
`ArgumentException` - Thrown when `dataList` is empty.
• percentile

```public static <T> T percentile(@Nonnull
List<T> dataList,
double percentile)```
Returns the nth percentile value from the list. The list is assumed to be sorted.
Type Parameters:
`T` - The type of element in the list.
Parameters:
`dataList` - The sorted list from which to find the nth value.
`percentile` - The percentile you seek (1-100).
Returns:
The nth percentile value from the sorted list.
Throws:
`ArgumentNullException` - Thrown when `dataList` is `null`.
`ArgumentException` - Thrown when `dataList` is empty.
`ArgumentOutOfRangeException` - Thrown when the parameter `percentile` is not between 1 and 100.