pub fn variance(data: &Vec<f64>) -> f64Expand description
Calculates the variance of the given vector. Please see https://en.wikipedia.org/wiki/Variance for further explanation.
ยงExamples
let data = vec![1.0, 2.0, 3.0, 4.0, 2.0];
assert_eq!(basic_stochastics::variance(&data), 1.04);