Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/subconsciouscompute/simpleaccumulator
A simple accumulator inspired from boost::accumulator
https://github.com/subconsciouscompute/simpleaccumulator
accumulator online-algorithms rust statistics
Last synced: 5 days ago
JSON representation
A simple accumulator inspired from boost::accumulator
- Host: GitHub
- URL: https://github.com/subconsciouscompute/simpleaccumulator
- Owner: SubconsciousCompute
- License: mit
- Created: 2022-06-15T09:40:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T09:44:55.000Z (9 months ago)
- Last Synced: 2024-10-16T04:09:45.533Z (29 days ago)
- Topics: accumulator, online-algorithms, rust, statistics
- Language: Rust
- Homepage:
- Size: 57.6 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# SimpleAccumulator
[![Crates.io](https://img.shields.io/crates/v/simple_accumulator)](https://crates.io/crates/simple_accumulator)
[![docs.rs](https://img.shields.io/docsrs/simple_accumulator)](https://docs.rs/simple_accumulator/latest/simple_accumulator/struct.SimpleAccumulator.html)
[![Crates.io](https://img.shields.io/crates/d/simple_accumulator)](https://docs.rs/simple_accumulator/latest/simple_accumulator/struct.SimpleAccumulator.html)This crate is inspired by [Boost::Accumulator](
https://www.boost.org/doc/libs/1_84_0/doc/html/accumulators.html) 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](https://docs.rs/simple_accumulator/latest/simple_accumulator/struct.SimpleAccumulator.html)# Notes
- 2023-12-20: Version 0.6 is a major rewrite that fix many embarassing bugs. In
0.6+, we are relying on
[watermill](https://docs.rs/watermill/latest/watermill/#quickstart) crate for
underlying algorithms.# Usage:
```rust
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());
...
}
```