Function compute::statistics::sample_covariance[][src]

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

Calculates the sample covariance between two vectors x and y. This is a two-pass algorithm which centers the data before computing the covariance, which improves stability but does not change the result as covariance is invariant with respect to shifts.