Weighted moving average is a type of moving average that assigns different weights to each data point in the time series. This means that the most recent data points have a greater impact on the moving average calculation than older data points. Weighted moving averages are commonly used in finance and economics to smooth out fluctuations in a time series data and identify trends over time.
In an n-point weighted moving average, the most recent data point has weight n, the second most recent data point has weight (n - 1), and so on, until the weight is zero.
With MAvgType ('W'), the MovingAverage function uses this formula:
WMAM = (nVM + (n-1)VM-1 + … + 2V(M-n+2)) + V(M-n+1)) / (n + (n-1) + … + 2 + 1 )
VM is the target column value at index M in the window under consideration.
The value n, the number of old values to use when calculating the new weighted moving average, is specified by the WindowSize syntax element.