Monday, December 29, 2008

Moving average

In statistics, a moving average, also called a rolling average and sometimes a running average, refers to a statistical technique used to analyze a set of data points by creating an average of one subset of the full data set at a time with each number in the subset given an equal statistical weight. So a moving average is not a single number, but it is a set of numbers, each of which is the average of the corresponding subset of a larger set of data points. A simple example is if you had a data set with 100 data points, the first value of the moving average might be the arithmetic mean (one simple type of average) of data points 1 through 25. The next value would be this simple average of data points 2 through 26, and so forth, until the final value, which would be the same simple average of data points 76 through 100.
The size of the subset being averaged is often constant, as in the previous example, but need not be. In particular, a cumulative average is a type of moving average where each value is the average of all previous data points in the full data set. So the size of the subset being averaged grows by one as each new value of the moving average is calculated. A moving average could also use a weighted average instead of a simple average, perhaps in order to place more emphasis on more recent data points than on other data points longer ago in time.
A moving average can be applied to any data set, but is perhaps most commonly used with time series data to smooth out short-term fluctuations and highlight longer-term trends or cycles. The threshold between short-term and long-term depends on the application, and the parameters of the moving average will be set accordingly. For example, it is often used in technical analysis of financial data, like stock prices, returns or trading volumes. It is also used in economics to examine gross domestic product, employment or other macroeconomic time series. Mathematically, a moving average is a type of convolution and so it is also similar to the low-pass filter used in signal processing. When used with non-time series data, a moving average simply acts as a generic smoothing operation without any specific connection to time, although typically some kind of ordering is implied.

No comments:

Followers