Module Sample

module Sample: sig .. end
Commonly used sample statistics.

val min : float array -> float
val max : float array -> float
val minmax : float array -> float * float
val range : float array -> float
O(n) Computes sample's range, i. e. the difference between the largest and smallest elements of a sample.
val moments : int -> float array -> float array
O(n k) Computes an array of sample moments of order 1 to k, i. e. E{X^1}, E{X^2}, ..., E{X^k}.
val mean : float array -> float
O(n) Computes sample's arithmetic mean.
val variance : ?mean:float -> float array -> float
O(n) Computes unbiased estimate of a sample's variance, also known as the sample variance, where the denominator is n - 1.
val sd : ?mean:float -> float array -> float
O(n) Computes sample's standard deviation.
val skewness : ?mean:float -> ?sd:float -> float array -> float
O(n) Computes the skewness of a sample, which is a measure of asymmetry of its distribution.
val kurtosis : ?mean:float -> ?sd:float -> float array -> float
O(n) Computes the excess kurtosis of a sample, which is a measure of a "peakedness" of its distribution.
val rank : ?ties_strategy:[ `Average | `Max | `Min ] ->
?cmp:('a -> 'a -> int) -> 'a array -> float * float array
O(n log n) Computes sample's ranks, ties_strategy controls which ranks are assigned to equal values:

Returns a pair, where the first element is ties correction factor and second is an array of sample ranks.

References

  1. P. R. Freeman, "Algorithm AS 26: Ranking an array of numbers", Vol. 19, Applied Statistics, pp111-113, 1970.

val histogram : ?n_bins:int ->
?range:float * float ->
?weights:float array ->
?density:bool -> float array -> float array * float array
O(n) Computes histogram of a data set. Bin sizes are uniform, based on a given range, whic defaults to (min - k, max + k), where k = (min - max) / (bins - 1) * 2. This behaviour is copied from the excellent statistics library by Brian O'Sullivan.
module Quantile: sig .. end
val quantile : ps:float array -> float array -> float array
O(n log n) Estimates sample quantile corresponding to the given probability p, using the continuous sample method with default parameters.
val iqr : float array -> float
O(n log n) Estimates interquantile range of a given sample, using the continuous sample method with given parameters.
module KDE: sig .. end
module Correlation: sig .. end
module Summary: sig .. end
Calculates summary statistics over a possibly infinite stream of data.