2 releases

0.1.1 Sep 24, 2024
0.1.0 Aug 10, 2024

#591 in Math

Download history 85/week @ 2024-08-05 23/week @ 2024-08-12 10/week @ 2024-09-16 150/week @ 2024-09-23 57/week @ 2024-09-30 9/week @ 2024-10-07

226 downloads per month

Custom license

45KB
1K SLoC

stat-rs

This library provides a comprehensive implementation for statistical operations on fixed-size numerical series in Rust, designed for both std and no-std environments. It features functions for various statistical analyses, including descriptive statistics, measures of central tendency, dispersion, and outlier detection.

Features

  • Fixed-Size Series: Efficient storage and operations on fixed-length numerical arrays using ArrayVec.
  • Descriptive Statistics: Calculate mean, median, mode, variance, standard deviation, and more.
  • Quartile Analysis: Functions to compute quartiles, interquartile ranges, and outliers.
  • Statistical Tests: Methods for correlation, covariance, and other statistical tests.
  • Utility Functions: Additional functions like normalization, sigmoid, and softmax transformations.

Usage

Here's a quick example of how to create a series and perform some statistical calculations:

let data: [f64; 5] = [1.0, 2.0, 3.0, 4.0, 5.0];
let series = Series::from(data);

// Returns None, only if Series is empty
let mean = series.mean().unwrap();
let median = series.median().unwrap();
let variance = series.variance().unwrap();

println!("Mean: {}", mean);
println!("Median: {}", median);
println!("Variance: {}", variance);

Dependencies

~185KB