Skip to main content

linregress

Function linregress 

Source
pub fn linregress(x: &[f64], y: &[f64]) -> Result<LinregressResult, ErrorsJSL>
Expand description

The least-squares line y ≈ slope · x + intercept (SciPy’s linregress), from the centred sums Sxx, Sxy, Syy: slope = Sxy/Sxx, r = Sxy/√(Sxx Syy), and the slope’s standard error √((1 − r²) Syy / ((n − 2) Sxx)).