rs-stats
A comprehensive statistical library written in Rust, providing powerful tools for probability, distributions, and hypothesis testing.
rs-stats offers a broad range of statistical functionality implemented in pure Rust. It's designed to be intuitive, efficient, and reliable for both simple and complex statistical analysis. The library aims to provide a comprehensive set of tools for data scientists, researchers, and developers working with statistical models.
Features
-
Probability Functions
- Error functions (erf, erfc)
- Cumulative distribution functions
- Probability density functions
- Z-scores
- Basic statistics (mean, variance, standard deviation, standard error)
-
Statistical Distributions
- Normal (Gaussian) distribution
- Binomial distribution
- Exponential distribution
- Poisson distribution
- Uniform distribution
-
Regression Analysis
- Linear Regression (fit, predict, confidence intervals)
- Multiple Linear Regression (multiple predictor variables)
- Model statistics (R², adjusted R², standard error)
- Model persistence (save/load models in JSON or binary format)
-
Hypothesis Testing
- ANOVA (Analysis of Variance)
- Chi-square tests (independence and goodness of fit)
- T-tests (one-sample, two-sample, paired)
Installation
Add rs-stats to your Cargo.toml:
[]
= "1.1.0"
Or use cargo add:
Usage Examples
Basic Statistical Functions
use ;
Working with Distributions
use ;
Hypothesis Testing
use ;
use ;
use one_way_anova;
Regression Analysis
use LinearRegression;
use MultipleLinearRegression;
Documentation
For detailed API documentation, run:
Testing
The library includes a comprehensive test suite. Run the tests with:
Contributing
Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature/my-new-feature - Submit a pull request
Before submitting your PR, please make sure:
- All tests pass
- Code follows the project's style and conventions
- New features include appropriate documentation and tests
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- The Rust community for their excellent documentation and support
- Contributors to the project
- Various statistical references and research papers that informed the implementations