Vinzent Steinberg
3853de8481
Fix clippy warnings
2019-07-08 17:32:44 +02:00
Vinzent Steinberg
610f6cae6a
Clean up doctests
...
Also make sure that the macros work when they are imported in isolation.
2019-07-08 17:32:43 +02:00
Vinzent Steinberg
9401f41558
Use Rust 2018 idioms
2019-07-08 16:04:59 +02:00
Vinzent Steinberg
1bdadfae1b
Make code compatible with Rust 2018
2019-07-08 16:04:19 +02:00
Vinzent Steinberg
25d894a2f6
Use custom implementation of binomial coefficient
...
This lets us get rid of the num-integer dependency and makes the
performance of the code generated by `define_moments` close to that of
`Kurtosis`. Before, it was several times slower.
However, the custom implementation is more vulnerable to integer
overflow. In practise, this should not matter, since it does not make
sense to calculate moments of very high order.
2019-05-22 15:51:11 +02:00
Vinzent Steinberg
547149bfd2
Fix serde support
...
* Use correct Cargo flags.
* Fix tests.
* Fix histogram serialization.
2019-01-22 14:29:29 +01:00
Vinzent Steinberg
8c5121ca08
Suggest correct Serde feature
2018-07-27 16:53:27 +02:00
Vinzent Steinberg
bb994f0f22
Improve docs on calculation of arbitrary moments
2018-07-27 16:50:02 +02:00
Vinzent Steinberg
56344750a7
Fixes to `Histogram`
...
1. Now histograms with more than 31 bins are supported (before there
were issues with missing implementations on arrays.)
2. The items defined by `define_histogram!` are in their own module, to
avoid issues with Rust's lack of macro hygiene for items.
2018-07-24 18:18:05 +02:00
Vinzent Steinberg
a7dde93df8
More idiomatic serde support
...
* Follow the suggestions from the Serde docs.
* Rename the feature from `serde` to `serde1`.
* Fix a doctest.
* Mention the feature in the README.
2018-07-11 12:54:37 +02:00
Vinzent Steinberg
663009f358
Make it possible to calculate an arbitrary number of moments
2018-07-10 17:19:57 +02:00
Vinzent Steinberg
fcbe51f1dd
Improve Histogram docs by exporting the Histogram10 special case
2018-07-06 13:08:33 +02:00
Vinzent Steinberg
554d4ca596
Use float-ord instead of quickersort
...
The latter has been deprecated.
2018-07-06 11:01:41 +02:00
Vinzent Steinberg
ef41836ec5
Small improvements to Histogram docs
2018-07-06 10:52:19 +02:00
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
68a4fa64cb
Restore compatibility with stable
2018-01-12 14:23:38 +01:00
Vinzent Steinberg
a6a477d621
Benchmark generic vs. handwritten implementation of kurtosis
...
Also restore no_std and remove printing left over from debugging.
2018-01-11 19:37:25 +01:00
Vinzent Steinberg
c1fab4722c
Implement incremental calculation of arbitrary moments
2018-01-11 18:29:43 +01:00
Vinzent Steinberg
4bcc52ef25
Reenable clippy lint that no longer gives false positives
2018-01-10 16:04:29 +01:00
Vinzent Steinberg
5963cbb032
Fix typos
2017-12-20 14:55:09 +01:00
Eh2406
e41ae320ac
Add to docs
2017-12-18 12:14:24 -05:00
Eh2406
b26652f2a7
inline reduce to make minmax compatibal with serde
2017-12-17 22:53:50 -05:00
Eh2406
046f47a0c2
add a feature = "serde"
2017-12-17 22:11:11 -05: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
d5b3fc80ab
More code deduplication
2017-06-23 17:43:42 +02:00
Vinzent Steinberg
fd72100913
Improve documentation
2017-06-21 19:34:51 +02:00
Vinzent Steinberg
01157da831
Macro for concatenating iterative estimators
2017-06-21 18:05:54 +02:00
Vinzent Steinberg
20521ac22c
Disable some noisy clippy warnings
2017-05-30 10:54:14 +02:00
Vinzent Steinberg
eafe23b568
Add example
2017-05-29 00:58:25 +02:00
Vinzent Steinberg
c6f3bb6d99
Use mean instead of average in docs
2017-05-29 00:42:33 +02:00
Vinzent Steinberg
80e92f6176
Update documentation
2017-05-29 00:39:33 +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
712303b58a
Split up moments into one file for each
...
This anticipates adding skewness.
2017-05-28 21:00:04 +02:00
Vinzent Steinberg
95a2a1d409
Implement quantile
2017-05-25 15:42:53 +02:00
Vinzent Steinberg
cfab296f58
Improve documentation
2017-05-24 19:45:58 +02:00
Vinzent Steinberg
0d1e1c4f12
Implement `Max`
2017-05-24 19:17:52 +02:00
Vinzent Steinberg
30ea084366
Generalize `Min` implementation
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
262d5c88da
Improve docs
2017-05-22 18:47:46 +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
334d8ae9cd
Improve documentation
2017-05-19 17:53:54 +02:00
Vinzent Steinberg
fbdb247a0e
Implement WinCross estimator of standard error of weighted average
2017-05-19 15:38:39 +02:00
Vinzent Steinberg
0488d6f105
Implement weighted average
2017-05-05 19:07:03 +02:00