2.1.4.1.2 Algorithm for Moving Average


Moving Average

Moving average calcualtes the mean of the m consecutive data as the smoothed value.

\hat{y_t} = \frac{1}{m} \sum_{i=t-m+1}^{t}y_i
  • Centered moving average, if m is an odd number
 \hat{y_t} = \frac{1}{m} \sum_{i=t-\frac{m-1}{2}}^{t+\frac{m-1}{2}}y_i
  • Centered moving average, if m is an even number
 \hat{y_t} = \frac{1}{2}[ \frac{1}{m} \sum_{i=t-\frac{m}{2}}^{t+\frac{m}{2}-1}y_i + \frac{1}{m} \sum_{i=t-\frac{m}{2}+1}^{t+\frac{m}{2}}y_i]