Moving averages range among the most popular techniques for the preprocessing of time series. They are used to filter random "white noise" from the data, to make the time series smoother or even to emphasize certain informational components contained in the time series.

In »Memory Structures in Neural Networks« and »Regression Forecasts for Anticipatory Memory Structures« we discuss other side effects of these smoothing algorithms: They can all be seen as electronic memory structures providing specific, varying reactions to strong and weak impressions. Moving averages are also a valuable tool for data mining tasks – as reliable as they are easy to calculate. Last but not least, they can be employed for less sophisticated forecasting problems.

You will find a lot of information about moving averages on the internet. For this reason, the present document will limit itself to purely technical aspects, providing data mining experts and developers with formulas and C++ source code.

The following posts discuss eight different kinds of moving averages.

- Simple Moving Average (SMA)
- Exponential Moving Average (EMA)
- Adaptive Moving Average (AMA)
- Linear Moving Average (LMA)
- Triangular Moving Average (TMA)
- Sine-Weighted Moving Average (SWMA)
- Endpoint Moving Average (EPMA)
- Moving Linear Regression Forecast (RMA)

While the first six MA types are usually employed for smoothing, the Endpoint Moving Average as well as the Moving Linear Regression Forecast (developed by Ivorix) focus on divergences between the original time series and the transposed time series. They may be used in forecasting applications or as additional inputs for neural analyses.

The implementations of the various moving averages provide reliable values beginning with the first data point. Nevertheless, the values for data points * n*, where

*is smaller than the span of embedding*

**n***of the respective moving average, are calculated using interpolations. To be on the safe side we would advise you not to use use the first*

**(p)***data points of the transposed time series, unless you are sure that the interpolations do not affect the analysis in a negative way.*

**p**Please note that we provide the formulas and C++ algorithms »as is« and for informational purposes only. The use of our code in commercial applications of third party vendors is prohibited. If you plan to use the code you may purchase the »Ivorix Memory Components«, a C++ Class Library containing implementations of the moving average algorithms mentioned in this article.