Vinzent Steinberg
9bf56690e6
Make sure quantile works for small samples
Before it was returning wrong results for samples with less than 5 elements. Also mention that average and quantile will be 0 for empty samples.
average
Calculate the average of a sequence and its error iteratively in a single pass,
using constant memory and avoiding numerical problems. The calculation can be
easily parallelized by using merge
.
Advantages over naive calculation of average and variance
- Avoids loss of precision due to cancellation.
- Only needs a single pass over the samples, at the cost of a division inside the loop.
Description
Languages
Rust
100%