Calculates the arithmetic mean of the values of the passed-in numbers.
Calculates the arithmetic mean of the values of the passed-in numbers.
the numbers on which to operate
the arithmetic mean
Calculates the geometric mean of the values of the passed-in numbers, namely, the n-th root of (x1 * x2 * .
Calculates the geometric mean of the values of the passed-in numbers, namely, the n-th root of (x1 * x2 * ... * xn). Note that all numbers used in the calculation of a geometric mean must be positive.
For a discussion of when a geometric mean is more suitable than an arithmetic mean, see http://www.math.toronto.edu/mathnet/questionCorner/geomean.html.
the numbers on which to operate
the geometric mean
Calculates the harmonic mean of the values of the passed-in
numbers, namely: n / (1/x1 + 1/x2 + ... + 1/xn).
Calculates the harmonic mean of the values of the passed-in
numbers, namely: n / (1/x1 + 1/x2 + ... + 1/xn).
the numbers on which to operate
the harmonic mean
Synonym for arithmeticMean
.
Synonym for arithmeticMean
.
arithmeticMean
Calculates the median of the values of the passed-in numbers.
Calculates the median of the values of the passed-in numbers.
the numbers on which to operate
the median
Calculates the mode (most common value(s)) of the values of the passed-in numbers.
Calculates the mode (most common value(s)) of the values of the passed-in numbers. If there are multiple common values, they're all returned.
the numbers on which to operate
list of modal values
Shorter synonym for populationStandardDeviation
.
Shorter synonym for populationStandardDeviation
.
populationStandardDeviation
Calculate the population standard deviation of the specified values.
Calculate the population standard deviation of the specified values. The population standard deviation is merely the square root of the population variance. Thus, this function is just shorthand for:
java.lang.Math.sqrt(populationVariance(items))
the numbers on which to operate
the standard deviation
Calculate the population variance of the finite population defined
by the items
arguments.
Calculate the population variance of the finite population defined
by the items
arguments. The population variance is defined as:
1 - * SUM(i=1, N) { (x[i] - mean)^2^ } N
See:
- http://en.wikipedia.org/wiki/Variance#Population_variance_and_sample_variance - http://www.quickmba.com/stats/standard-deviation/
the numbers on which to operate
the variance
Calculate the range of a data set.
Calculate the range of a data set. This function does a single linear pass over the data set.
the numbers on which to operate
the range
Calculate the sample standard deviation of the specified values.
Calculate the sample standard deviation of the specified values. The sample standard deviation is merely the square root of the sample variance. Thus, this function is just shorthand for:
java.lang.Math.sqrt(sampleVariance(items))
the numbers on which to operate
the standard deviation
Shorter synonym for sampleStandardDeviation
.
Shorter synonym for sampleStandardDeviation
.
populationStandardDeviation
Calculate the unbiased sample variance of the finite sample defined
by the items
arguments.
Calculate the unbiased sample variance of the finite sample defined
by the items
arguments. The sample variance is defined as:
1 ----- * SUM(i=1, N) { (x[i] - sampleMean)^2^ } N - 1
See:
- http://en.wikipedia.org/wiki/Variance#Population_variance_and_sample_variance - http://www.quickmba.com/stats/standard-deviation/
the numbers on which to operate
the variance
Miscellaneous statistics-related functions.
Note: You must import
scala.math.Numeric
(or justNumeric._
) for these functions to work. For example: