WOLFRAM

gives the median absolute deviation from the median of the elements in data.

Details

Examples

open allclose all

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

MedianDeviation of a list:

Out[1]=1

MedianDeviation of columns of a matrix:

Out[1]=1

MedianDeviation of a list of dates:

Out[1]=1

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

Basic Uses  (6)

Exact input yields exact output:

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

Approximate input yields approximate output:

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

Find the median deviation of WeightedData:

Out[2]=2

Find the median deviation of EventData:

Out[2]=2

Find the median deviation of TimeSeries:

Out[1]=1

The median deviation depends only on the values:

Out[2]=2

Find the median deviation of data involving quantities:

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

Array Data  (5)

MedianDeviation for a matrix works columnwise:

Out[2]=2

MedianDeviation for a tensor gives the columnwise median deviation at the first level:

Out[3]=3

Works with large arrays:

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

When the input is an Association, median deviation works on its values:

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

SparseArray data can be used just like dense arrays:

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

Find the median deviation of a QuantityArray:

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

Image and Audio Data  (2)

Channelwise median deviation value of an RGB image:

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

Median deviation value of a grayscale image:

Out[3]=3

On audio objects, MedianDeviation works channelwise:

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

Date and Time  (5)

Compute median deviation of dates:

Out[2]=2
Out[3]=3

Compute the weighted median deviation of dates:

Out[1]=1
Out[4]=4
Out[5]=5

Compute the median deviation of dates given in different calendars:

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

Compute the median deviation of times:

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

Compute the median deviation of times with different time zone specifications:

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

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

Obtain a robust estimate of dispersion when extreme values are present:

Out[1]=1

Measures based on the Mean are heavily influenced by extreme values:

Out[2]=2
Out[3]=3

Identify periods of high volatility in stock data using a five-year moving median deviation:

Out[3]=3

Compute median deviations for slices of a collection of paths of a random process:

Choose a few slice times:

Plot median deviations over these paths:

Out[4]=4

Find the median deviation of the heights for the children in a class:

Out[2]=2
Out[3]=3

Plot the median deviation respective of the median:

Out[4]=4

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

MedianDeviation is the Median of absolute deviations from the Median:

Out[2]=2
Out[3]=3

For large uniform datasets, MedianDeviation and MeanDeviation are nearly the same:

Out[2]=2
Out[3]=3

Possible Issues  (1)Common pitfalls and unexpected behavior

MedianDeviation requires real numeric values:

Out[1]=1

Neat Examples  (1)Surprising or curious use cases

Ratio of MedianDeviation to MeanDeviation for increasing sample size:

Out[5]=5
Wolfram Research (2007), MedianDeviation, Wolfram Language function, https://reference.wolfram.com/language/ref/MedianDeviation.html (updated 2024).
Wolfram Research (2007), MedianDeviation, Wolfram Language function, https://reference.wolfram.com/language/ref/MedianDeviation.html (updated 2024).

Text

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

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

CMS

Wolfram Language. 2007. "MedianDeviation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/MedianDeviation.html.

Wolfram Language. 2007. "MedianDeviation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/MedianDeviation.html.

APA

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

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

BibTeX

@misc{reference.wolfram_2025_mediandeviation, author="Wolfram Research", title="{MedianDeviation}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/MedianDeviation.html}", note=[Accessed: 25-March-2025 ]}

@misc{reference.wolfram_2025_mediandeviation, author="Wolfram Research", title="{MedianDeviation}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/MedianDeviation.html}", note=[Accessed: 25-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_mediandeviation, organization={Wolfram Research}, title={MedianDeviation}, year={2024}, url={https://reference.wolfram.com/language/ref/MedianDeviation.html}, note=[Accessed: 25-March-2025 ]}

@online{reference.wolfram_2025_mediandeviation, organization={Wolfram Research}, title={MedianDeviation}, year={2024}, url={https://reference.wolfram.com/language/ref/MedianDeviation.html}, note=[Accessed: 25-March-2025 ]}