sampleVariance
sampleVariance(
x):number
Defined in: src/sample_variance.js:20
The sample variance is the sum of squared deviations from the mean. The sample variance is distinguished from the variance by the usage of Bessel’s Correction: instead of dividing the sum of squared deviations by the length of the input, it is divided by the length minus one. This corrects the bias in estimating a value from a set that you don’t know if full.
References:
Parameters
Section titled “Parameters”number[]
a sample of two or more data points
Returns
Section titled “Returns”number
sample variance
Throws
Section titled “Throws”if the length of x is less than 2
Example
Section titled “Example”sampleVariance([1, 2, 3, 4, 5]); // => 2.5