MeanDeviation
✖
MeanDeviation

Details


- MeanDeviation is also known as MAD.
- MeanDeviation is a measure of dispersion.
- For VectorQ data
, the mean deviation
is given by
, where
is the mean of data.
- For MatrixQ data, the mean deviation is computed for each column vector with MeanDeviation[{{x1,y1,…},{x2,y2,…},…}] equivalent to {MeanDeviation[{x1,x2,…}],MeanDeviation[{y1,y2,…}],…}. »
- For ArrayQ data, the mean deviation is equivalent to ArrayReduce[MeanDeviation,data,1]. »
- MeanDeviation handles both numerical and symbolic data.
- The data can have the following additional forms and interpretations:
-
Association the values (the keys are ignored) » SparseArray as an array, equivalent to Normal[data] » QuantityArray quantities as an array » WeightedData based on the underlying EmpiricalDistribution » EventData based on the underlying SurvivalDistribution » TimeSeries, TemporalData, … vector or array of values (the time stamps ignored) » Image,Image3D RGB channel's values or grayscale intensity value » Audio amplitude values of all channels » DateObject, TimeObject list of dates or list of times »



Examples
open allclose allBasic Examples (4)Summary of the most common use cases
MeanDeviation of a list of numbers:

https://wolfram.com/xid/0b8cgcwgeq-gax

MeanDeviation of symbolic data:

https://wolfram.com/xid/0b8cgcwgeq-rk7

MeanDeviation of the columns of a matrix:

https://wolfram.com/xid/0b8cgcwgeq-vu6sr

MeanDeviation of a list of dates:

https://wolfram.com/xid/0b8cgcwgeq-t7ech

Scope (18)Survey of the scope of standard use cases
Basic Uses (6)
Exact input yields exact output:

https://wolfram.com/xid/0b8cgcwgeq-ug7y2


https://wolfram.com/xid/0b8cgcwgeq-bcry2t

Approximate input yields approximate output:

https://wolfram.com/xid/0b8cgcwgeq-ksx55


https://wolfram.com/xid/0b8cgcwgeq-d02ofx

Find the mean deviation of WeightedData:

https://wolfram.com/xid/0b8cgcwgeq-d0wc9z


https://wolfram.com/xid/0b8cgcwgeq-f1vfw

https://wolfram.com/xid/0b8cgcwgeq-qyv0h

Find the mean deviation of EventData:

https://wolfram.com/xid/0b8cgcwgeq-e67u14

https://wolfram.com/xid/0b8cgcwgeq-or2nrz

Find the mean deviation for TimeSeries:

https://wolfram.com/xid/0b8cgcwgeq-tolh7

The mean deviation depends only on the values:

https://wolfram.com/xid/0b8cgcwgeq-hfeo7e

Find the mean deviation of data involving quantities:

https://wolfram.com/xid/0b8cgcwgeq-jopin9


https://wolfram.com/xid/0b8cgcwgeq-e8c21s

Array Data (5)
MeanDeviation for a matrix works columnwise:

https://wolfram.com/xid/0b8cgcwgeq-ezu2uz

MeanDeviation for a tensor works across the first index: »

https://wolfram.com/xid/0b8cgcwgeq-lw96ov


https://wolfram.com/xid/0b8cgcwgeq-nknun


https://wolfram.com/xid/0b8cgcwgeq-ma3v2m

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

https://wolfram.com/xid/0b8cgcwgeq-cs7n5q


https://wolfram.com/xid/0b8cgcwgeq-rvy4yi

SparseArray data can be used just like dense arrays:

https://wolfram.com/xid/0b8cgcwgeq-n691tv


https://wolfram.com/xid/0b8cgcwgeq-drrysl


https://wolfram.com/xid/0b8cgcwgeq-l4ct3


https://wolfram.com/xid/0b8cgcwgeq-d6csj0

Find mean deviation of a QuantityArray:

https://wolfram.com/xid/0b8cgcwgeq-lgwnaj


https://wolfram.com/xid/0b8cgcwgeq-k03qc6

Image and Audio Data (2)
Channelwise mean deviation value of an RGB image:

https://wolfram.com/xid/0b8cgcwgeq-hfby9q


https://wolfram.com/xid/0b8cgcwgeq-phlz4o

Mean deviation value of a grayscale image:

https://wolfram.com/xid/0b8cgcwgeq-ue2gq5

On audio objects, MeanDeviation works channelwise:

https://wolfram.com/xid/0b8cgcwgeq-nq1jnz


https://wolfram.com/xid/0b8cgcwgeq-mjmudf


https://wolfram.com/xid/0b8cgcwgeq-bs38vd

Date and Time (5)
Compute mean deviation of dates:

https://wolfram.com/xid/0b8cgcwgeq-b1smxx

https://wolfram.com/xid/0b8cgcwgeq-pa4nmn


https://wolfram.com/xid/0b8cgcwgeq-uok1il


https://wolfram.com/xid/0b8cgcwgeq-6atd9o

Compute the weighted mean deviation of dates:

https://wolfram.com/xid/0b8cgcwgeq-c98kbd


https://wolfram.com/xid/0b8cgcwgeq-8c1had

https://wolfram.com/xid/0b8cgcwgeq-t71b2h

Compute the mean deviation of dates given in different calendars:

https://wolfram.com/xid/0b8cgcwgeq-wbzcuv


https://wolfram.com/xid/0b8cgcwgeq-9ius88


https://wolfram.com/xid/0b8cgcwgeq-qe5gbw

Compute the mean deviation of times:

https://wolfram.com/xid/0b8cgcwgeq-et9bla


https://wolfram.com/xid/0b8cgcwgeq-ztsexm

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

https://wolfram.com/xid/0b8cgcwgeq-mrqghz


https://wolfram.com/xid/0b8cgcwgeq-1d7sk5

Applications (3)Sample problems that can be solved with this function
Identify periods of high volatility in stock data using a five-year moving mean deviation:

https://wolfram.com/xid/0b8cgcwgeq-l3ry64

https://wolfram.com/xid/0b8cgcwgeq-kfgcti

https://wolfram.com/xid/0b8cgcwgeq-bef0x

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

https://wolfram.com/xid/0b8cgcwgeq-8se1zg

https://wolfram.com/xid/0b8cgcwgeq-52xxug

https://wolfram.com/xid/0b8cgcwgeq-iakfqb
Plot mean deviations over these paths:

https://wolfram.com/xid/0b8cgcwgeq-tvmkqe

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

https://wolfram.com/xid/0b8cgcwgeq-cevfij

https://wolfram.com/xid/0b8cgcwgeq-fllmtw


https://wolfram.com/xid/0b8cgcwgeq-celepo

Plot the mean deviation respective of the mean:

https://wolfram.com/xid/0b8cgcwgeq-g98mgx

Properties & Relations (4)Properties of the function, and connections to other functions
MeanDeviation is the Mean of absolute deviations from the Mean:

https://wolfram.com/xid/0b8cgcwgeq-793v1

https://wolfram.com/xid/0b8cgcwgeq-b9x4up


https://wolfram.com/xid/0b8cgcwgeq-bhsxlb

MeanDeviation is equivalent to the 1‐norm of the deviations divided by the Length:

https://wolfram.com/xid/0b8cgcwgeq-m0xfm

https://wolfram.com/xid/0b8cgcwgeq-hh6mz4


https://wolfram.com/xid/0b8cgcwgeq-i5cfjy

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

https://wolfram.com/xid/0b8cgcwgeq-dso2q7

https://wolfram.com/xid/0b8cgcwgeq-vy95m


https://wolfram.com/xid/0b8cgcwgeq-hfsstq

MeanDeviation as a scaled ManhattanDistance from the Mean:

https://wolfram.com/xid/0b8cgcwgeq-hx9oab


https://wolfram.com/xid/0b8cgcwgeq-cg5jg0


https://wolfram.com/xid/0b8cgcwgeq-pf9xkh


https://wolfram.com/xid/0b8cgcwgeq-zp24k

Neat Examples (1)Surprising or curious use cases
Ratio of MeanDeviation to MedianDeviation for increasing sample size:

https://wolfram.com/xid/0b8cgcwgeq-ph16p

https://wolfram.com/xid/0b8cgcwgeq-jq0tcn

Wolfram Research (2007), MeanDeviation, Wolfram Language function, https://reference.wolfram.com/language/ref/MeanDeviation.html (updated 2024).
Text
Wolfram Research (2007), MeanDeviation, Wolfram Language function, https://reference.wolfram.com/language/ref/MeanDeviation.html (updated 2024).
Wolfram Research (2007), MeanDeviation, Wolfram Language function, https://reference.wolfram.com/language/ref/MeanDeviation.html (updated 2024).
CMS
Wolfram Language. 2007. "MeanDeviation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/MeanDeviation.html.
Wolfram Language. 2007. "MeanDeviation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/MeanDeviation.html.
APA
Wolfram Language. (2007). MeanDeviation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeanDeviation.html
Wolfram Language. (2007). MeanDeviation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeanDeviation.html
BibTeX
@misc{reference.wolfram_2025_meandeviation, author="Wolfram Research", title="{MeanDeviation}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/MeanDeviation.html}", note=[Accessed: 27-February-2025
]}
BibLaTeX
@online{reference.wolfram_2025_meandeviation, organization={Wolfram Research}, title={MeanDeviation}, year={2024}, url={https://reference.wolfram.com/language/ref/MeanDeviation.html}, note=[Accessed: 27-February-2025
]}