Crate rstats

Source
Expand description

Statistics, Linear Algebra, Information Measures, Cholesky Matrix Decomposition, Mahalanobis Distance, Multidimensional Data Analysis, Machine Learning and more …

Re-exports§

pub use crate::error::*;

Modules§

error
Custom error RError
mutvec
Vector algebra mutating an f64 vector
stats
Basic statistics on a single generic vector
triangmat
Associated functions implemented for struct TriangMat
vecg
Vector algebra on two generic vectors
vecu8
Stats and vector algebra on one or two u8 vectors
vecvec
Multidimensional operations on sets of vectors
vecvecg
Multidimensional operations on sets of vectors, with additional inputs

Macros§

here
Macro here!("message") gives &str with the file:line path::function-name of where it was invoked, followed by the passed “message” - useful for informative errors

Structs§

MinMax
struct for minimum value, its index, maximum value, its index
Params
Holds measures of central tendency and spread. Usually some kind of mean and its associated standard deviation, or median and its MAD
TriangMat
Compact Triangular Matrix.
TriangMat stores and manipulates triangular matrices. It also compactly represents square symmetric and antisymmetric matrices. TriangMat is typically produced by some matrix calculations, so the end-type for its data is f64.
The actual length of its data is triangmat.len() = n*(n+1)/2.
The dimension of the implied nxn matrix is n = triangmat.dim().
The kind (field) of the TriangMat is encoded as 0..5. This enables trivial transpositions by: (kind+3) % 6.

Enums§

MedError
custom error

Constants§

BL
When interpolated, makes following foreground rendering bold blue
CY
When interpolated, makes following foreground rendering bold cyan
GR
When interpolated, makes following foreground rendering bold green
MG
When interpolated, makes following foreground rendering bold magenta
RD
When interpolated, makes following foreground rendering bold red
UN
Returns the terminal rendering to default
YL
When interpolated, makes following foreground rendering bold yellow

Traits§

Median
Fast 1D generic medians, plus related methods
Medianf64
Fast 1D medians of floating point data, plus related methods
MutVecg
Mutable operations on one generic slice. A few of the essential Vecg methods are reimplemented here to mutate self. This is for efficiency and convenience. For example, in vector iterative methods.
Printing
Trait to serialize tuples &(T,T) and &(T,T,T) and slices &[T], &[&[T]], &[Vec<T>]. Suitable for printing or writing to files pairs, triplets, all kinds of Vecs and slices and irregularly shaped 2D matrices.
All are converted into Strings and optionally decorated and coloured. Included are methods and constants to render the resulting String in six primary bold ANSI terminal colours.
Stats
Statistical measures of a single variable (one generic vector of data) and vector algebra applicable to a single (generic) vector. Thus these methods take no arguments.
VecVec
Methods applicable to a slice of vectors of generic end type. Operations on a whole set of multidimensional vectors.
VecVecg
Methods applicable to slice of vectors of generic end type, plus one other argument of a similar kind
Vecg
Vector Algebra on two vectors (represented here as generic slices). Also included are scalar operations on the self vector.
Vecu8
Methods specialised to and more efficient, for &[u8]

Functions§

basis_vec
Generates basis vector i of n dimensional space
fromop
Convenience From quantification invocation
sumn
Sum of natural numbers 1..n. Also the size of an upper or lower triangle of a square array (including the diagonal) to exclude the diagonal, use sumn(n-1)
tm_stat
tm_statistic in 1d: (value-centre)/dispersion generalized to any measure of central tendency and dispersion
unit_matrix
Generates full nxn unit (identity) matrix