page_title: Moving average
section_title: Weighted moving average
hierarchical_section_title: Moving average / Weighted moving average
context_page_description: In statistics, a moving average is a calculation to analyze data points by creating a series of averages of different subsets of the full data set. It is also called a moving mean or rolling mean and is a type of finite impulse response filter. Variations include: simple, and cumulative, or weighted forms.
  Given a series of numbers and a fixed subset size, the first element of the moving average is obtained by taking the average of the initial fixed subset of the number series. Then the subset is modified by "shifting forward"; that is, excluding the first number of the series and including the next value in the subset.
  A moving average is 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.
context_section_description: A weighted average is an average that has multiplying factors to give different weights to data at different positions in the sample window. Mathematically, the weighted moving average is the convolution of the datum points with a fixed weighting function. One application is removing pixelisation from a digital graphical image.
  In technical analysis of financial data, a weighted moving average (WMA) has the specific meaning of weights that decrease in arithmetical progression. In an n-day WMA the latest day has weight n, the second latest n − 1, etc., down to one.
  The denominator is a triangle number equal to  In the more general case the denominator will always be the sum of the individual weights.
  When calculating the WMA across successive values, the difference between the numerators of WMAM₊₁ and WMAM is npM₊₁ − pM − ⋅⋅⋅ − pM−n+1. If we denote the sum pM + ⋅⋅⋅ + pM−ₙ₊₁ by TotalM, then
  The graph at the right shows how the weights decrease, from highest weight for the most recent datum points, down to zero.  It can be compared to the weights in the exponential moving average which follows.
caption: WMA weights n = 15
exif: {}