variance
variance(
x):number
Defined in: src/variance.js:17
The variance is the sum of squared deviations from the mean.
This is an implementation of variance, not sample variance:
see the sampleVariance method if you want a sample measure.
Parameters
Section titled “Parameters”number[]
a population of one or more data points
Returns
Section titled “Returns”number
variance: a value greater than or equal to zero. zero indicates that all values are identical.
Throws
Section titled “Throws”if x’s length is 0
Example
Section titled “Example”variance([1, 2, 3, 4, 5, 6]); // => 2.9166666666666665