| Crates.io | statsrust |
| lib.rs | statsrust |
| version | 0.1.0 |
| created_at | 2025-08-28 13:45:36.786707+00 |
| updated_at | 2025-08-28 13:45:36.786707+00 |
| description | A comprehensive Rust library for statistical analysis, providing a wide range of descriptive statsrust, probability distributions, and non-parametric methods. |
| homepage | https://github.com/semmyenator/statsrust |
| repository | https://github.com/semmyenator/statsrust |
| max_upload_size | |
| id | 1814127 |
| size | 170,790 |
statsrust is a high-performance statistical analysis library for Rust developers, designed with emphasis on numerical stability, mathematical correctness, and user-friendly API.
Add this to your Cargo.toml:
[dependencies]
statsrust = "0.1.0" # Replace with the latest version
use statsrust::*;
fn main() -> Result<(), StatError> {
let data = vec![1.0, 2.0, 3.0, 4.0, 5.0];
// Basic descriptive statistics
let mean = mean(&data)?;
let median = median(&data)?;
let variance = variance(&data, None)?;
println!("Mean: {:.2}, Median: {:.2}, Variance: {:.2}", mean, median, variance);
// Kernel Density Estimation
let kde = kde(&data, 0.5, "normal", false)?;
println!("Density at 3.0: {:.4}", kde(3.0));
// Normal distribution operations
let dist = NormalDist::from_samples(&data)?;
println!("Distribution: N(μ={:.2}, σ={:.2})", dist.mean(), dist.stdev());
Ok(())
}
Our algorithms are designed to avoid common numerical issues:
Efficient implementation with multiple kernel functions:
Complete algebraic operations:
let dist1 = NormalDist::new(0.0, 1.0)?;
let dist2 = NormalDist::new(1.0, 2.0)?;
// Distribution operations
let sum_dist = dist1 + dist2; // N(1.0, √5)
let scaled_dist = dist1 * 2.0; // N(0.0, 2.0)
let overlap = dist1.overlap(&dist2); // Calculate distribution overlap
For comprehensive documentation:
We welcome contributions! Please see our Contribution Guidelines for details on how to report bugs, suggest enhancements, or submit pull requests.
This project is dual-licensed under:
Documentation content is licensed under:
This document is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
Original author: statsrust Authors