Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Intellection/exstatic

Open more actions menu

Repository files navigation

Exstatic

Hex.pm Docs

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.

Features

  • 📊 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

Usage

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

Installation

Requirements

  • Elixir ~> 1.18

Add exstatic to your list of dependencies in mix.exs:

def deps do
  [
    {:exstatic, "~> 0.2.1", organization: "zappi"}
  ]
end

Documentation

Full documentation can be found at https://zappi.hexdocs.pm/exstatic.

Development

Requirements

  • Elixir ~> 1.18
  • Rust (for compiling NIFs)

Setup

  1. Clone the repository
  2. Install dependencies:
    mix deps.get
  3. Compile the project (set EXSTATIC_BUILD=true to build Rust code):
    EXSTATIC_BUILD=true mix compile
  4. Run tests:
    mix test

Project Structure

  • lib/ - Elixir source code
    • distribution/ - Probability distribution implementations
    • native.ex - NIF interface
  • native/ - Rust NIF implementations
  • test/ - Test suite

Releasing

See https://github.com/Intellection/exstatic/blob/main/RELEASE.md.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.