Skip to main content

rolling_std_welford

Function rolling_std_welford 

Source
pub fn rolling_std_welford(data: &[f64], window: usize) -> Vec<f64>
Expand description

Welford’s algorithm for numerically stable rolling standard deviation

This is significantly faster than the naive two-pass approach and more numerically stable than the sum-of-squares method.

§Performance

  • Expected speedup: 10-50x over naive O(n*w) two-pass
  • Complexity: O(n)
  • Numerical stability: Superior to sum-of-squares