Rstats - Rust Stats

Crates.io GitHub last commit (branch)

Rstats is aimed at characterization of multidimensional sets of points, with applications to Machine Learning and Data Analysis. It begins with basic statistical measures and vector algebra, which provide self-contained tools for the more interesting algorithms but can also be used in their own right.

Our treatment of multidimensional sets of points is constructed from the first principles. Thus some original concepts, unlikely to be found elsewhere, are introduced and implemented here.

Going beyond one dimension, other people mostly cheat by using centroids or 'quasi medians' (1-d medians along each axis). They may be quicker to compute but they are a poor start to characterising multidimensional clouds of points reliably. Specifically, all such 1-d measures depend on the choice of axis. Such dependence has to be later removed by Principle Components Analysis or similar methods. In contradistinction to this, our methods based on true Geometric Median, (computed here by nmedian), are axis (or rotation) independent.

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 sometimes unchecked for speed, so some caution is advisable.

Trait RStats

One dimensional statistical measures implemented for &[i64] and &[f64]. 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

Trait MutVectors

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

Trait VecVec

Releases