mmad#

swordfish.function.mmad()#

Calculate the average absolute deviation of X in a sliding window.

Parameters:
  • X (Constant) – A vector/matrix/table/tuple (with scalars or equal-length vectors)/dictionary.

  • window (Constant) – An integer no smaller than 2 or a scalar of DURATION type indicating the size of the sliding window. Note: The window size is capped at 102400 when m-functions are used in the streaming engines.

  • useMedian (Constant) –

    A Boolean value. The default value is false and it returns the mean absolute deviation, otherwise returns the median absolute deviation.

    • mean absolute deviation: mean(abs(X - mean(X)))

    • median absolute deviation: med(abs(X - med(X)))

  • minPeriods (Constant, optional) – A positive integer indicating the minimum number of observations in a window required to be not null (otherwise the result is NULL).