Returns an accumulator function which incrementally computes a moving variance-to-mean ratio (VMR).
window size
mean value
accumulator function
var accumulator = incrmvmr( 3 );
var F = accumulator();
// returns null
F = accumulator( 2.0 );
// returns 0.0
F = accumulator( 1.0 );
// returns ~0.33
F = accumulator( 3.0 );
// returns 0.5
F = accumulator( 7.0 );
// returns ~2.55
F = accumulator();
// returns ~2.55
var accumulator = incrmvmr( 3, 2.0 );
If provided a value, the accumulator function returns an updated accumulated value. If not provided a value, the accumulator function returns the current accumulated value.
Notes
NaN
or a value which, when used in computations, results inNaN
, the accumulated value isNaN
for all future invocations.value
accumulated value or null