[][src]Function linreg::lin_reg_imprecise

pub fn lin_reg_imprecise<I, F>(xys: I) -> Result<(F, F), Error> where
    F: FloatCore,
    I: Iterator<Item = (F, F)>, 

Single-pass simple linear regression.

Similar to lin_reg, but does not require a mean value to be computed in advance and thus does not require a second pass over the input data.

Returns Ok((slope, intercept)) of the regression line.

Errors

Errors if the number of elements is too large to be represented as F or the slope is too steep to represent, approaching infinity.