WOLFRAM

MovingMedian[list,r]

gives the moving median of list, computed using spans of r elements.

Details

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Moving median of a vector:

Out[1]=1

Moving median of a matrix:

Out[1]=1

Scope  (5)Survey of the scope of standard use cases

Compute moving medians for any numeric data:

Out[1]=1

Obtain results at machine precision:

Out[1]=1

Obtain results for lists of any precision:

Out[1]=1

Moving medians of matrices are matrices:

Out[1]=1
Out[2]=2

Moving median of a TimeSeries:

Out[2]=2

Generalizations & Extensions  (1)Generalized and extended use cases

Compute results for a SparseArray:

Out[1]=1
Out[2]=2

Applications  (2)Sample problems that can be solved with this function

Smooth noisy data:

Out[1]=1
Out[2]=2
Out[3]=3
Out[4]=4

Compute the 100-day moving median of a financial time series:

Out[1]=1
Out[2]=2

Properties & Relations  (3)Properties of the function, and connections to other functions

A moving median is a sequence of medians:

Out[1]=1
Out[2]=2

A twoterm MovingMedian is equivalent to a twoterm MovingAverage:

Out[1]=1
Out[2]=2

MovingMedian is equivalent to MovingMap of Median:

Out[1]=1
Out[2]=2
Out[3]=3
Out[4]=4

Possible Issues  (1)Common pitfalls and unexpected behavior

MovingMedian requires numeric values:

Out[1]=1
Wolfram Research (2007), MovingMedian, Wolfram Language function, https://reference.wolfram.com/language/ref/MovingMedian.html.
Wolfram Research (2007), MovingMedian, Wolfram Language function, https://reference.wolfram.com/language/ref/MovingMedian.html.

Text

Wolfram Research (2007), MovingMedian, Wolfram Language function, https://reference.wolfram.com/language/ref/MovingMedian.html.

Wolfram Research (2007), MovingMedian, Wolfram Language function, https://reference.wolfram.com/language/ref/MovingMedian.html.

CMS

Wolfram Language. 2007. "MovingMedian." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MovingMedian.html.

Wolfram Language. 2007. "MovingMedian." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MovingMedian.html.

APA

Wolfram Language. (2007). MovingMedian. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MovingMedian.html

Wolfram Language. (2007). MovingMedian. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MovingMedian.html

BibTeX

@misc{reference.wolfram_2025_movingmedian, author="Wolfram Research", title="{MovingMedian}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/MovingMedian.html}", note=[Accessed: 04-May-2025 ]}

@misc{reference.wolfram_2025_movingmedian, author="Wolfram Research", title="{MovingMedian}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/MovingMedian.html}", note=[Accessed: 04-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_movingmedian, organization={Wolfram Research}, title={MovingMedian}, year={2007}, url={https://reference.wolfram.com/language/ref/MovingMedian.html}, note=[Accessed: 04-May-2025 ]}

@online{reference.wolfram_2025_movingmedian, organization={Wolfram Research}, title={MovingMedian}, year={2007}, url={https://reference.wolfram.com/language/ref/MovingMedian.html}, note=[Accessed: 04-May-2025 ]}