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 thatπ·π‘Žπ‘‘π‘Ž uses.


ways to get as many results as there are data values


Use a vector of padding values with length 𝑅ᴼ

specify a padding vector (default is at the start)
  • here is the way to do that
    • running(𝐹𝑒𝑛𝑐,π·π‘Žπ‘‘π‘Ž, π‘†π‘π‘Žπ‘›; padding = [<values>])
    • running(function, data, window_span; padding = [<values>])
specify the padding vector to be at the end
  • here is the way to do that
    • running(𝐹𝑒𝑛𝑐,π·π‘Žπ‘‘π‘Ž, π‘†π‘π‘Žπ‘›; padding = [<values>], padlast = true)
    • running(function, data, window_span; padding = [<values>], padlast = true)

Use an empty vector

this fills the 𝑅ᴼ indices by trimming
  • here is the way to do that
    • running(𝐹𝑒𝑛𝑐,π·π‘Žπ‘‘π‘Ž, π‘†π‘π‘Žπ‘›; padding = eltype(π·π‘Žπ‘‘π‘Ž)[])
    • running(function, data, window_span; padding = eltype(π·π‘Žπ‘‘π‘Ž)[])

-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 both pads and trims to assign the initial 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.