Instance Method
sampleVariance()
The sample variance of the collection.
func sampleVariance() -> Self.Element.Stride
Return Value
The sample variance: $$\frac{1}{n-1} \sum_{i=1}^n \lVert x_i - \mu\rVert^2$$ where $n$ is the collection’s count and $\lVert x_i - \mu\rVert$ is the Euclidean distance from each element $x_i$ to the sample mean $\mu$.
Discussion
The sample variance is similar to the population variance, but with $n - 1$ in the denominator instead of $n$ (where $n$ is the size of the collection). As a result,
The sample variance is always slightly greater than the population variance.
The sample variance better estimates the variance of the population (or the ProbabilityDistribution) from which the values were sampled.