CentralMoment
✖
CentralMoment

Details


- CentralMoment is also known as a moment about the mean.
- For scalar order r and data being an array
, with mean (first raw moment)
:
-
sum of r powers »
columnwise sum of r central powers »
columnwise sum of r central powers »
- CentralMoment[x,r] is equivalent to ArrayReduce[CentralMoment[#,r]&,x,1].
- For vector order {r1,…,rm} and data being array
, with first raw moment
:
-
sum the rj central power in the j
column
sum the rj central power in the j
column »
- CentralMoment[x,{r1,…,rm}] is equivalent to ArrayReduce[CentralMoment[#,
]&,x,{{1},{2}}].
- CentralMoment 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 distribution dist, the r
central moment is given by Expectation[(x-Mean[dist])r,xdist]. »
- For a multivariate distribution dist, the {r1,…,rm}
central moment is given by Expectation[(x1-μ1)r1⋯(x2-μm)rm,{x1,…,xm}dist] and {μ1,…,μm}=Mean[dist]. »
- For a random process proc, the central moment function can be computed for slice distribution at time t, SliceDistribution[proc,t], as
[t]=CentralMoment[SliceDistribution[proc,t],r]. »
- CentralMoment[r] can be used in functions such as MomentConvert and MomentEvaluate, etc. »
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Compute central moments from data:

https://wolfram.com/xid/0btnctlz7s76-dcqcf1

https://wolfram.com/xid/0btnctlz7s76-lungnq


https://wolfram.com/xid/0btnctlz7s76-eek0j9

Central moment of a list of dates:

https://wolfram.com/xid/0btnctlz7s76-cbohkf

Compute the second central moment of a univariate distribution:

https://wolfram.com/xid/0btnctlz7s76-j23te

The central moment of a multivariate distribution:

https://wolfram.com/xid/0btnctlz7s76-kcuwka

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

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


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

Approximate input yields approximate output:

https://wolfram.com/xid/0btnctlz7s76-h8nmns


https://wolfram.com/xid/0btnctlz7s76-nd4o47

Find central moments of WeightedData:

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


https://wolfram.com/xid/0btnctlz7s76-ivp7e5

https://wolfram.com/xid/0btnctlz7s76-u6rq8

Find a central moment of EventData:

https://wolfram.com/xid/0btnctlz7s76-bailc9

https://wolfram.com/xid/0btnctlz7s76-kiu0rh

Find a central moment of TimeSeries:

https://wolfram.com/xid/0btnctlz7s76-hf056t

Central moment depends only on the values:

https://wolfram.com/xid/0btnctlz7s76-ikztk4

Find a central moment for data involving quantities:

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


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

Array Data (5)
For a matrix, CentralMoment gives columnwise moments:

https://wolfram.com/xid/0btnctlz7s76-ypmk2

For an array, CentralMoment gives columnwise moments at the first level:

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

Multivariate CentralMoment for an array:

https://wolfram.com/xid/0btnctlz7s76-ycq1eg


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


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

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

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


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

SparseArray data can be used just like dense arrays:

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


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

Find the central moment of a QuantityArray:

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


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

Image and Audio Data (2)
Channelwise central moment of an RGB image:

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


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

Central moment intensity value of a grayscale image:

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

On audio objects, CentralMoment works channelwise:

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


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


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

Date and Time (4)
Compute central moment of dates:

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

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


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


https://wolfram.com/xid/0btnctlz7s76-wxuq26

Compute the weighted central moment of dates:

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


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

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


https://wolfram.com/xid/0btnctlz7s76-5zgepo

Compute the central moment of dates given in different calendars:

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


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


https://wolfram.com/xid/0btnctlz7s76-rszscv


https://wolfram.com/xid/0btnctlz7s76-s80xdw


https://wolfram.com/xid/0btnctlz7s76-ui0nn6

Compute the central moment of times:

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


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

List of times with different time zone specifications:

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


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

Distribution and Process Moments (5)
Scalar central moment for univariate distributions:

https://wolfram.com/xid/0btnctlz7s76-rxz55


https://wolfram.com/xid/0btnctlz7s76-hbq28j

Scalar central moment for multivariate distributions:

https://wolfram.com/xid/0btnctlz7s76-1j517u


https://wolfram.com/xid/0btnctlz7s76-l5merl

Joint central moment for multivariate distributions:

https://wolfram.com/xid/0btnctlz7s76-7l8wl


https://wolfram.com/xid/0btnctlz7s76-jkvn2g

Compute a central moment for a symbolic order r:

https://wolfram.com/xid/0btnctlz7s76-ciqigj

A central moment may only evaluate for specific orders:

https://wolfram.com/xid/0btnctlz7s76-bpile0


https://wolfram.com/xid/0btnctlz7s76-rwrvm

A central moment may only evaluate numerically:

https://wolfram.com/xid/0btnctlz7s76-ln020


https://wolfram.com/xid/0btnctlz7s76-b4qrwr

Central moments for derived distributions:

https://wolfram.com/xid/0btnctlz7s76-rgc72x


https://wolfram.com/xid/0btnctlz7s76-byqvvz


https://wolfram.com/xid/0btnctlz7s76-215ry

https://wolfram.com/xid/0btnctlz7s76-fq5ptk

Central moment function for a random process:

https://wolfram.com/xid/0btnctlz7s76-ce9dln


https://wolfram.com/xid/0btnctlz7s76-dbfsuo

Find a central moment of TemporalData at some time t=0.5:

https://wolfram.com/xid/0btnctlz7s76-jfiydh


https://wolfram.com/xid/0btnctlz7s76-cnazd

Find the corresponding central moment function together with all the simulations:

https://wolfram.com/xid/0btnctlz7s76-bdty7n

Formal Moments (4)
TraditionalForm formatting for formal moments:

https://wolfram.com/xid/0btnctlz7s76-ez91l8


https://wolfram.com/xid/0btnctlz7s76-cokql

Convert combinations of formal moments to an expression involving CentralMoment:

https://wolfram.com/xid/0btnctlz7s76-gbzg9e


https://wolfram.com/xid/0btnctlz7s76-cbig0x

Evaluate an expression involving formal moments for a distribution:

https://wolfram.com/xid/0btnctlz7s76-s71uv


https://wolfram.com/xid/0btnctlz7s76-h4q6jr

https://wolfram.com/xid/0btnctlz7s76-bopqg9

Find a sample estimator for an expression involving CentralMoment:

https://wolfram.com/xid/0btnctlz7s76-e37p0r

Evaluate the resulting estimator for data:

https://wolfram.com/xid/0btnctlz7s76-h5ch1j

https://wolfram.com/xid/0btnctlz7s76-b6huwv

Applications (11)Sample problems that can be solved with this function
The first central moment is always 0:

https://wolfram.com/xid/0btnctlz7s76-crslbj

https://wolfram.com/xid/0btnctlz7s76-cqzkfy

The second central moment is a measure of dispersion:

https://wolfram.com/xid/0btnctlz7s76-bhnrki

https://wolfram.com/xid/0btnctlz7s76-t94no


https://wolfram.com/xid/0btnctlz7s76-o9323q

The third central moment is a measure of skewness:

https://wolfram.com/xid/0btnctlz7s76-i0nm5o

https://wolfram.com/xid/0btnctlz7s76-rmx3b


https://wolfram.com/xid/0btnctlz7s76-6ujs6

Estimate parameters of a distribution using the method of moments:

https://wolfram.com/xid/0btnctlz7s76-cqmwbz

https://wolfram.com/xid/0btnctlz7s76-ihfc1c


https://wolfram.com/xid/0btnctlz7s76-olaqwi

Compare data and the estimated parametric distribution:

https://wolfram.com/xid/0btnctlz7s76-b9h1fm

Find a normal approximation to GammaDistribution using the method of moments:

https://wolfram.com/xid/0btnctlz7s76-c8m2jq

https://wolfram.com/xid/0btnctlz7s76-n59or


https://wolfram.com/xid/0btnctlz7s76-h5e2wb


https://wolfram.com/xid/0btnctlz7s76-cuvrpa

Compare an original and an approximated distribution:

https://wolfram.com/xid/0btnctlz7s76-cx5lq6

Construct a sample estimator of the second central moment:

https://wolfram.com/xid/0btnctlz7s76-dzy3m9

Find its sample distribution expectation, assuming sample size :

https://wolfram.com/xid/0btnctlz7s76-c1eov8

Find sample distribution variance of the estimator:

https://wolfram.com/xid/0btnctlz7s76-h8762t

Variance of the estimator for uniformly distributed sample:

https://wolfram.com/xid/0btnctlz7s76-db5k7y

The law of large numbers states that a sample moment approaches population moment as sample size increases. Use Histogram to show the probability distribution of a second sample central moment of uniform random variates for different sample sizes:

https://wolfram.com/xid/0btnctlz7s76-7cdyi

Edgeworth expansion for near-normal data correcting for third and fourth central moments:

https://wolfram.com/xid/0btnctlz7s76-5bgtl

https://wolfram.com/xid/0btnctlz7s76-bv90v2

https://wolfram.com/xid/0btnctlz7s76-h5x32


https://wolfram.com/xid/0btnctlz7s76-f41d13


https://wolfram.com/xid/0btnctlz7s76-l89v4f


https://wolfram.com/xid/0btnctlz7s76-m81ot

Function computing sample Jarque–Bera statistics [link]:

https://wolfram.com/xid/0btnctlz7s76-b5718y
Accumulate statistics on samples of normal random variates:

https://wolfram.com/xid/0btnctlz7s76-f3omtz
Compare the statistics histogram with an asymptotic distribution:

https://wolfram.com/xid/0btnctlz7s76-cf0ddl

Compute a moving central moment for some data:

https://wolfram.com/xid/0btnctlz7s76-rykzcc

https://wolfram.com/xid/0btnctlz7s76-yk43l

https://wolfram.com/xid/0btnctlz7s76-qa1e3e

Compute central moments for slices of a collection of paths of a random process:

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

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

https://wolfram.com/xid/0btnctlz7s76-iakfqb
Plot central moments over these paths:

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

Properties & Relations (11)Properties of the function, and connections to other functions
Central moments are translation invariant:

https://wolfram.com/xid/0btnctlz7s76-fvfes5


https://wolfram.com/xid/0btnctlz7s76-jp1zyb

The second central moment is a scaled Variance:

https://wolfram.com/xid/0btnctlz7s76-bps8zf

https://wolfram.com/xid/0btnctlz7s76-fess9s


https://wolfram.com/xid/0btnctlz7s76-ct1qwp

The odd moments of 2×2 matrices vanish:

https://wolfram.com/xid/0btnctlz7s76-gzi8l

For a multivariate order, the total order must be odd:

https://wolfram.com/xid/0btnctlz7s76-ehm9e3

The multivariate central moment of an array of depth has depth
:

https://wolfram.com/xid/0btnctlz7s76-c2btl


https://wolfram.com/xid/0btnctlz7s76-cgdohh

Sqrt of the second central moment is RootMeanSquare of deviations from the Mean:

https://wolfram.com/xid/0btnctlz7s76-cv3mrr


https://wolfram.com/xid/0btnctlz7s76-lhxq1s

Skewness is a ratio of powers of third and second central moments:

https://wolfram.com/xid/0btnctlz7s76-hqtrtd

https://wolfram.com/xid/0btnctlz7s76-bmu01k


https://wolfram.com/xid/0btnctlz7s76-hsnj4j

Kurtosis is a ratio of powers of fourth and second central moments:

https://wolfram.com/xid/0btnctlz7s76-l2sc15

https://wolfram.com/xid/0btnctlz7s76-b6hzyc


https://wolfram.com/xid/0btnctlz7s76-bn34et

CentralMoment is equivalent to an Expectation of a power of a random variable around its mean:

https://wolfram.com/xid/0btnctlz7s76-mmuq7i

https://wolfram.com/xid/0btnctlz7s76-morekx


https://wolfram.com/xid/0btnctlz7s76-gvi3di

https://wolfram.com/xid/0btnctlz7s76-cc0jtw

CentralMoment of order is equivalent to
when both exist:

https://wolfram.com/xid/0btnctlz7s76-czr41


https://wolfram.com/xid/0btnctlz7s76-ezyxs5

Use CentralMoment directly:

https://wolfram.com/xid/0btnctlz7s76-fluln

Find the central moment–generating function by using GeneratingFunction:

https://wolfram.com/xid/0btnctlz7s76-b5cc8j

Compare with direct evaluation of CentralMomentGeneratingFunction:

https://wolfram.com/xid/0btnctlz7s76-ho4xv0


https://wolfram.com/xid/0btnctlz7s76-d18vay

CentralMoment can be expressed in terms of Moment, Cumulant, or FactorialMoment:

https://wolfram.com/xid/0btnctlz7s76-cbbtti


https://wolfram.com/xid/0btnctlz7s76-nk4ghn


https://wolfram.com/xid/0btnctlz7s76-nsd3lj

Possible Issues (2)Common pitfalls and unexpected behavior
Central moments of higher order are undefined for a heavy-tailed distribution:

https://wolfram.com/xid/0btnctlz7s76-hp9qu

Compute central moments on 5 independent samples of the distribution:

https://wolfram.com/xid/0btnctlz7s76-kuv9t4
Sample central moments of higher order exhibit wild fluctuations:

https://wolfram.com/xid/0btnctlz7s76-nrj9yo

Sample estimators of central moments are biased:

https://wolfram.com/xid/0btnctlz7s76-bdle2d

Find sampling population expectation assuming a sample of size :

https://wolfram.com/xid/0btnctlz7s76-b3rhe8

The estimator is asymptotically unbiased:

https://wolfram.com/xid/0btnctlz7s76-eriz9

Construct an unbiased estimator:

https://wolfram.com/xid/0btnctlz7s76-l0zsz

The expected value of the estimator is the central moment for all sample sizes:

https://wolfram.com/xid/0btnctlz7s76-c4fl7

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

https://wolfram.com/xid/0btnctlz7s76-etk0rd


https://wolfram.com/xid/0btnctlz7s76-8raem

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