Exstatic provides idiomatic Elixir interfaces for working with statistical distributions. Built on top of the battle-tested statrs Rust library, it combines Elixir's elegant syntax with Rust's numerical computing capabilities.
- 📊 Idiomatic Elixir interfaces for probability distributions
- ⚡ Powered by Rust's statrs library for reliable numerical computations
- 🧮 Common statistical operations (PDF, CDF, entropy, etc.)
- 📐 Behaviour-based design following Elixir conventions
- 📚 Extensive documentation and examples
alias Exstatic.Distribution.Normal
# Create a standard normal distribution
{:ok, dist} = Normal.new(0.0, 1.0)
# Calculate probability density
Normal.pdf(dist, 0.0)
# => 0.3989422804014327
# Get distribution properties
Normal.mean(dist) # => 0.0
Normal.variance(dist) # => 1.0
- Elixir ~> 1.18
Add exstatic
to your list of dependencies in mix.exs
:
def deps do
[
{:exstatic, "~> 0.2.1", organization: "zappi"}
]
end
Precompiled NIF binaries are included in releases for common platforms. Downloading precompiled binaries requires you have read access to this repository,
you must set the environment variable EXSTATIC_GITHUB_TOKEN
with a GitHub Personal Access Token (PAT) with sufficient privileges -
please see here for more details.
Full documentation can be found at https://zappi.hexdocs.pm/exstatic.
- Elixir ~> 1.18
- Rust (for compiling NIFs)
- Clone the repository
- Install dependencies:
mix deps.get
- Compile the project (set
EXSTATIC_BUILD=true
to build Rust code):EXSTATIC_BUILD=true mix compile
- Run tests:
mix test
lib/
- Elixir source codedistribution/
- Probability distribution implementationsnative.ex
- NIF interface
native/
- Rust NIF implementationstest/
- Test suite
See https://github.com/Intellection/exstatic/blob/main/RELEASE.md.
This project is licensed under the MIT License - see the LICENSE file for details.