Module meansd::binned

source ·
Expand description

Online algorithms to calculate mean and standard deviation with binning.

Examples

Fixed Bin Breaks

use meansd::binned::*;

let breaks = vec![0.0, 10.0, 20.0];
let mut binned = Breaks::new(&breaks);

binned.update(4.0);
binned.update(5.0);
binned.update(6.0);
binned.update(14.0);
binned.update(15.0);
binned.update(16.0);

Fixed Bin Width

use std::num::NonZeroU32;
use meansd::binned::*;

let width = NonZeroU32::new(5).unwrap();
let mut binned = Width::new(width);

binned.update(2.0);
binned.update(3.0);
binned.update(4.0);
binned.update(5.0);
binned.update(6.0);
binned.update(7.0);

Structs

  • A bin.
  • An online algorithm for calculating mean and standard deviation with binning and fixed bin breaks.
  • An online algorithm for calculating mean and standard deviation with binning and a fixed bin width.

Traits