42 lines
956 B
Plaintext
42 lines
956 B
Plaintext
|
|
||
|
{{alias}}( [out] )
|
||
|
Returns an accumulator function which incrementally computes an arithmetic
|
||
|
mean and unbiased sample variance.
|
||
|
|
||
|
If provided a value, the accumulator function returns updated accumulated
|
||
|
values. If not provided a value, the accumulator function returns the
|
||
|
current accumulated values.
|
||
|
|
||
|
If provided `NaN`, the accumulated values are equal to `NaN` for all future
|
||
|
invocations.
|
||
|
|
||
|
Parameters
|
||
|
----------
|
||
|
out: Array|TypedArray (optional)
|
||
|
Output array.
|
||
|
|
||
|
Returns
|
||
|
-------
|
||
|
acc: Function
|
||
|
Accumulator function.
|
||
|
|
||
|
Examples
|
||
|
--------
|
||
|
> var accumulator = {{alias}}();
|
||
|
> var mv = accumulator()
|
||
|
null
|
||
|
> mv = accumulator( 2.0 )
|
||
|
[ 2.0, 0.0 ]
|
||
|
> mv = accumulator( -5.0 )
|
||
|
[ -1.5, 24.5 ]
|
||
|
> mv = accumulator( 3.0 )
|
||
|
[ 0.0, 19.0 ]
|
||
|
> mv = accumulator( 5.0 )
|
||
|
[ 1.25, ~18.92 ]
|
||
|
> mv = accumulator()
|
||
|
[ 1.25, ~18.92 ]
|
||
|
|
||
|
See Also
|
||
|
--------
|
||
|
|