| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Factory.Math.Statistics
Contents
Description
AUTHOR- Dr. Alistair Ward
 DESCRIPTION- Miscellaneous statistics functions.
 
Synopsis
- getMean :: (Foldable foldable, Fractional result, Real value) => foldable value -> result
 - getRootMeanSquare :: (Foldable foldable, Floating result, Real value) => foldable value -> result
 - getWeightedMean :: (Foldable foldable, Fractional result, Real value, Real weight) => foldable (value, weight) -> result
 - getVariance :: (Foldable foldable, Fractional variance, Functor foldable, Real value) => foldable value -> variance
 - getStandardDeviation :: (Foldable foldable, Floating result, Functor foldable, Real value) => foldable value -> result
 - getAverageAbsoluteDeviation :: (Foldable foldable, Fractional result, Functor foldable, Real value) => foldable value -> result
 - getCoefficientOfVariance :: (Foldable foldable, Eq result, Floating result, Functor foldable, Real value) => foldable value -> result
 - nCr :: (Algorithmic factorialAlgorithm, Integral i, Show i) => factorialAlgorithm -> i -> i -> i
 - nPr :: (Integral i, Show i) => i -> i -> i
 
Functions
getMean :: (Foldable foldable, Fractional result, Real value) => foldable value -> result Source #
- Determines the mean of the specified numbers; https://en.wikipedia.org/wiki/Mean.
 - Should the caller define the result-type as 
Rational, then it will be free from rounding-errors. 
getRootMeanSquare :: (Foldable foldable, Floating result, Real value) => foldable value -> result Source #
Determines the root mean square of the specified numbers; https://en.wikipedia.org/wiki/Root_mean_square.
Arguments
| :: (Foldable foldable, Fractional result, Real value, Real weight) | |
| => foldable (value, weight) | Each pair consists of a value & the corresponding weight.  | 
| -> result | 
- Determines the weighted mean of the specified numbers; https://en.wikipedia.org/wiki/Weighted_arithmetic_mean.
 - The specified value is only evaluated if the corresponding weight is non-zero.
 - CAVEAT: because the operand is more general than a list, no optimisation is performed when supplied a singleton.
 
getVariance :: (Foldable foldable, Fractional variance, Functor foldable, Real value) => foldable value -> variance Source #
- Determines the exact variance of the specified numbers; https://en.wikipedia.org/wiki/Variance.
 - Should the caller define the result-type as 
Rational, then it will be free from rounding-errors. 
getStandardDeviation :: (Foldable foldable, Floating result, Functor foldable, Real value) => foldable value -> result Source #
Determines the standard-deviation of the specified numbers; https://en.wikipedia.org/wiki/Standard_deviation.
getAverageAbsoluteDeviation :: (Foldable foldable, Fractional result, Functor foldable, Real value) => foldable value -> result Source #
- Determines the average absolute deviation of the specified numbers; https://en.wikipedia.org/wiki/Absolute_deviation#Average_absolute_deviation.
 - Should the caller define the result-type as 
Rational, then it will be free from rounding-errors. 
getCoefficientOfVariance :: (Foldable foldable, Eq result, Floating result, Functor foldable, Real value) => foldable value -> result Source #
Determines the coefficient-of-variance of the specified numbers; https://en.wikipedia.org/wiki/Coefficient_of_variation.
Arguments
| :: (Algorithmic factorialAlgorithm, Integral i, Show i) | |
| => factorialAlgorithm | |
| -> i | The total number of items from which to select.  | 
| -> i | The number of items in a sample.  | 
| -> i | The number of combinations.  | 
The number of unordered combinations of r objects taken from n; https://en.wikipedia.org/wiki/Combination.