Function rgsl::statistics::covariance

source ·
pub fn covariance(
    data1: &[f64],
    stride1: usize,
    data2: &[f64],
    stride2: usize,
    n: usize
) -> f64
Expand description

This function computes the covariance of the datasets data1 and data2 which must both be of the same length n.

covar = (1/(n - 1)) \sum_{i = 1}^{n} (x_i - \Hat x) (y_i - \Hat y)