pub fn cor(v1: &Vec<f64>, v2: &Vec<f64>) -> f64
Expand description

Pearson’s correlation coefficient

Examples

#[macro_use]
extern crate peroxide;
use peroxide::fuga::*;

fn main() {
    let a = c!(1,2,3);
    let b = c!(3,2,1);
    assert!(nearly_eq(cor(&a, &b),-1));
}