Expand description
Traditional descriptive statistics for vector data.
This module provides high-level statistical operations built on top of Trueno’s SIMD-optimized primitives. Key features:
- Quantiles and percentiles using R-7 method (Hyndman & Fan 1996)
- Five-number summary (min, Q1, median, Q3, max)
- Histograms with multiple bin selection methods
- Hypothesis testing (t-tests, chi-square, ANOVA)
- Covariance and correlation matrices
- Optimized with Toyota Way principles (
QuickSelectfor O(n) quantiles)
§Examples
use aprender::stats::DescriptiveStats;
use trueno::Vector;
let data = Vector::from_slice(&[1.0, 2.0, 3.0, 4.0, 5.0]);
let stats = DescriptiveStats::new(&data);
assert_eq!(stats.quantile(0.5).expect("median should be computable for valid data"), 3.0); // median
assert_eq!(stats.quantile(0.0).expect("min quantile should be computable for valid data"), 1.0); // min
assert_eq!(stats.quantile(1.0).expect("max quantile should be computable for valid data"), 5.0); // maxModules§
- covariance
- Covariance and correlation computations.
- hypothesis
- Statistical Hypothesis Testing
Structs§
- Anova
Result - Result of an ANOVA F-test.
- ChiSquare
Result - Result of a chi-square test.
- Descriptive
Stats - Descriptive statistics computed on a vector of f32 values.
- Five
Number Summary - Five-number summary: minimum, Q1, median, Q3, maximum.
- Histogram
- Histogram representation with bin edges and counts.
- TTest
Result - Result of a t-test.
Enums§
- BinMethod
- Bin selection methods for histogram construction.
Functions§
- chisquare
- Chi-square goodness-of-fit test: Tests if observed frequencies match expected.
- corr
- Computes the Pearson correlation coefficient between two vectors.
- corr_
matrix - Computes the Pearson correlation matrix for a data matrix.
- cov
- Computes the covariance between two vectors.
- cov_
matrix - Computes the covariance matrix for a data matrix.
- f_
oneway - One-way ANOVA: Tests if multiple groups have the same mean.
- ttest_
1samp - One-sample t-test: Tests if sample mean differs from population mean.
- ttest_
ind - Independent two-sample t-test: Tests if two independent samples have different means.
- ttest_
rel - Paired t-test: Tests if paired samples have different means.