# CentralMoment

CentralMoment[list,r]

gives the r central moment of the elements in list with respect to their mean.

CentralMoment[dist,r]

gives the r central moment of the distribution dist.

represents the r formal central moment.

# Details • CentralMoment is also known as a moment about the mean.
• CentralMoment handles both numerical and symbolic data.
• For the list {x1,x2,,xn}, the  central moment is given by , where is the mean of the list.
• CentralMoment[{{x1,y1,},,{xn,yn,}},{rx,ry,}] gives .
• For a distribution dist, the r central moment is given by Expectation[(x-Mean[dist])r,xdist].
• For a multivariate distribution dist, the {r1,r2,} central moment is given by Expectation[(x1-μ1)r1(x2-μ2)r2,{x1,x2,}dist] and {μ1,μ2,}==Mean[dist].
• can be used in functions such as MomentConvert and MomentEvaluate, etc.

# Examples

open allclose all

## Basic Examples(2)

Compute central moments from data:

Use symbolic data:

Compute the second central moment of a univariate distribution:

The central moment of a multivariate distribution:

## Scope(18)

### Data Moments(9)

Exact input yields exact output:

Approximate input yields approximate output:

CentralMoment for a matrix gives column-wise moments:

CentralMoment for a tensor gives column-wise moments at the first level:

Work with large arrays:

SparseArray data can be used just like dense arrays:

Find central moments of WeightedData:

Find a central moment of EventData:

Find a central moment of TimeSeries:

The moment depends only on the values:

Find a central moment for data involving quantities:

### Distribution and Process Moments(5)

Find the central moments for univariate distributions:

Multivariate distributions:

Compute a central moment for a symbolic order r:

A central moment may only evaluate for specific orders:

A central moment may only evaluate numerically:

Central moments for derived distributions:

Data distribution:

Central moment function for a random process:

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

Find the corresponding moment function together with all the simulations:

### Formal Moments(4)

Convert combinations of formal moments to an expression involving CentralMoment:

Evaluate an expression involving formal moments for a distribution:

Evaluate for data:

Find a sample estimator for an expression involving CentralMoment:

Evaluate the resulting estimator for data:

## Applications(11)

The first central moment is 0:

The second central moment is a measure of dispersion:

The third central moment is a measure of skewness:

Estimate parameters of a distribution using the method of moments:

Compare data and the estimated parametric distribution:

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

Show how and depend on and :

Compare an original and an approximated distribution:

Construct a sample estimator of the second central moment:

Find its sample distribution expectation, assuming sample size :

Find sample distribution variance of the estimator:

Variance of the estimator for uniformly distributed sample:

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:

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

Function computing sample JarqueBera statistics [link]:

Accumulate statistics on samples of normal random variates:

Compare the statistics histogram with an asymptotic distribution:

Compute a moving central moment for some data:

Use the window of length .1:

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

Choose a few slice times:

Plot central moments over these paths:

## Properties & Relations(9)

Central moments are translation invariant:

The second central moment is a scaled Variance:

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

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

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

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

CentralMoment of order is equivalent to when both exist:

Use CentralMoment directly:

Find the central moment-generating function by using GeneratingFunction:

Compare with direct evaluation of CentralMomentGeneratingFunction:

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

## Possible Issues(2)

Moments of higher order are undefined for a heavy-tailed distribution:

Compute central moments on 5 independent samples of the distribution:

Sample central moments of higher order exhibit wild fluctuations:

Sample estimators of central moments are biased:

Find sampling population expectation assuming a sample of size :

The estimator is asymptotically unbiased:

Construct an unbiased estimator:

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

## Neat Examples(1)

The distribution of CentralMoment estimates for 20, 100, and 300 samples: