Abstract
Statistics functions parameterised over the concrete representation of reals.
Synopsis
module type statistics = {
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| module mk_statistics | : | (R: float) -> statistics with t = R.t | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
- ↑module type statistics
- ↑type t
The type of scalars that the functions operate on.
- ↑val mean [n]: [n]t -> t
mean vsreturns the arithmetic mean of the values contained invs.- ↑val gmean [n]: [n]t -> t
gmean vsreturns the geometric mean of the values contained invs.- ↑val hmean [n]: [n]t -> t
hmean vsreturns the harmonic mean of the values contained invs.- ↑val qmean [n]: [n]t -> t
qmean vsreturns the quadratic mean of the values contained invs. Also known as "root mean square".- ↑val variance [n]: [n]t -> t
variance vsreturns the sample variance of the values contained invs. The sample variance is the square of the sample standard deviation.- ↑val stddev [n]: [n]t -> t
stddev vsreturns the sample standard deviation of the values contained invs. The sample standard deviation is the square root of the sample variance.- ↑val covariance [n]: [n]t -> [n]t -> t
covariance xs ysreturns the sample covariance between the values contained inxsandys.- ↑val correlation [n]: [n]t -> [n]t -> t
correlation xs ysreturns the sample (Pearson) correlation between the values contained inxsandys.- ↑val variance_pop [n]: [n]t -> t
variance_pop vsreturns the population variance of the values contained invs. The population variance is the square of the population standard deviation.- ↑val stddev_pop [n]: [n]t -> t
stddev_pop vsreturns the population standard deviation of the values contained invs. The population standard deviation is the square root of the population variance.- ↑val skewness [n]: [n]t -> t
skewness vsreturns the skewness of the values contained invs. The skewness measures the assymetry of the values invs. If the skewness is positive, the upper tail is thicker than the lower tail, whereas, if the skewness is negative, the lower tail is thicker than the upper tail. The skewness of a set of normally distributed values is zero.- ↑val skewness_adj [n]: [n]t -> t
skewness_adj vsreturns the adjusted Fisher-Pearson coefficient of skewness for the values contained invs.- ↑val kurtosis [n]: [n]t -> t
kurtosis vsreturns the (non-excess) kurtosis of the values contained invs.- ↑val kurtosis_excess [n]: [n]t -> t
kurtosis_excess vsreturns the excess kurtosis of the values contained invs.- ↑val median [n]: [n]t -> t
Median value of array.
- ↑val median_sorted [n]: [n]t -> t
Median value of sorted array.
- ↑val quantile [n]: [n]t -> t -> t
Quantile of array.
- ↑val quantile_sorted [n]: [n]t -> t -> t
Quantile of sorted array.
- ↑val mode [n]: [n]t -> t
The most frequently occuring element of an array.
- ↑val mode_sorted [n]: [n]t -> t
The most frequently occuring element of a sorted array.
- ↑type regression_result = {beta: t, mu: t}
betais the slope andmuis the mean.- ↑val regress [n]: [n]t -> [n]t -> regression_result
Linear regression in two variables.
- ↑val erf: t -> t
erf xreturns a polynomial approximation to the Gauss error function applied tox. The maximal approximation error is 0.00000012 for any argumentx.- ↑val gamma: t -> t
gamma xreturns the value(x-1)!for positive integer valuesx. Extended to work for positive non-integer values.- ↑val gammaln: t -> t
gammaln xreturnsln((x-1)!), extended to work with positive non-integer values. Notice thatgammalnis numerically stable in contrast to calculatinglog(gamma x)with largexs.- ↑type^ dist 'a
Generic type for distributions. Discrete distributions have type
dist i32, whereas continuous distributions have typedist t.- ↑val mk_poison: {lambda: t} -> dist i32
- ↑val mk_normal: {mu: t, sigma: t} -> dist t
- ↑val mk_uniform: {a: t, b: t} -> dist t
- ↑val pmf: dist i32 -> i32 -> t
- ↑val pdf: dist t -> t -> t
- ↑val cdf 'a: dist a -> a -> t
- ↑val sample 'a: dist a -> t -> a
sample d rreturns a sample from the distributiondgiven a real valuertaken from a uniform distribution U(0,1).
- ↑module mk_statistics