16.20 - Modified Moving Average - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ - NewSQL Engine Analytic Functions

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
July 2019
Content Type
Programming Reference
Publication ID
B035-1206-162K
Language
English (United States)

The first point of the modified moving average (MMA) is calculated like the first point of the simple moving average. Each subsequent point is calculated by adding the new value to the most recently calculated modified moving average value and then, from that sum, subtracting the last average value. The difference is the new modified moving average value.

With MAvgType ('M'), the MovingAverage function uses this procedure:
  1. Compute the arithmetic average of the first window_size rows.

    The value window_size is specified by the WindowSize syntax element.

  2. For each subsequent row, compute the new modified moving average value with this formula:

    MMAM = MMAM-1 + (1/window_size) (VM - MMAM-1)

    VM is the current value.