Aggregate. Calculates an arithmetically (or linearly) weighted average.
weighted_avg ( expression )
expression | A numeric expression that accepts integer, long, float, money, timestamp, and interval datatypes. |
An arithmetically weighted average has multiplying factors that give different weights to different data points. In Event Processing, a weighted moving average (WMA) has the specific default meaning of weights which decrease arithmetically with the age of an event. So the oldest event is given the least weight and the newest event is given the most weight. The weighted average is expressed using the following formula:
The weighted average function could be used in circumstances that each value does to contribute equally to the group of values.