| Crates.io | simple_accumulator |
| lib.rs | simple_accumulator |
| version | 0.7.0 |
| created_at | 2022-06-16 04:46:19.709274+00 |
| updated_at | 2024-02-12 09:46:45.488441+00 |
| description | A simple accumulator for incremental statistical computations |
| homepage | https://github.com/SubconsciousCompute/SimpleAccumulator |
| repository | https://github.com/SubconsciousCompute/SimpleAccumulator |
| max_upload_size | |
| id | 607217 |
| size | 23,793 |
This crate is inspired by Boost::Accumulator which supports incremental statistical computation (online algorithms). This is a work in progress but usable. Please write integration tests before using it in production.
Read Documentation
use simple_accumulator::SimpleAccumulator;
fn main() {
let k = [1, 2, 3, 4];
// If second argument is `None` then accumulator stores all the data.
let mut x = SimpleAccumulator::new(&k, Some(10));
println!("{:?}", x);
x.push(5);
println!("{:?}", x);
print!("{}", x.mean());
print!("{}", x.median());
print!("{}", x.variance());
print!("{}", x.sum());
print!("{}", x.kurtosis());
...
}