Stats

mean : List (Num *) -> Result F64 [ListWasEmpty]

The arithmetic mean of a list x is defined as the sum of the elements of x divided by the number of elements in x.

For a version of this function that silently returns NaN when the input list is empty, see meanUnchecked.

meanUnchecked : List (Num *) -> F64

A version of mean that silently returns NaN when the input list is empty.

variance : List (Num *) -> Result F64 [ListWasEmpty]

The unbiased sample variance of a list of numbers.

Defined as S² = ∑(x - x̄)² / (n − 1).

varianceUnchecked : List (Num *) -> F64

A version of the variance function that silently returns NaN when the input list is empty.

varianceWithMean : List (Num *), F64 -> F64

A version of the variance function that uses a pre-calculated mean value for efficiency.

meanAndVariance : List (Num *) -> Result ( F64, F64 ) [ListWasEmpty]

A function that calculates both the mean and variance of a list at the same time. This is more efficient than calculating both values separately.

meanAndVarianceUnchecked : List (Num *) -> ( F64, F64 )

A function that calculates both the mean and variance of a list at the same time. This is more efficient than calculating both values separately.

standardDeviation : List (Num *) -> Result F64 [ListWasEmpty]

The corrected sample standard deviation of a list of numbers.

nthSampleMoment : List (Num *), U64 -> Result F64 [ListWasEmpty]

The n-th sample moment of a list of numbers.

nthSampleMomentUnchecked : List (Num *), U64 -> F64

The n-th sample moment of a list of numbers that silently returns NaN when the input list is empty.

nthSampleMomentWithMean : List (Num *), U64, F64 -> F64

The n-th sample moment of a list of numbers, given a pre-calculated mean.

median : List (Num *) -> Result F64 [ListWasEmpty]

The median of a list of numbers.

medianUnchecked : List (Num *) -> F64

A version of the median function that silently returns NaN when the input list is empty.

range : List (Num a) -> Result (Num a) [ListWasEmpty]

The difference between the maximum and minimum values in a list.