### Use more efficient statistics for the standard deviation

Instead of using the full sample as statistics providing enough information to compute the standard deviation, use a slightly more elaborate one. It contains the standard statistics count, sum, and sum of squares, which can also very easily be updated. However, computing the standard deviation from these values unfortunately is not precise enough for our purpose (small difference of large values). Therefore, we also carry the naively computed variance in the statistics. The latter can also be updated using the standard statistics and, moreover, this can be done in a way that does not introduce too large inaccuracies for a small number of updates. Signed-off-by: Klaus Aehlig <aehlig@google.com> Reviewed-by: Petr Pudlak <pudlak@google.com>

Showing

Please register or sign in to comment