Rstats - Rust Stats

GitHub commit activity

Rstats is a lean minimalistic library that only depends on anyhow (for its error handling). Trait RStats is carefully checked and will report all kinds of errors, such as empty input. Trait Vectors is unchecked to achieve speed, so some caution is advisable.

Basic statistical measures and vector algebra are implemented for self-sufficiency. Beyond that, this package is particularly useful for analysis of multidimensional sets of points, with applications in Machine Learning.

Trait RStats

Statistical measures implemented for &[i64] and &[f64] slices. All these methods operate on one vector of data and take no arguments. For example, s.amean() computes the arithmetic mean of slice s of either type.

Included are:

Trait Vectors

Vector algebra implemented for &[f64] slices of any length (dimensions of space). First there are functions applying to just one and two vectors. Then there are functions expressing the relationships of one vector to a whole set of vectors. Should you get errors when applying them to Vec<f64>, just convert the vectors to &[f64] using .as_slice(). See doc examples.

Trait MutVectors

Some of the above basic Vector methods are for memory efficiency reasons reimplemented so that they mutate self in place instead of creating a new Vec. They are useful in vector iterative methods. Beware that some of these methods do not return anything, so they can not be chained.

Releases