Returns an accumulator function which incrementally computes an exponentially weighted mean.
smoothing factor
accumulator function
var accumulator = increwmean( 0.5 );
var v = accumulator();
// returns null
v = accumulator( 2.0 );
// returns 2.0
v = accumulator( -5.0 );
// returns -1.5
v = accumulator();
// returns -1.5
If provided a value, the accumulator function returns an updated mean. If not provided a value, the accumulator function returns the current mean.
Notes
NaN
or a value which, when used in computations, results inNaN
, the accumulated value isNaN
for all future invocations.value
mean value