The ExponentialMovAvg function computes the exponential moving average of a time series. The exponential moving average applies a damping factor, alpha, that exponentially decreases the weights of older values. This technique gives much more weight to recent observations, while retaining older observations.
The ExponentialMovAvg function computes the arithmetic average of the first n rows and then, for each subsequent row, computes the new value with this formula:
new_emavg = alpha * new_value + (1 - alpha) * old_emavg
The initial value of old_emavg is the arithmetic average of the first n rows.