Module core

Module core 

Source
Expand description

Core OLS regression implementation.

This module provides the main Ordinary Least Squares regression functionality that can be used directly in Rust code. Functions accept native Rust slices and return Result types for proper error handling.

§Example

let y = vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0];
let x1 = vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0];
let x2 = vec![2.0, 3.0, 3.5, 4.0, 4.5, 5.0];
let names = vec![
    "Intercept".to_string(),
    "X1".to_string(),
    "X2".to_string(),
];

let result = ols_regression(&y, &[x1, x2], &names)?;

Structs§

RegressionOutput
Complete output from OLS regression.
VifResult
Result of VIF (Variance Inflation Factor) calculation.

Functions§

calculate_vif
Calculates Variance Inflation Factors for all predictors.
compute_leverage
Computes leverage values from the design matrix and its inverse.
f_p_value
Computes a p-value from an F-statistic.
ols_regression
Performs Ordinary Least Squares regression using QR decomposition.
t_critical_quantile
Computes the critical t-value for a given significance level and degrees of freedom.
two_tailed_p_value
Computes a two-tailed p-value from a t-statistic.