rolling_mean_int

Function rolling_mean_int 

Source
pub fn rolling_mean_int<T: NumCast + Copy + Zero>(
    window: IntegerAVT<'_, T>,
    subwindow: usize,
) -> FloatArray<f64>
Expand description

Computes rolling arithmetic means over integer data with high-precision floating-point output.

Calculates moving averages across sliding windows, converting integer inputs to double-precision floating-point for accurate mean computation. Essential for time series analysis and statistical smoothing operations over integer sequences.

§Parameters

  • window - Integer array view containing values for mean calculation
  • subwindow - Window size determining number of values to average

§Returns

Returns a FloatArray<f64> containing:

  • Rolling arithmetic means computed with double precision
  • Zero values for positions with incomplete windows
  • Null mask indicating window completeness and null contamination

§Examples

use minarrow::IntegerArray;
use simd_kernels::kernels::window::rolling_mean_int;

let arr = IntegerArray::<i32>::from_slice(&[1, 2, 3, 4, 5]);
let result = rolling_mean_int((&arr, 0, arr.len()), 3);