repl.txt (956B)
1 2 {{alias}}( [mx, my] ) 3 Returns an accumulator function which incrementally computes a sample 4 Pearson product-moment correlation coefficient. 5 6 If provided values, the accumulator function returns an updated sample 7 correlation coefficient. If not provided values, the accumulator function 8 returns the current sample correlation coefficient. 9 10 If provided `NaN` or a value which, when used in computations, results in 11 `NaN`, the accumulated value is `NaN` for all future invocations. 12 13 Parameters 14 ---------- 15 mx: number (optional) 16 Known mean. 17 18 my: number (optional) 19 Known mean. 20 21 Returns 22 ------- 23 acc: Function 24 Accumulator function. 25 26 Examples 27 -------- 28 > var accumulator = {{alias}}(); 29 > var r = accumulator() 30 null 31 > r = accumulator( 2.0, 1.0 ) 32 0.0 33 > r = accumulator( -5.0, 3.14 ) 34 ~-1.0 35 > r = accumulator() 36 ~-1.0 37 38 See Also 39 -------- 40