var ( seq -- x )
Statistics
Prev:ste ( seq -- x )
Next:range ( seq -- x )


Vocabulary
math.statistics

Inputs and outputs
seqa sequence
xa non-negative real number


Word description
Computes the variance of seq. It's a measurement of the spread of values in a sequence. The larger the variance, the larger the distance of values from the mean.

Notes
If the number of elements in seq is 1 or less, it outputs 0.

Examples
USING: math.statistics prettyprint ; { 1 } var .
0

USING: math.statistics prettyprint ; { 1 2 3 } var .
1

USING: math.statistics prettyprint ; { 1 2 3 4 } var .
1+2/3


See also
population-var, sample-var

Definition
IN: math.statistics

ALIAS: var sample-var inline