inferust 0.1.0

Statistical modeling for Rust — OLS regression, hypothesis tests, descriptive stats, and more. A statsmodels-style library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use thiserror::Error;

#[derive(Error, Debug)]
pub enum InferustError {
    #[error("insufficient data: need at least {needed} observations, got {got}")]
    InsufficientData { needed: usize, got: usize },

    #[error("dimension mismatch: X has {x_rows} rows but y has {y_len} elements")]
    DimensionMismatch { x_rows: usize, y_len: usize },

    #[error("singular matrix: the design matrix is not invertible")]
    SingularMatrix,

    #[error("invalid input: {0}")]
    InvalidInput(String),
}

pub type Result<T> = std::result::Result<T, InferustError>;