The current implementation works in our case, but we should refactor it (replace mean_and_std(... with std(a, weights=None, mean=None)) so that
- It's easier to use on its own
- Mean computation can still be reused (API similar to the new py3.4 statistics module)
- Make clear that dividing a weighted variance by n-1 doesn't give you an unbiased estimator (see 1, 2, 3). I think that for integer weights and ddof=0 the current approach is OK, though.
The current implementation works in our case, but we should refactor it (replace
mean_and_std(...withstd(a, weights=None, mean=None)) so that