Mean
✖
Mean

Details




- Mean is also known as an expectation or average.
- Mean is a location measure for data or distributions.
- For VectorQ data
, the mean estimate
is given by
.
- For MatrixQ data, the mean estimate
is computed for each column vector with Mean[{{x1,y1,…},{x2,y2,…},…}] equivalent to {Mean[{x1,x2,…}],Mean[{y1,y2,…}],…}. »
- For ArrayQ data, the mean estimate is equivalent to ArrayReduce[Mean,data,1]. »
- For WeightedData[{x1,x2,…},{w1,w2,…}], the mean estimate is given by
. »
- Mean handles both numerical and symbolic data.
- The data can have the following additional forms and interpretations:
-
Association the values (the keys are ignored) » WeightedData weighted mean, 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 channels values or grayscale intensity value » Audio amplitude values of all channels » DateObject,TimeObject list of dates or list of times » - For a list of dates
, the mean is given by
, which is date
plus sum of durations
.
- For a univariate distribution dist, the mean is given by μ=Expectation[x,xdist]. »
- For multivariate distribution dist, the mean is given by {μx ,μy,…}=Expectation[{x,y,…},{x,y,…}dist]. »
- For a random process proc, the mean function can be computed for slice distribution at time t, SliceDistribution[proc,t], as μ[t]=Mean[SliceDistribution[proc,t]]. »






Examples
open allclose allBasic Examples (5)Summary of the most common use cases

https://wolfram.com/xid/02cai-hrx


https://wolfram.com/xid/02cai-idj

Means of elements in each column:

https://wolfram.com/xid/02cai-zf6


https://wolfram.com/xid/02cai-t7ech


https://wolfram.com/xid/02cai-ziof1v

Mean of a parametric distribution:

https://wolfram.com/xid/02cai-1ikye

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

https://wolfram.com/xid/02cai-ug7y2


https://wolfram.com/xid/02cai-bcry2t

Approximate input yields approximate output:

https://wolfram.com/xid/02cai-ksx55


https://wolfram.com/xid/02cai-d02ofx

Find the mean of WeightedData:

https://wolfram.com/xid/02cai-d0wc9z


https://wolfram.com/xid/02cai-f1vfw

https://wolfram.com/xid/02cai-qyv0h

Find the mean of EventData:

https://wolfram.com/xid/02cai-e67u14

https://wolfram.com/xid/02cai-or2nrz

Find the mean of a TimeSeries:

https://wolfram.com/xid/02cai-iaswcf

https://wolfram.com/xid/02cai-ffhpdi

The mean depends only on the values:

https://wolfram.com/xid/02cai-fy9fte


https://wolfram.com/xid/02cai-kfbxcw

Find the mean of data involving quantities:

https://wolfram.com/xid/02cai-jopin9


https://wolfram.com/xid/02cai-e8c21s

Array Data (5)
Mean for a matrix gives columnwise means:

https://wolfram.com/xid/02cai-ezu2uz

Mean for a arrays gives columnwise means at the first level:

https://wolfram.com/xid/02cai-lw96ov


https://wolfram.com/xid/02cai-nknun


https://wolfram.com/xid/02cai-ma3v2m

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

https://wolfram.com/xid/02cai-cs7n5q


https://wolfram.com/xid/02cai-rvy4yi

SparseArray data can be used just like dense arrays:

https://wolfram.com/xid/02cai-n691tv


https://wolfram.com/xid/02cai-drrysl


https://wolfram.com/xid/02cai-l4ct3


https://wolfram.com/xid/02cai-d6csj0

Find mean of a QuantityArray:

https://wolfram.com/xid/02cai-lgwnaj


https://wolfram.com/xid/02cai-k03qc6

Image and Audio Data (2)
Channel-wise mean value of an RGB image:

https://wolfram.com/xid/02cai-hfby9q


https://wolfram.com/xid/02cai-phlz4o

Mean intensity value of a grayscale image:

https://wolfram.com/xid/02cai-ue2gq5

On audio objects, Mean works channel-wise:

https://wolfram.com/xid/02cai-nq1jnz


https://wolfram.com/xid/02cai-mjmudf


https://wolfram.com/xid/02cai-bs38vd

Date and Time (4)

https://wolfram.com/xid/02cai-b1smxx

https://wolfram.com/xid/02cai-pa4nmn


https://wolfram.com/xid/02cai-uok1il

Compute the weighted mean of dates:

https://wolfram.com/xid/02cai-c98kbd


https://wolfram.com/xid/02cai-8c1had

https://wolfram.com/xid/02cai-t71b2h

Compute the mean of dates given in different calendars:

https://wolfram.com/xid/02cai-wbzcuv


https://wolfram.com/xid/02cai-lyrjbs

The mean is given in one of the input calendars:

https://wolfram.com/xid/02cai-9ius88


https://wolfram.com/xid/02cai-qe5gbw


https://wolfram.com/xid/02cai-et9bla


https://wolfram.com/xid/02cai-ztsexm

List of times with different time zone specifications:

https://wolfram.com/xid/02cai-mrqghz


https://wolfram.com/xid/02cai-1d7sk5


https://wolfram.com/xid/02cai-ldn4s4

Distributions and Processes (5)
Find the mean for univariate distributions:

https://wolfram.com/xid/02cai-rxz55


https://wolfram.com/xid/02cai-hbq28j


https://wolfram.com/xid/02cai-ek075b


https://wolfram.com/xid/02cai-lzwoz3

Mean for derived distributions:

https://wolfram.com/xid/02cai-rgc72x


https://wolfram.com/xid/02cai-byqvvz


https://wolfram.com/xid/02cai-215ry

https://wolfram.com/xid/02cai-fq5ptk

Mean for distributions with quantities:

https://wolfram.com/xid/02cai-b43qn8


https://wolfram.com/xid/02cai-fxupr5


https://wolfram.com/xid/02cai-j6hwjw

Mean function for a continuous-time random and discrete-state process:

https://wolfram.com/xid/02cai-c4ojmv


https://wolfram.com/xid/02cai-g9pmgp

Find the mean of TemporalData at some time t=0.5:

https://wolfram.com/xid/02cai-jfiydh


https://wolfram.com/xid/02cai-cnazd

Find the mean function together with all the simulations:

https://wolfram.com/xid/02cai-bdty7n

Applications (11)Sample problems that can be solved with this function
Basic Applications (5)
The mean represents the center of mass for a distribution:

https://wolfram.com/xid/02cai-cdcslf

https://wolfram.com/xid/02cai-qt88jt

The mean for distributions without a single mode:

https://wolfram.com/xid/02cai-ce64dk

https://wolfram.com/xid/02cai-foavzj

The mean for multivariate distributions:

https://wolfram.com/xid/02cai-nh16ep

https://wolfram.com/xid/02cai-db82mz

Mean values of cells in a sequence of steps of 2D cellular automaton evolution:

https://wolfram.com/xid/02cai-f6i

Compute means for slices of a collection of paths of a random process:

https://wolfram.com/xid/02cai-8se1zg

https://wolfram.com/xid/02cai-52xxug

https://wolfram.com/xid/02cai-iakfqb

https://wolfram.com/xid/02cai-tvmkqe

Applications (6)
Find the mean height for the children in a class:

https://wolfram.com/xid/02cai-doufxt

https://wolfram.com/xid/02cai-k8lwe


https://wolfram.com/xid/02cai-bbuq7u


https://wolfram.com/xid/02cai-wtptgb

Find the mean height for the children in a class:

https://wolfram.com/xid/02cai-cevfij

https://wolfram.com/xid/02cai-fllmtw


https://wolfram.com/xid/02cai-celepo


https://wolfram.com/xid/02cai-cny2bx

Find the mean strength for 480 samples of ceramic material:

https://wolfram.com/xid/02cai-t28mn

https://wolfram.com/xid/02cai-kqueul


https://wolfram.com/xid/02cai-d0uzg2

Plot a Histogram for the data with mean position highlighted:

https://wolfram.com/xid/02cai-udd21q

https://wolfram.com/xid/02cai-vomdk1

Compute the probability that the strength exceeds the mean:

https://wolfram.com/xid/02cai-bs6d63

Compute the mean lifetime for a quantity subject to exponential decay with rate :

https://wolfram.com/xid/02cai-ju4zmq

Smooth an irregularly spaced time series by computing a moving mean:

https://wolfram.com/xid/02cai-tuglf3

https://wolfram.com/xid/02cai-d4ls8q

https://wolfram.com/xid/02cai-fjo2gi

A vacuum system in a small electron accelerator contains 20 vacuum bulbs arranged in a circle. The vacuum system fails if at least 3 adjacent vacuum bulbs fail:

https://wolfram.com/xid/02cai-ll1p6f

https://wolfram.com/xid/02cai-yzvkim

https://wolfram.com/xid/02cai-ig5yz3

https://wolfram.com/xid/02cai-m9nudo

https://wolfram.com/xid/02cai-fmqdbm

Compute the mean time to failure:

https://wolfram.com/xid/02cai-xext1o

Properties & Relations (17)Properties of the function, and connections to other functions
Mean is Total divided by Length:

https://wolfram.com/xid/02cai-kxw


https://wolfram.com/xid/02cai-lqd

Mean is equivalent to a 1‐norm divided by Length for positive values:

https://wolfram.com/xid/02cai-i96jjd

https://wolfram.com/xid/02cai-1z6z5


https://wolfram.com/xid/02cai-jsdb4x

Mean of WeightedData is equivalent to the mean of the EmpiricalDistribution of the data:

https://wolfram.com/xid/02cai-h4u0sw


https://wolfram.com/xid/02cai-7uxvba


https://wolfram.com/xid/02cai-ic85bc


https://wolfram.com/xid/02cai-s3rbyq

Mean of EventData is equivalent to the mean of the SurvivalDistribution of the data:

https://wolfram.com/xid/02cai-1hdnl4


https://wolfram.com/xid/02cai-q4w4mm


https://wolfram.com/xid/02cai-gbz2mn


https://wolfram.com/xid/02cai-7uq9qi

For nearly symmetric samples, Mean and Median are nearly the same:

https://wolfram.com/xid/02cai-t9n


https://wolfram.com/xid/02cai-cfc


https://wolfram.com/xid/02cai-erqvhl

https://wolfram.com/xid/02cai-eyllwj


https://wolfram.com/xid/02cai-h1qxa

The Mean of absolute deviations from the Mean is MeanDeviation:

https://wolfram.com/xid/02cai-793v1

https://wolfram.com/xid/02cai-bhsxlb


https://wolfram.com/xid/02cai-b9x4up

Mean is logarithmically related to GeometricMean for positive values:

https://wolfram.com/xid/02cai-ebg6dq


https://wolfram.com/xid/02cai-24ovr

Mean is the inverse of HarmonicMean of the inverse of the data:

https://wolfram.com/xid/02cai-bvbvtz

https://wolfram.com/xid/02cai-2fgcb


https://wolfram.com/xid/02cai-f73eok

The square root of Mean of the data squared is RootMeanSquare:

https://wolfram.com/xid/02cai-hqtrtd

https://wolfram.com/xid/02cai-cyyyvo

The n CentralMoment is the Mean of deviations raised to the n
power:

https://wolfram.com/xid/02cai-g8e1st


https://wolfram.com/xid/02cai-6s2s3

Variance is a scaled Mean of squared deviations from the Mean:

https://wolfram.com/xid/02cai-brtwin

https://wolfram.com/xid/02cai-hmk853


https://wolfram.com/xid/02cai-cibwnc

Expectation for a list is a Mean:

https://wolfram.com/xid/02cai-ba2oj3


https://wolfram.com/xid/02cai-hemld8

MovingAverage is a sequence of means:

https://wolfram.com/xid/02cai-bxc2b1


https://wolfram.com/xid/02cai-i0fg4m

A 0% TrimmedMean is the same as Mean:

https://wolfram.com/xid/02cai-k3hcsh


https://wolfram.com/xid/02cai-fc96q6

The Expectation of a random variable in a distribution is the Mean:

https://wolfram.com/xid/02cai-cl5rpb


https://wolfram.com/xid/02cai-ekl2fe

LocationTest tests whether the mean is close to 0:

https://wolfram.com/xid/02cai-w9gyw

https://wolfram.com/xid/02cai-eafvmq


https://wolfram.com/xid/02cai-iosml1


https://wolfram.com/xid/02cai-ca4gle

LocationEquivalenceTest tests for equivalence of means in two or more datasets:

https://wolfram.com/xid/02cai-ch52p0

https://wolfram.com/xid/02cai-cytau2


https://wolfram.com/xid/02cai-h6zobm


https://wolfram.com/xid/02cai-c79z3d

Possible Issues (1)Common pitfalls and unexpected behavior
Outliers can have a disproportionate effect on Mean:

https://wolfram.com/xid/02cai-vlx43

Use TrimmedMean to ignore a fraction of the smallest and largest elements:

https://wolfram.com/xid/02cai-blvoit

Use Median as something much less sensitive to outliers:

https://wolfram.com/xid/02cai-fueg3r

Neat Examples (1)Surprising or curious use cases
The distribution of Mean estimates for 10, 100, and 300 samples:

https://wolfram.com/xid/02cai-8raem

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