repl.txt (1181B)
1 2 {{alias}}( W[, mean] ) 3 Returns an accumulator function which incrementally computes a moving 4 variance-to-mean (VMR). 5 6 The `W` parameter defines the number of values over which to compute the 7 moving variance-to-mean ratio. 8 9 If provided a value, the accumulator function returns an updated moving 10 variance-to-mean ratio. If not provided a value, the accumulator function 11 returns the current moving variance-to-mean ratio. 12 13 As `W` values are needed to fill the window buffer, the first `W-1` returned 14 values are calculated from smaller sample sizes. Until the window is full, 15 each returned value is calculated from all provided values. 16 17 Parameters 18 ---------- 19 W: integer 20 Window size. 21 22 mean: number (optional) 23 Known mean. 24 25 Returns 26 ------- 27 acc: Function 28 Accumulator function. 29 30 Examples 31 -------- 32 > var accumulator = {{alias}}( 3 ); 33 > var F = accumulator() 34 null 35 > F = accumulator( 2.0 ) 36 0.0 37 > F = accumulator( 1.0 ) 38 ~0.33 39 > F = accumulator( 3.0 ) 40 0.5 41 > F = accumulator( 7.0 ) 42 ~2.55 43 > F = accumulator() 44 ~2.55 45 46 See Also 47 -------- 48