linear_fit

Function linear_fit 

Source
pub fn linear_fit<N>(xs: &[N], ys: &[N]) -> Result<Polynomial<N>, String>
Expand description

Linear least-squares regression

§Errors

Returns an error if the linear fit fails. (xs.len() != ys.len())

§Panics

Panics if a usize cannot be transformed into the generic type.