Function rgsl::statistics::spearman [] [src]

pub fn spearman(
    data1: &[f64],
    stride1: usize,
    data2: &[f64],
    stride2: usize,
    n: usize,
    work: &mut [f64]
) -> f64

This function computes the Spearman rank correlation coefficient between the datasets data1 and data2 which must both be of the same length n. Additional workspace of size 2*n is required in work. The Spearman rank correlation between vectors x and y is equivalent to the Pearson correlation between the ranked vectors x_R and y_R, where ranks are defined to be the average of the positions of an element in the ascending order of the values.