[][src]Function super_mass::stats::rolling_mean

pub fn rolling_mean<T: Into<f64> + Add<f64> + Copy>(
    values: &[T],
    window_size: usize
) -> RollingMean<'_, T>

Notable traits for RollingMean<'a, T>

impl<'a, T: 'a + Into<f64> + Copy> Iterator for RollingMean<'a, T> type Item = f64;

compute the moving mean in $$O(n)$$ time, favorable over iterating over windows with complexity $$O(nm),\quadm:window size$$ $$ \mu_i = \frac{-a_{i-n} + S_{i-n:i-1} +a_i}{n}$$