- See Also
-
Related Guides
- Data Transforms and Smoothing
- Handling Arrays of Data
- Statistical Data Analysis
- Time Series Processes
- Financial & Economic Data
- Numerical Data
- Time Series Processing
- Linear and Nonlinear Filters
- Scientific Data Analysis
- Financial Computation
- Socioeconomic & Demographic Data
- Signal Visualization & Analysis
- Signal Filtering & Filter Design
- Tech Notes
-
- See Also
-
Related Guides
- Data Transforms and Smoothing
- Handling Arrays of Data
- Statistical Data Analysis
- Time Series Processes
- Financial & Economic Data
- Numerical Data
- Time Series Processing
- Linear and Nonlinear Filters
- Scientific Data Analysis
- Financial Computation
- Socioeconomic & Demographic Data
- Signal Visualization & Analysis
- Signal Filtering & Filter Design
- Tech Notes
MovingAverage [list,r]
gives the moving average of list, computed by averaging runs of r elements.
MovingAverage [list,{w1,w2,…,wr}]
gives the moving average of list, computed with weights wi.
MovingAverage
MovingAverage [list,r]
gives the moving average of list, computed by averaging runs of r elements.
MovingAverage [list,{w1,w2,…,wr}]
gives the moving average of list, computed with weights wi.
Details
- MovingAverage [list,r] gives a list of the means of elements in list taken in blocks of length r. »
- MovingAverage [list,wts] is equivalent to ListCorrelate [wts/Total [wts],list]. »
- MovingAverage handles both numerical and symbolic data.
- MovingAverage gives a list of length Length [list]-r+1.
- MovingAverage works with SparseArray and TemporalData objects. »
Examples
open all close allBasic Examples (2)
Compute a pairwise simple moving average:
Compute weighted moving averages:
Scope (5)
Lists of integers yield rational numbers:
Lists of approximate numbers yield approximate numbers:
Moving averages of matrices are matrices:
Obtain results for lists of any precision:
Obtain results for weights of any precision:
Filter large datasets:
Generalizations & Extensions (4)
Compute results for a SparseArray :
A moving average of TemporalData places the result on the right end of the moving windows:
Incomplete windows are dropped:
The values of a moving average of TemporalData are equivalent to the moving average of its values:
The results of a moving average of TemporalData are placed on the right end of the window, and the windows with the smaller number of observations then requested are dropped:
The moving average of a numeric TimeSeries for various window lengths:
Incomplete windows are dropped, and the result is placed on the right end of each window:
Applications (2)
Smooth noisy data:
Compute the 100-day moving average of a financial time series:
Properties & Relations (7)
A moving average is a sequence of means:
A two‐term MovingAverage is equivalent to a two‐term MovingMedian :
MovingAverage is equivalent to MovingMap of Mean :
An n‐term moving average is equivalent to a moving average with n equal weights:
An n‐term moving average is equivalent to a ListCorrelate :
An n‐term weighted moving average is equivalent to a ListCorrelate :
Multiplying weights by a constant gives the same moving average:
See Also
Mean MovingMedian ExponentialMovingAverage Partition ListCorrelate Accumulate MovingMap
Function Repository: CumulativeAverages HampelFilter
Tech Notes
Related Guides
-
▪
- Data Transforms and Smoothing ▪
- Handling Arrays of Data ▪
- Statistical Data Analysis ▪
- Time Series Processes ▪
- Financial & Economic Data ▪
- Numerical Data ▪
- Time Series Processing ▪
- Linear and Nonlinear Filters ▪
- Scientific Data Analysis ▪
- Financial Computation ▪
- Socioeconomic & Demographic Data ▪
- Signal Visualization & Analysis ▪
- Signal Filtering & Filter Design
History
Text
Wolfram Research (2007), MovingAverage, Wolfram Language function, https://reference.wolfram.com/language/ref/MovingAverage.html.
CMS
Wolfram Language. 2007. "MovingAverage." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MovingAverage.html.
APA
Wolfram Language. (2007). MovingAverage. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MovingAverage.html
BibTeX
@misc{reference.wolfram_2025_movingaverage, author="Wolfram Research", title="{MovingAverage}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/MovingAverage.html}", note=[Accessed: 17-November-2025]}
BibLaTeX
@online{reference.wolfram_2025_movingaverage, organization={Wolfram Research}, title={MovingAverage}, year={2007}, url={https://reference.wolfram.com/language/ref/MovingAverage.html}, note=[Accessed: 17-November-2025]}