Welcome to Sx! 📊📈📉
Sx is a statistical library written entirely in Elixir.
Wherever possible, Sx is:
- 🥚 Simple to use, with a consistent interface.
- Stat contains the functions for dealing with sample statistics of a dataset, like
mean,variance,histogram. - Dist contains statistical distributions and the functions for interacting with them, including
pdf(probability density/mass function),cdf(cumulative distribution function),icdf(inverse cumulative distribution functon) andrand_gen(generating aStreamof random variables) - Test contains statistical tests, including parametric and nonparametric tests.
- Stat contains the functions for dealing with sample statistics of a dataset, like
- ⭐ Purely functional. Wherever possible, the
reduceandunfoldcombinators are used, revealing the elegant overlap between mathematics and functional programming. - 🦦 Efficient. Sx endeavors to perform numerically stable one-pass algorithms over the dataset. If sorting is required, Gelman sorts only once, unless absolutely necessary.
- 🧪 Extensively tested. Tests are borrowed from
scipy/statsandRbase, and so the results are guaranteed to be at least as accurate Python/R implementations. If deterministic tests are not possible, probabilistic tests are run to assure that the statistical properties are upheld. - 🧫 Reproducible. Sx wraps Erlang's
randlibrary in an opinionated fashion that will help you write reproducible (and hence debuggable) simulations. - ⚗️ Pure Elixir. The APIs are designed to work seamlessly with Elixir pipes. Functions are designed to work with any
Enumerable.t(number), so these functions will work withLists andStreams, without need for explicit conversion to between the two.
This library might be of interest to Elixir programmers who:
- Need access to battle-tested statistical functions
- Wish to perform statistical tests without having to set up a own Python/R service
- Are running statistical simulations
- Are developing games and require a pure Elixir implementation of random number generators (e.g. getting numbers from an exponential distribution to model time between encountering Pokémon in the wild)
(NOT TESTED YET!!!!)
If available in Hex, the package can be installed
by adding sx to your list of dependencies in mix.exs:
def deps do
[
{:sx, "~> 0.1.0"}
]
endDocumentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/sx.