Function compute::statistics::sample_covariance_onepass[][src]

pub fn sample_covariance_onepass(x: &[f64], y: &[f64]) -> f64
Expand description

Calculates the covariance between two vectors x and y. This is a one-pass algorithm which shifts the data by the first element in each vector before computing the covariance, which improves stability but does not change the result as covariance is invariant with respect to shifts.