CentralMoment

CentralMoment[data,r]

gives the order r central moment of data.

CentralMoment[data,{r1,,rm}]

gives the order {r1,,rm} multivariate central moment of data.

CentralMoment[dist,]

gives the central moment of the distribution dist.

CentralMoment[r]

represents the order r formal central moment.

Details

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  (22)

Basic Uses  (6)

Exact input yields exact output:

Approximate input yields approximate output:

Find central moments of WeightedData:

Find a central moment of EventData:

Find a central moment of TimeSeries:

Central moment depends only on the values:

Find a central moment for data involving quantities:

Array Data  (5)

For a matrix, CentralMoment gives columnwise moments:

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

Multivariate CentralMoment for an array:

Works with large arrays:

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

SparseArray data can be used just like dense arrays:

Find the central moment of a QuantityArray:

Image and Audio Data  (2)

Channelwise central moment of an RGB image:

Central moment intensity value of a grayscale image:

On audio objects, CentralMoment works channelwise:

Distribution and Process Moments  (5)

Find 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 central moment function together with all the simulations:

Formal Moments  (4)

TraditionalForm formatting for formal moments:

Convert combinations of formal moments to an expression involving CentralMoment:

Evaluate an expression involving formal moments TemplateBox[{2}, CentralMoment]+TemplateBox[{4}, CentralMoment] 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 always 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  (11)

Central moments are translation invariant:

The second central moment is a scaled Variance:

The odd moments of 2×2 matrices vanish:

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

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

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 momentgenerating function by using GeneratingFunction:

Compare with direct evaluation of CentralMomentGeneratingFunction:

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

Possible Issues  (2)

Central 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:

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

Text

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

CMS

Wolfram Language. 2007. "CentralMoment." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. 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

BibTeX

@misc{reference.wolfram_2023_centralmoment, author="Wolfram Research", title="{CentralMoment}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/CentralMoment.html}", note=[Accessed: 13-April-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_centralmoment, organization={Wolfram Research}, title={CentralMoment}, year={2023}, url={https://reference.wolfram.com/language/ref/CentralMoment.html}, note=[Accessed: 13-April-2024 ]}