Commit Graph

56 Commits

Author SHA1 Message Date
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
c9829a1279 Clean up tests 2019-07-08 17:32:42 +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
3326a8bb9c Update dependencies 2019-07-08 16:01:13 +02:00
Vinzent Steinberg
2c2632a564 Add proptest regressions 2019-05-22 17:05:39 +02:00
Vinzent Steinberg
3f82a320f9 Use proptest to test reasonable bounds of mean 2019-04-25 14:53:19 +02:00
Vinzent Steinberg
c10616c46e Improve concatenate! to support usage outside braces
Fixes #12.
2019-04-25 13:51:33 +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
dc2d21bea9 Update dependencies 2019-01-18 15:55:37 +01: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
34d33ef21a Slightly improve calculation of standardized moment
Also test more of the trivial cases.
2018-07-11 12:37:06 +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
1e7a852862 Improve quantile tests 2018-07-10 16:31:33 +02:00
Vinzent Steinberg
0de183127e Implement merge for Histogram 2018-07-06 13:27:26 +02:00
Vinzent Steinberg
7f8663c23e Update dependencies 2018-07-06 10:31:26 +02:00
Vinzent Steinberg
41e7df435d Relax skewness test for exponential distribution
This was sometimes making the CI tests fail.
2018-03-07 17:57:49 +01:00
Vinzent Steinberg
7e06374843 histogram: Implement variance
This is useful for error estimates.
2018-03-07 17:45:38 +01:00
Vinzent Steinberg
0259728bb8 Fix constant width histograms for ranges not starting at 0 2018-03-07 17:37:06 +01:00
Vinzent Steinberg
c04ce8887e histogram: Implement AddAssign and MulAssign
Also clarify documentation and name of `min`/`max`.
2018-03-07 17:08:19 +01:00
Vinzent Steinberg
682fec27fe histogram: Implement min, max and reset 2018-03-06 19:22:42 +01:00
Vinzent Steinberg
d1ab9630af histogram: Implement iteration over bin centers 2018-03-06 18:55:21 +01:00
Vinzent Steinberg
3f22412aa3 Fix clippy warnings 2018-03-06 18:48:08 +01:00
Vinzent Steinberg
86a411143e histogram: Implement iteration of bin widths and normalized bins 2018-03-06 18:27:31 +01:00
Vinzent Steinberg
c64544baa8 Implement iteration of histograms 2018-03-06 17:16:54 +01: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
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