Overview
simple_statistics is a production-ready statistical analysis library for Eiffel. It provides type-safe, verified implementations of descriptive statistics, correlation analysis, linear regression, and hypothesis testing.
Every feature is specified with Design by Contract (require/ensure/invariant) and verified through 43 comprehensive tests including adversarial and stress testing.
Part of the Simple Eiffel ecosystem.
Features
- Descriptive Statistics: mean, median, variance, standard deviation, percentiles, quartiles, mode
- Correlation & Covariance: Pearson correlation coefficient and covariance analysis
- Linear Regression: Ordinary least squares with R² and prediction capability
- Hypothesis Testing: t-tests (one-sample, two-sample, paired), chi-square, ANOVA
- Numerical Stability: Welford's algorithm, Kahan summation, careful computation
- Design by Contract: Full contract specification with verified postconditions
- Data Cleaning: Utilities to remove NaN and infinite values
Status
v1.0.0 - Production Ready
- 43 tests passing (100% pass rate)
- 30 baseline tests + 13 adversarial tests
- Design by Contract throughout
- Void-safe implementation
- SCOOP compatible
- Zero compilation warnings
Quick Start
See Quick API Reference for immediate examples.
Basic Example
create stats.make
data := {ARRAY [REAL_64]} << 1.0, 2.0, 3.0, 4.0, 5.0 >>
-- Compute statistics
avg := stats.mean (data)
std := stats.std_dev (data)
med := stats.median (data)
For comprehensive documentation, start with the User Guide.
Installation
Add to your ECF configuration file:
<library name="simple_statistics" location="$SIMPLE_EIFFEL/simple_statistics/simple_statistics.ecf"/>
Then create and use in your Eiffel code:
create stats.make
result := stats.mean (your_data)
Documentation
- Quick API Reference - Five-minute overview
- User Guide - Comprehensive tutorial with examples
- API Reference - Complete class and feature documentation
- Architecture - Design decisions and structure
- Cookbook - Real-world usage patterns and recipes
Support & Community
- GitHub Repository: simple-eiffel/simple_statistics
- Issue Tracker: Report bugs and request features
- Simple Eiffel: Visit the main ecosystem