Function peroxide::statistics::stat::cov

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

Covariance (to Value)

§Examples

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

fn main() {
    let v1 = c!(1,2,3);
    let v2 = c!(3,2,1);
    assert!(nearly_eq(cov(&v1, &v2), -1f64));
}