Returns the weighted moving (rolling/running) average using the previous m data points.

## Syntax

**WMA**(

**X**, Order,

**W**, T)

**X**- is the univariate time series data (a one-dimensional array of cells (e.g., rows or columns)).
**Order**- is the time order in the data series (i.e., the first data point's corresponding date (earliest date = 1 (default), latest date = 0)).
Order Description 1 Ascending (the first data point corresponds to the earliest date) (default). 0 Descending (the first data point corresponds to the latest date). **W**- is the size of an equal-weighted window, or an array of multiplying factors (i.e., weights) of the moving/rolling window.
**T**- is the forecast time/horizon beyond the end of X. If missing, a default value of 0 (Latest or end of X) is assumed.

## Remarks

- The weighted-moving average (WMA) is defined as: $$\mathit{wma}_t^k=\frac{\sum_{i=1}^{k} x_{t-i}\times w_i}{\sum_{i=1}^{k} w_i}$$ Where:
- $w_i$ is the weight of the i-th data point in the moving/rolling window.
- $k$ is the size of the moving/rolling window.
- $x_t$ is the value of the time series at time $t$.

**IMPORTANT:**The first value in the weights array corresponds to the latest point in the MA window.- In practice, the weighting factors are often chosen to give more weight to the most recent terms in the time series and less weight to older data.
- A small window size (m) will have less of a smoothing effect and be more responsive to recent changes in the data, while a larger m will have a greater smoothing effect, and produce a more pronounced lag in the smoothed sequence.
- The weights array should have a size greater than zero and consist of non-negative values.
- The window size (m) must be less than the time series size, or else an error value (#VALUE!) is returned.
- The WMA assumes a stationary time series, so if a trend exists, the WMA lags behind it.
- This technique has the disadvantage that it cannot be used until at least k observations have been made.
- The time series is homogeneous or equally spaced.
- The time series may include missing values (e.g., #N/A) at either end.

## Files Examples

## Related Links

## References

- D. S.G. Pollock; Handbook of Time Series Analysis, Signal Processing, and Dynamics; Academic Press; Har/Cdr edition(Nov 17, 1999), ISBN: 125609906.
- James Douglas Hamilton; Time Series Analysis; Princeton University Press; 1st edition(Jan 11, 1994), ISBN: 691042896.
- Tsay, Ruey S.; Analysis of Financial Time Series; John Wiley & SONS; 2nd edition(Aug 30, 2005), ISBN: 0-471-690740.
- Box, Jenkins and Reisel; Time Series Analysis: Forecasting and Control; John Wiley & SONS.; 4th edition(Jun 30, 2008), ISBN: 470272848.
- Walter Enders; Applied Econometric Time Series; Wiley; 4th edition(Nov 03, 2014), ISBN: 1118808568.

## Comments

Article is closed for comments.