xs:the parameters can be a mix of floating values or previous results of calls to welford_variance or a tuple of them
Return value
A struct containing The value of the arithmetic mean (average), the centered moment of order 2 (m2), the (sample) variance value normalized by the number of elements involved (variance) and the number of elements (count) involved is returned.
This struct is convertble to the variance floating value. and possess four fields variance, averagem2 and count.
The computation is made on the tuples elements
The computation and result use the upgraded data type if available
with this option the normalisation is done by by the number of elements involved, minus one. This provides the best unbiased estimator of the variance (population variance).
Note
The Welford algorithm does not provides as much option as the variance function, but is a quite stable algorithm that have the advantage to allow splitting the computation of the variance in multiple calls. For instance: the call with two tuples: wv = welford_corariance(kumi::cat(xs, ys))
is equivalent to the sequence: wxs = welford_variance(xs); wys = welford_variance(xs); wv = welford_variance(wxs, wys);
But the first two instructions can easily be executed in parallel.