WindowedFunctions.jl

Successor to RollingFunctions.jl
Author JeffreySarnoff
Popularity
10 Stars
Updated Last
4 Months Ago
Started In
December 2022

WindowedFunctions.jl

Roll functions and run statistics along windowed data.


Dev Documentation    Aqua QA    License: MIT    Package Downloads 

     Copyright © 2017-2023 by Jeffrey Sarnoff <on github: JeffreySarnoff>    

Philosophy and Purpose

rolling, tiling, and running functional windows over data

At its best, this software collaborates with you.

Data

Data is conveyed either as a vector, a matrix of column vectors, or as some coordinated vectors.

With the covariance function, two vectors are processed within the current window like this

  • map(cov, window_over_seq1, window_over_seq2)  (the windows are identical)

Data may be obtained from other Tables.jl compatible data structures (e.g. dataframes, timeseries) and from similarly read compatible files (e.g using CSV.read, either with a .csv file or, for example, using CSV.jl and SQLite.jl together).

Windows

Windows move over the data. One may use unweighted windows or windows where a specific weight is associated with each position (index offset into the window). The weights are applied the same way with every window advance. Weights are multiplied 1-to-1 to scale the newly visible data now seen through the moving window.

Participation

We welcome contributors and celebrates PRs.
Our issue threads are available for wider use.
And we are on discourse

you are invited ..
Ask. Share insights. Write words that smile.


Capabilities

≺ apply ≻ is one of { rolling, tiling, running }

keywords (optional)

  • padding = nopadding (omit padding) [or use this value]
  • atend = false (pad the start) [true, pad the end]

data sequences

  • as provided
    • ≺ apply ≻(win_fn, win_width, seq)
  • with weights
    • ≺ apply ≻(win_fn, win_width, seq, weights)

data matrix

  • as provided
    • ≺ apply ≻(win_fn, win_width, data_matrix)
  • with shared weights
    • ≺ apply ≻(win_fn, win_width, data_matrix, weights)
  • with unique weights
    • ≺ apply ≻(win_fn, win_width, data_matrix, weight_matrix)

(each data matrix column is independent -- use unary functions)

signature
multisequence ≺ apply ≻(fn, width, rest...)
unweighted rest
(seq1, seq2)
(seq1, .., seqN)
shared weights rest
(seq1, seq2, weights)
(seq1, .., seqN, weights)
unique weights rest
(seq1, seq2, [weights1, weights2])
(seq1, .., seqN, [weights1, .., weightsN])

(the maximum number of sequences, Nseq = 3)