Modified Moving Average - Analytics Database

Database Analytic Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-04-01
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jmh1512506877710
Product Category
Teradata Vantageā„¢

Modified moving average (MMA) makes averages more susceptible to recent shifts. The Modified moving average is a special case of the Exponential moving average, for which the smoothing constant is equal to the reciprocal of the smoothing interval.

The first point of the modified moving average 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:
  • Compute the arithmetic average of the first window_size rows.

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. M is the current index.