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§
- Regression
Output - 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.