Commit Graph

30 Commits

Author SHA1 Message Date
Vinzent Steinberg
ba93bb4e65 Refactor histograms to use common trait 2018-03-06 16:26:02 +01:00
Vinzent Steinberg
dcb006e6e0 Merge branch 'master' of https://github.com/vks/average 2018-03-06 15:56:09 +01:00
Vinzent Steinberg
3a0dcafd21 Implement histograms
In order for them to have constant size, a macro is provided to crate
the histogram type. This should be replaced by const generics once Rust
has them.
2018-03-06 15:54:30 +01:00
Vinzent Steinberg
e4345f5046 impl FromIterator<&f64> and FromIterator<&(f64, f64)>
This allows to write

    let k: Kurtosis = a.iter().collect();

instead of

    let k: Kurtosis = a.iter().map(|x| *x).collect();

but breaks type inference for code like

    let m: Min = (1..6).map(Into::into).collect();

where

    let m: Min = (1..6).map(f64::from).collect();

has to be used instead.

Fixes #8.
2018-02-28 23:44:40 +01:00
Vinzent Steinberg
d539342bf1 Moments: Add serde test 2018-01-11 19:42:41 +01:00
Vinzent Steinberg
383c85c470 Improve test slightly 2018-01-11 19:25:25 +01:00
Vinzent Steinberg
9f2a8ee44f Moments: Test merge 2018-01-11 19:16:11 +01:00
Vinzent Steinberg
c1fab4722c Implement incremental calculation of arbitrary moments 2018-01-11 18:29:43 +01:00
Vinzent Steinberg
2ee38b9d57 Fix clippy warnings 2018-01-10 16:02:55 +01:00
Vinzent Steinberg
11260d255b Fix a compiler warning 2017-12-21 10:47:45 +01:00
Eh2406
982acc9bf6 clippy 2017-12-20 16:59:51 -05:00
Eh2406
cac986d87e Add test 2017-12-20 16:46:50 -05:00
Vinzent Steinberg
c7ee8a6587 Clean up formatting 2017-11-19 10:57:01 +01:00
Vinzent Steinberg
7f6d1a12c2 Move quantile tests to external file if possible 2017-11-19 10:50:59 +01:00
Vinzent Steinberg
5d6d67bac9 Move add and merge to trait
This should make it possible to write more generic code.
2017-06-25 15:39:12 +02:00
Vinzent Steinberg
fb1b0879bd Add tests for concatenate 2017-06-21 19:35:41 +02:00
Vinzent Steinberg
20521ac22c Disable some noisy clippy warnings 2017-05-30 10:54:14 +02:00
Vinzent Steinberg
bea79374e3 Move random tests to separate file 2017-05-28 23:46:15 +02:00
Vinzent Steinberg
b8e980d6ce Implement kurtosis
Also improve skewness tests.
2017-05-28 23:33:16 +02:00
Vinzent Steinberg
4f5ddbd6e9 Implement skewness and add missing inline annotations 2017-05-28 22:37:48 +02:00
Vinzent Steinberg
30622be775 Rename average to mean for consistency 2017-05-28 21:13:47 +02:00
Vinzent Steinberg
19127cede7 Calculate average in terms of delta/n
This will avoid divisions in the inner loop when calculating higher
moments.
2017-05-28 20:30:05 +02:00
Vinzent Steinberg
0d1e1c4f12 Implement Max 2017-05-24 19:17:52 +02:00
Vinzent Steinberg
d2ebdc27c3 Implement Min 2017-05-24 19:17:46 +02:00
Vinzent Steinberg
a95ab05c10 Factor out calculation of average
Now it is possible to calculate the average without calculating the
error.
2017-05-24 11:33:15 +02:00
Vinzent Steinberg
962adb91d7 Rename Average to AverageWithError
This anticipates an implementation that does not calculate the error.
2017-05-24 11:32:24 +02:00
Vinzent Steinberg
ee6c5f861c Improve tests 2017-05-23 22:02:06 +02:00
Vinzent Steinberg
77fa8b4ed2 Remove inferior estimate of error of weighted average
It was a biased estimator, while the alternative one isn't.
2017-05-22 13:24:57 +02:00
Vinzent Steinberg
d25f267529 Move some tests from src to tests 2017-05-19 15:54:13 +02:00
Vinzent Steinberg
53b44d1a13 Add test comparing to streaming-stats 2017-05-05 16:40:23 +02:00