https://github.com/muellan/statistics
Header-only collection of statistics utilities for C++14
https://github.com/muellan/statistics
accumulator cpp cpp14 header-only histogram statistics
Last synced: 26 days ago
JSON representation
Header-only collection of statistics utilities for C++14
- Host: GitHub
- URL: https://github.com/muellan/statistics
- Owner: muellan
- License: mit
- Created: 2017-11-10T16:47:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-30T03:10:47.000Z (over 8 years ago)
- Last Synced: 2024-11-28T22:33:10.211Z (over 1 year ago)
- Topics: accumulator, cpp, cpp14, header-only, histogram, statistics
- Language: C++
- Size: 67.4 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
AM statistics
==========
Header-only collection of statistics utilities for C++14.
- [Interfaces](#interfaces)
- [Requirements](#requirements)
## Quick Overview
### Histograms
#### [uniform\_histogram](#uniform-histogram)
List of counters where the index of each counter is determined by mapping an input value to a range of bins of the same size.
#### [nonuniform\_histogram](#non-uniform-histogram)
List of counters where the index of each counter is determined by mapping an input value to a range of bins of non-uniform size (specified by their lower bounds).
#### [partial\_sum\_counter](#partial-sum-counter)
List of counters with efficient partial sum (prefix sum) queries.
### Accumulators
An accumulator provides running statistical analyses of a (growing) sample of values.
- ```moments_accumulator```
- ```mean_accumulator``` (running mean)
- ```variance_accumulator``` (includes running mean)
- ```skewness_accumulator``` (includes running mean & variance)
- ```kurtosis_accumulator``` (includes running mean, variance & skewness)
- ```comparative_accumulator```
- ```min_accumulator```
- ``` max_accumulator```
- ```reversible_comparative_accumulator``` (supports undo/pop operation)
- ```reversible_min_accumulator```
- ```reversible_max_accumulator```
- ```min_max_moments_accumulator```
- ```reversible_min_max_moments_accumulator```
#### Accumulator Interface
All accumulators have the following members:
```cpp
using
//reset accumulator
accumulator::clear();
accumulator::operator = (const argument_type&);
//add sample to statistics
accumulator::push(const argument_type&);
accumulator::operator += (const argument_type&);
```
Reversible accumulators also have:
```cpp
//remove value from statistics
accumulator::pop(const argument_type&);
accumulator::operator -= (const argument_type&);
```
#### Accumulator Decorators
- ```windowed``` restricts statistics to the n latest samples
- ```reversible``` augments an accumulator with an undo history
- ```combined``` combines several accumulators into one
#### Accumulator Adapters
- ```histogram_accumulator``` augments a histogram with an accumulator interface
## Requirements
- requires C++14 conforming compiler
- tested with g++ 5.3.1