normality
A Rust crate for assessing the normality of a data sample. It provides several common statistical tests to determine if a set of data is likely drawn from a normal distribution.
All test implementations are generic and can work with f32 or f64 data types. The implementations are ported from well-established algorithms found in popular R packages.
Implemented Tests
- Shapiro-Wilk Test: One of the most powerful tests for normality.
- Lilliefors (Kolmogorov-Smirnov) Test: A modification of the K-S test for when population mean and variance are unknown.
- Anderson-Darling Test: Gives more weight to the tails of the distribution.
- Jarque-Bera Test: Tests whether the sample skewness and kurtosis match a normal distribution.
- Pearson Chi-squared Test: A goodness-of-fit test that compares observed and expected frequencies.
- Cramer-von Mises Test: An alternative EDF goodness-of-fit test.
- D'Agostino's K-squared Test: Tests for normality based on sample skewness.
Installation
Either run cargo add normality or add the crate to your Cargo.toml:
[]
= "1.0.0"
Example Usage
use ;
Accuracy
The accuracy of the implemented tests has been verified against their R equivalents. Running the integration tests for this crate requires a local installation of R and for the Rscript executable to be available in the system's PATH.
License
This project is licensed under the MIT License.