Skip to main content

window_sum

Function window_sum 

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

Sliding-window sum with Kahan summation.

Returns a vector of length max(0, data.len() - window_size + 1). Each element is the sum of the corresponding window of window_size consecutive elements.