From 0299c15e84247075f20ee6c2ecd2d30092f24b9b Mon Sep 17 00:00:00 2001 From: lbarasti Date: Mon, 30 Mar 2020 23:04:30 +0100 Subject: [PATCH] Update references --- README.md | 5 +++++ src/statistics.cr | 2 ++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 93e9c83..1be40c8 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,12 @@ Which in this context means: let's not focus on benchmarks and performance, but ## References * [numpy.random](https://numpy.org/devdocs/reference/random/generator.html): distributions and random sampling * [numpy statistics](https://numpy.org/devdocs/reference/routines.statistics.html#averages-and-variances): order statistics, averages and variances +* [scipy stats](https://github.com/scipy/scipy/blob/3de0d58/scipy/stats/stats.py) module and related [tests](https://github.com/scipy/scipy/blob/1150c4c033899a5a4556b7d34d6b137352b36b9e/scipy/stats/tests/test_stats.py) tests +* [julia random](https://docs.julialang.org/en/v1/stdlib/Random/) module * [julia statistics](https://docs.julialang.org/en/v1/stdlib/Statistics/#Statistics.std) module +* [julia distributions](https://juliastats.org/Distributions.jl/latest/starting/) package. +* on [skewness and kurtosis](https://brownmath.com/stat/shape.htm), by Stan Brown +* more on [skewness and kurtosis](https://www.itl.nist.gov/div898/handbook/eda/section3/eda35b.htm), from NIST. ## Contributing diff --git a/src/statistics.cr b/src/statistics.cr index af7971f..636c9db 100644 --- a/src/statistics.cr +++ b/src/statistics.cr @@ -119,6 +119,8 @@ module Statistics # - `values`: a one-dimensional dataset. # - `p`: probability. Values of `p` should be in the interval `[0, 1]`. # - `sorted` indicates whether `values` can be assumed to be sorted. + # + # Implementation based on Julia's [Statistics.quantile](https://docs.julialang.org/en/v1/stdlib/Statistics/#Statistics.quantile). def quantile(values, p, sorted = false) sorted_values = sorted ? values : values.sort n = values.size