Skip to main content

ols

Function ols 

Source
pub fn ols(
    x: &[f64],
    rows: usize,
    cols: usize,
    y: &[f64],
) -> Result<(Vec<f64>, f64, Vec<f64>)>
Expand description

OLS fit of y on the columns of X (row-major rows × cols). Returns (beta, residual_variance, se) with se the classical standard errors sqrt(σ̂² (XᵀX)⁻¹_jj) and σ̂² = RSS / (rows - cols).