pub fn stdev<YI, F>(y: YI) -> (F, usize) where
    F: Float + Default + Sum,
    YI: Iterator + Clone,
    YI::Item: Borrow<F>, 
Expand description

Compute the standard deviation of the signal, y

Return the standard deviation and the number of points averaged

use approx::relative_eq;
use sci_rs::stats::stdev;

let y: [f64; 5] = [1.,2.,3.,4.,5.];
relative_eq!(2.5f64.sqrt(), stdev(y.iter()).0);

let y: &[f32] = &[];
assert_eq!((0f32, 0), stdev(y.iter()));