pub fn var(v: &[f64]) -> f64 {
    let mean = v.iter().sum::<f64>() / v.len() as f64;

    v.iter().map(|&x| ((x - mean) as f64).powi(2)).sum::<f64>() / (v.len() - 1) as f64
}
/// Variance of vector....uses N - 1 for the denominator to give unbiased estimator for iid
/// observations (See R).
Variance of vector....uses N - 1 for the denominator to give unbiased estimator for iid
observations (See R).
Variance of vector .... uses N - 1 for the denominator to give unbiased estimator for iid observations ( See R ) .
pub fn var(v: &[f64]) -> f64 {
    let mean = v.iter().sum::<f64>() / v.len() as f64;
    v.iter().map(|&x| ((x - mean) as f64).powi(2)).sum::<f64>() / (v.len() - 1) as f64
}
pub fn var ( v : & [ f64 ] ) -> f64 { let mean = v . iter ( ) . sum :: < f64 > ( ) / v . len ( ) as f64 ; v . iter ( ) . map ( | & x | ( ( x - mean ) as f64 ) . powi ( 2 ) ) . sum :: < f64 > ( ) / ( v . len ( ) - 1 ) as f64 }
Variance of vector....uses N - 1 for the denominator to give unbiased estimator for iid
observations (See R).
Variance of vector .... uses N - 1 for the denominator to give unbiased estimator for iid observations ( See R ) .
v
&[f64]