RollingFunctions.jl
This package makes it easy to summarize windowed data.
A function is applied to successive data subsequences.
You give a summarizing function πΉπ’ππ, the dataπ·ππ‘π, and a window span ππππ.
The result π is of length π α΄Ί, π α΄Ί = length(π·ππ‘π) - ππππ + 1.
- the result omits π α΄Ό = ππππ - 1 indices into π·ππ‘π.
there are ways for the results match the data in length
Use a single, shared padding value
rolling(function, data, window_span; padding = missing)
this will fill the initial result values with the padding value
- pads these values(result[1], .., result[pad_nindices])
rolling(function, data, window_span; padding = missing, padlast = true)
this will fill the final result values with the padding value
- pads these values(result[n-pad_nindices+1], .., result[n])
Pad with a vector of values with length matching the extra indicies ( π α΄Ό)
- this fills the extra indices with values obtained bycopying
Use an empty vector
this fills the extra indices with values obtained bytrimming
trimming evaluates the window function over available data
- trimmed window spans are less than the specified window_span
Use a vector ofπ padding values
where1 <= π < π α΄Ό.
this first pads then trims to assign the extra indices
- the firstπ indices of the result will match this vector
- the next π α΄Ό - π indices of the result will be trimmed
- the remaining indices get the rolled results.