Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whossname/stream_stats
Concurrent calculation of count, mean and standard deviation
https://github.com/whossname/stream_stats
elixir standard-deviation statistics stream-processing
Last synced: about 1 month ago
JSON representation
Concurrent calculation of count, mean and standard deviation
- Host: GitHub
- URL: https://github.com/whossname/stream_stats
- Owner: whossname
- License: mit
- Created: 2019-09-27T02:59:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-01T07:59:38.000Z (over 5 years ago)
- Last Synced: 2024-11-28T21:44:34.542Z (about 2 months ago)
- Topics: elixir, standard-deviation, statistics, stream-processing
- Language: Elixir
- Homepage: https://hexdocs.pm/stream_stats
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# StreamStats
Enables concurrent calculation of count, mean and standard deviation.
New values can be aggregated into an existing stat tuple and two stat
tuples can be merged into one.Inspired by the following article by John D. Cook:
https://www.johndcook.com/blog/skewness_kurtosis/## Installation
The package can be installed by adding `stream_stats` to your list of
dependencies in `mix.exs`:```elixir
def deps do
[
{:stream_stats, "~> 0.1.0"}
]
end
```## Example usage
Given two lists of numbers `values_1` and `values_2` the two lists can be
aggregated independently, then combined into a single stats tuple:```elixir
stream_1 = StreamStats.reduce(values_1)
stream_2 = StreamStats.reduce(values_2)
stats = StreamStats.combine(stream_1, stream_2){count, mean, _m2} = stats
std_dev = StreamStats.standard_deviation(stats)
```