repl.txt (1401B)
1 2 {{alias}}( iterator, W ) 3 Returns an iterator which iteratively computes a moving arithmetic mean of 4 squared absolute values. 5 6 The `W` parameter defines the number of iterated values over which to 7 compute the moving mean of squared absolute values. 8 9 As `W` values are needed to fill the window buffer, the first `W-1` returned 10 values are calculated from smaller sample sizes. Until the window is full, 11 each returned value is calculated from all previously iterated values. 12 13 If an environment supports Symbol.iterator, the returned iterator is 14 iterable. 15 16 Parameters 17 ---------- 18 iterator: Object 19 Input iterator. 20 21 W: integer 22 Window size. 23 24 Returns 25 ------- 26 iterator: Object 27 Iterator. 28 29 iterator.next(): Function 30 Returns an iterator protocol-compliant object containing the next 31 iterated value (if one exists) and a boolean flag indicating whether the 32 iterator is finished. 33 34 iterator.return( [value] ): Function 35 Finishes an iterator and returns a provided value. 36 37 Examples 38 -------- 39 > var arr = {{alias:@stdlib/array/to-iterator}}( [ 2.0, -5.0, 3.0, 5.0 ] ); 40 > var it = {{alias}}( arr, 3 ); 41 > var m = it.next().value 42 4.0 43 > m = it.next().value 44 14.5 45 > m = it.next().value 46 ~12.67 47 > m = it.next().value 48 ~19.67 49 50 See Also 51 -------- 52