A Clojure/ClojureScript library for statistical distribution sampling and transducing functions.
kixi.stats is a statistical library for Clojure and ClojureScript that provides functions for sampling from probability distributions and computing statistics via transducers. It enables efficient, composable statistical computations that integrate seamlessly with Clojure's core data processing workflows. The library solves the problem of performing statistical analysis in a way that aligns with Clojure's functional and data-centric paradigms.
Clojure and ClojureScript developers who need to perform statistical analysis, sampling, or hypothesis testing within data processing pipelines. This includes data scientists, engineers building analytical applications, and developers working on simulations or data-intensive systems in the Clojure ecosystem.
Developers choose kixi.stats because it deeply integrates statistical functions into Clojure's transducer ecosystem, allowing statistical computations to be composed flexibly with existing data transformations. Its unique selling point is providing a comprehensive statistical toolkit—including distribution sampling, hypothesis tests, and empirical analysis—that works natively with Clojure's reducing functions and transducers, avoiding monolithic APIs.
A library of statistical distribution sampling and transducing functions
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Statistical functions like mean and standard deviation are reducing functions compatible with `transduce`, allowing composable computations within Clojure's data pipelines, as shown in examples combining statistics with filters.
Supports over 20 probability distributions including Normal, Binomial, and Poisson, enabling diverse simulation and sampling needs directly in code.
Uses t-digest for histograms to compute quantiles, median, and interquartile range efficiently, with optimizations like `histogram` and `post-complete` to avoid redundant calculations.
Allows repeatable sampling by providing seed values in functions like `draw` and `sample`, crucial for testing and simulations, as demonstrated in the deterministic sampling section.
Focuses on basic distributions, descriptive stats, and hypothesis tests; lacks support for more complex methods like multivariate analysis, machine learning, or Bayesian statistics, which might require additional libraries.
For composing multiple statistics in one pass, it relies on third-party libraries like redux or xforms (e.g., using `fuse`), adding dependencies and complexity beyond core Clojure.
Tied to Clojure/ClojureScript, it has a smaller community and fewer integrations compared to mainstream statistical tools in Python or R, limiting collaboration and resource availability.