variance
Calculates variance for a non-empty array using the current Arith precision model.
API Reference
Signature
Parameters
Returns
Returns sum((x - mean)^2) / denominator, where denominator is n for population variance or n - 1 for sample variance.
Throws
- Throws if
valuesis not a non-empty array. - Throws if any value is non-finite.
- Throws if
sample: trueis used with fewer than two values. - Throws if
options.sampleis not boolean when provided.
Agent Contract
Agent Notes
- Population variance is the default.
- Pass
{ sample: true }only for sample variance.