tmwsum#

swordfish.function.tmwsum()#

Calculate the moving sum of X with Y as weights in a sliding window.

The weights in a sliding window are automatically adjusted so that the sum of weights for all non-null elements in the sliding window is 1.

Parameters:
  • T (Constant) – A non-strictly increasing vector of temporal or integral type. It cannot contain null values.

  • X (Constant) – A vector of the same size as T.

  • Y (Constant) – A vector of the same size as T.

  • window (Constant) – A scalar of positive integer or DURATION type indicating the size of the sliding window.