Returns an accumulator function which incrementally computes an arithmetic mean.
accumulator function
var accumulator = incrmean();
var mu = accumulator();
// returns null
mu = accumulator( 2.0 );
// returns 2.0
mu = accumulator( 3.0 );
// returns 2.5
mu = accumulator( 4.0 );
// returns 3.0
mu = accumulator();
// returns 3.0
If provided a value, returns an updated arithmetic mean; otherwise, returns the current arithmetic mean.
Notes
NaN
or a value which, when used in computations, results inNaN
, the accumulated value isNaN
for all future invocations.value
arithmetic mean