MomentConvert[mexpr,form]
converts the moment expression mexpr to the specified form.
MomentConvert
MomentConvert[mexpr,form]
converts the moment expression mexpr to the specified form.
Details
- MomentConvert handles both formal moment and formal sample moment expressions.
- A formal moment expression can be any polynomial in formal moments of the form:
-
Moment[r] formal r
momentCentralMoment[r] formal r
central momentFactorialMoment[r] formal r
factorial momentCumulant[r] formal r
cumulant - Formal moment expressions can be evaluated for any particular distribution using MomentEvaluate.
- A moment expression can be converted into any other moment expression.
- The following forms can used for converting between moment expressions:
-
"Moment" convert to formal moments "CentralMoment" convert to formal central moments "FactorialMoment" convert to formal factorial moments "Cumulant" convert to formal cumulants - A sample moment expression is any polynomial in formal symmetric polynomials of the form:
-
PowerSymmetricPolynomial[r] formal r
power symmetric polynomialAugmentedSymmetricPolynomial[{r1,r2,…}] formal {r1,r2,…} augmented symmetric polynomial - Sample moment expressions can be evaluated on a dataset using MomentEvaluate.
- A sample moment expression can be converted into any other sample moment expression.
- The following forms can used for converting between sample moment expressions:
-
"PowerSymmetricPolynomial" convert to formal power symmetric polynomial "AugmentedSymmetricPolynomial" convert to formal augmented symmetric polynomial - Sample moment expressions are effectively moment estimators assuming independent, identically distributed samples.
- Moment estimators for a given moment expression can be constructed using the forms:
-
"SampleEstimator" construct a sample moment estimator "UnbiasedSampleEstimator" construct an unbiased sample moment estimator - Sample moment expressions can be considered a random variable constructed from independent, identically distributed random variables. The expected value can be found by converting from its sample moment expression to a moment expression.
- The expectation for a given sample moment expression can be computed using the forms:
-
"Moment" express in terms of formal moments "CentralMoment" express in terms of formal central moments "FactorialMoment" express in terms of formal factorial moments "Cumulant" express in terms of formal cumulants - MomentConvert[expr,form1,form2,…] first converts to form1, then to form2, etc.
Examples
open all close allBasic Examples (2)
Express the cumulant in terms of raw moments:
MomentConvert[Cumulant[2], "Moment"]//TraditionalFormExpress the multivariate cumulant in terms of central moments:
MomentConvert[Cumulant[{2, 2}], "CentralMoment"]//TraditionalFormFind an unbiased sample estimator for the second cumulant, i.e. second k-statistics:
MomentConvert[Cumulant[2], "UnbiasedSampleEstimator"]//TraditionalFormConvert the estimator to the basis of power symmetric polynomials:
MomentConvert[%, "PowerSymmetricPolynomial"]//TraditionalFormCompute expectation of the estimator in terms of raw moments:
MomentConvert[%, "Moment"]Scope (4)
Express a multivariate cumulant in terms of raw moments:
MomentConvert[Cumulant[{2, 2}], "Moment"]//TraditionalFormMomentConvert[%, "Cumulant"]Find an unbiased sample estimator for a product of univariate central moments, also known as polyache:
MomentConvert[CentralMoment[2]CentralMoment[3], "UnbiasedSampleEstimator"]//TraditionalFormMomentConvert[CentralMoment[{1, 1}]CentralMoment[{1, 1}], "UnbiasedSampleEstimator"]//TraditionalFormFind the sampling distribution estimator expectation of an augmented symmetric polynomial:
MomentConvert[AugmentedSymmetricPolynomial[{1, 2, 3}], {"Moment", n}]Convert the augmented symmetric polynomial to the basis of power symmetric polynomials:
MomentConvert[AugmentedSymmetricPolynomial[{1, 2, 3}], "PowerSymmetricPolynomial"]//TraditionalFormEvaluate at a sample of size 3:
MomentEvaluate[%, {x, y, z}]Expand[%]Compare to direct evaluation of the augmented symmetric polynomial:
MomentEvaluate[AugmentedSymmetricPolynomial[{1, 2, 3}], {x, y, z}]Generalizations & Extensions (2)
Find the h-statistic in basis of power symmetric polynomials:
MomentConvert[CentralMoment[4], "UnbiasedSampleEstimator", "PowerSymmetricPolynomial"]//TraditionalFormFind the sampling distribution expectation of a sample estimator of the third central moment:
MomentConvert[CentralMoment[3], "SampleEstimator", {"CentralMoment", n}]Applications (21)
Converting Formal Moments (2)
Convert raw moments to central moments:
Table[MomentConvert[Moment[k], CentralMoment], {k, 4}]//TraditionalFormTable[MomentConvert[Moment[k], FactorialMoment], {k, 4}]//TraditionalFormTable[MomentConvert[Moment[k], Cumulant], {k, 4}]//TraditionalFormShow all cross-conversions between formal moments:
mlist = {Moment, FactorialMoment, CentralMoment, Cumulant};Grid[Table[TraditionalForm@MomentConvert[m1[3], m2], {m1, mlist}, {m2, mlist}], Dividers -> All]Show multivariate cross-conversions between formal moments:
Grid[Table[TraditionalForm@MomentConvert[m1[{1, 1}], m2], {m1, mlist}, {m2, mlist}], Dividers -> All]Analysis of Estimators (6)
Compute a sample estimator of the variance:
cm2est = MomentConvert[CentralMoment[2], "SampleEstimator"]Compute the bias of the estimator as the mean with respect to the sampling population distribution, assuming a sample of size
:
MomentConvert[cm2est, {CentralMoment, n}]Illustrate the computation by evaluating the estimator on a symbolic sample of size 5:
MomentEvaluate[cm2est, {Subscript[x, 1], Subscript[x, 2], Subscript[x, 3], Subscript[x, 4], Subscript[x, 5]}]Now compute its expectation assuming
are independent random variates from normal distribution:
Expectation[%, {Subscript[x, 1], Subscript[x, 2], Subscript[x, 3], Subscript[x, 4], Subscript[x, 5]}ProductDistribution[{NormalDistribution[μ, σ], 5}]]Compare with the result obtained above:
With[{n = 5}, MomentEvaluate[((-1 + n) CentralMoment[2]/n), NormalDistribution[μ, σ]]]Compute the expected variance of a sample estimator of the variance:
cm2est = MomentConvert[CentralMoment[2], "SampleEstimator"];bias = MomentConvert[cm2est, {CentralMoment, n}]Compute the variance as the second central moment of the estimator:
cm2estvar = MomentConvert[(cm2est - bias) ^ 2, {Cumulant, n}]In the large sample size limit, the variance of the estimator tends to zero in agreement with the law of large numbers:
Limit[cm2estvar, n -> ∞]Perform 1000 simulations using standard normal samples of size 30:
data = Table[MomentEvaluate[cm2est, RandomVariate[NormalDistribution[], 30]], {10 ^ 3}];Compare the sample mean and variance to their expected values:
{Mean[data], MomentEvaluate[bias /. n -> 30, NormalDistribution[]]}//N{Variance[data], MomentEvaluate[cm2estvar /. n -> 30, NormalDistribution[]]}//NCompute covariance between the sample mean and sample variance estimators:
smest = MomentConvert[Moment[1], "SampleEstimator"]svest = MomentConvert[CentralMoment[2], "SampleEstimator"]Compute sampling population covariance as a mixed central moment:
EstimatorBias[est_] := MomentConvert[est, {CentralMoment, n}]MomentConvert[(smest - EstimatorBias[smest])(svest - EstimatorBias[svest]), {CentralMoment, n}]The expected covariance vanishes on normal samples:
MomentEvaluate[%, NormalDistribution[μ, σ]]Find a sample estimator of the off-diagonal covariance matrix element of two-dimensional data:
MomentConvert[CentralMoment[{1, 1}], "SampleEstimator"]Find its bias and its variance:
bias = MomentConvert[%, {CentralMoment, n}]var = MomentConvert[(%% - bias) ^ 2, {CentralMoment, n}]Compute the bias and the variance of the estimator for binormal samples:
MomentEvaluate[bias, BinormalDistribution[{Subscript[μ, 1], Subscript[μ, 2]}, {Subscript[σ, 1], Subscript[σ, 2]}, ρ]]MomentEvaluate[var, BinormalDistribution[{Subscript[μ, 1], Subscript[μ, 2]}, {Subscript[σ, 1], Subscript[σ, 2]}, ρ]]//SimplifyEstimate the sample size needed for the variance of the estimator on standard binormal samples with
not to exceed 0.001:
NSolve[n > 2∧% == 0.001 /. {ρ -> 0.5, Subscript[σ, 1] -> 1, Subscript[σ, 2] -> 1}, n]The sample estimator of the standard deviation is computed as the square root of the sample variance:
varest = MomentConvert[CentralMoment[2], "SampleEstimator"]stdest = Sqrt[varest];Such an estimator is biased and underestimates the population standard deviation:
NExpectation[MomentEvaluate[stdest, {x, y, z, u}], {x, y, z, u}ProductDistribution[{NormalDistribution[], 4}], PrecisionGoal -> 3, AccuracyGoal -> 3]The analysis of the standard deviation estimator is carried out by replacing the nonlinear function with its truncated Taylor series about the bias of its argument:
Normal[Series[Sqrt[est], {est, bias, 2}]]TraditionalForm[stestapprox = % /. {est -> varest, bias -> MomentConvert[varest, {CentralMoment, n}]}]Find the expectation of the approximated estimator:
biasapprox = MomentConvert[stestapprox, {CentralMoment, n}]//SimplifyCompute its numerical value for a standard normal sample of size
:
MomentEvaluate[biasapprox /. n -> 4, NormalDistribution[]]//NFind the variance of the estimator for normal samples:
MomentConvert[(stestapprox - biasapprox) ^ 2, {CentralMoment, n}]//MomentEvaluate[#, NormalDistribution[μ, σ]]&//SimplifyDerive finite-sample Jarque–Bera statistics
:
cm2se = MomentConvert[CentralMoment[2], "SampleEstimator"];
cm3se = MomentConvert[CentralMoment[3], "SampleEstimator"];
cm4se = MomentConvert[CentralMoment[4], "SampleEstimator"];Find the mean and variance of sample skewness estimator
on size
normal samples:
meanS = MomentEvaluate[(MomentConvert[cm3se, {CentralMoment, n}]/MomentConvert[cm2se, {CentralMoment, n}]^3 / 2), NormalDistribution[]]varS = Factor@MomentEvaluate[(MomentConvert[cm3se^2, {CentralMoment, n}]/MomentConvert[cm2se^3, {CentralMoment, n}]), NormalDistribution[]]Compute the mean and variance of sample kurtosis estimator
on size
normal samples:
meanK = MomentEvaluate[(MomentConvert[cm4se, {CentralMoment, n}]/MomentConvert[cm2se^2, {CentralMoment, n}]), NormalDistribution[]]//FactorvarK = (MomentEvaluate[(MomentConvert[(cm4se - meanK cm2se^2)^2, {CentralMoment, n}]/MomentConvert[cm2se^4, {CentralMoment, n}]), NormalDistribution[]]//Factor)JB = ((1/varS)(S - meanS)^2 + (1/varK)(K - meanK)^2)Series[JB, {n, Infinity, 1}]//FullSimplifyUnbiased Raw Moment Estimators (2)
Sample moment estimators are automatically unbiased:
MomentConvert[Moment[5], "SampleEstimator"]Compute an unbiased moment estimator in terms of power symmetric polynomials:
MomentConvert[Moment[5], "UnbiasedEstimator", "PowerSymmetricPolynomial"]Compute the sampling population expectation of the estimator:
MomentConvert[%, Moment]Compute the multivariate moment estimator:
MomentConvert[Moment[{2, 3}], "SampleEstimator"]MomentConvert[Moment[{2, 3}], "UnbiasedEstimator", "PowerSymmetricPolynomial"]Evaluate the estimator on a symbolic sample:
MomentEvaluate[%, {{Subscript[x, 1], Subscript[y, 1]}, {Subscript[x, 2], Subscript[y, 2]}, {Subscript[x, 3], Subscript[y, 3]}}]Unbiased Factorial Moment Estimators (1)
Factorial moments can be expressed as the linear combination of raw moments:
MomentConvert[FactorialMoment[3], Moment]Hence their sample estimators are automatically unbiased as well:
MomentConvert[FactorialMoment[3], "SampleEstimator"]Compute an unbiased factorial moment estimator in terms of power symmetric polynomials:
MomentConvert[FactorialMoment[3], "UnbiasedEstimator", "PowerSymmetricPolynomial"]Compute the sampling population expectation of the estimator:
MomentConvert[%, FactorialMoment]Unbiased Central Moment Estimators (3)
MomentConvert[CentralMoment[2], "UnbiasedSampleEstimator"]//TraditionalFormWrite the h-statistics in terms of power symmetric polynomials:
TraditionalForm[ues = MomentConvert[%, "PowerSymmetricPolynomial"]//FunctionExpand//Factor]Compare it with the sample estimator of the second central moment
:
TraditionalForm[ses = MomentConvert[CentralMoment[2], "SampleEstimator"]//Simplify]Find the sampling population expectation of these estimators for sample size
:
MomentConvert[ues, {CentralMoment, n}]MomentConvert[ses, {CentralMoment, n}]Compute the third h-statistics in terms of power symmetric polynomials:
TraditionalForm[ues = MomentConvert[CentralMoment[3], "UnbiasedSampleEstimator", "PowerSymmetricPolynomial"]//FunctionExpand//Factor]Compare it with the sample estimator of central moment
:
TraditionalForm[ses = MomentConvert[CentralMoment[3], "SampleEstimator"]//Simplify]Find the sampling population expectation of these estimators for sample size
:
MomentConvert[ues, {CentralMoment, n}]MomentConvert[ses, {CentralMoment, n}]//FactorFind multivariate h-statistics for
:
MomentConvert[CentralMoment[{1, 1}], "UnbiasedSampleEstimator", "PowerSymmetricPolynomial"]//FullSimplify//TraditionalFormEvaluate the estimator on a sample from a binormal distribution:
MomentEvaluate[%, RandomVariate[BinormalDistribution[1 / 2], 10 ^ 4]]Compare with the population value:
CentralMoment[BinormalDistribution[1 / 2], {1, 1}]Unbiased Cumulant Estimators (2)
Find fourth k-statistics in terms of power symmetric polynomials:
TraditionalForm[Subscript[κ, 4] = MomentConvert[Cumulant[4], "UnbiasedEstimator", "PowerSymmetricPolynomial"]]Evaluate obtained k-statistics on a standard normal sample:
MomentEvaluate[Subscript[κ, 4], RandomVariate[NormalDistribution[], 10 ^ 4]]Accumulate statistics of the estimator and show the histogram:
k4stat = Table[MomentEvaluate[Subscript[κ, 4], RandomVariate[NormalDistribution[], 10 ^ 3]], {5000}];Histogram[k4stat, 50, PDF]Compute multivariate k-statistics for
:
MomentConvert[Cumulant[{1, 1, 1}], "UnbiasedEstimator", "PowerSymmetricPolynomial"]//FullSimplify//TraditionalFormCompare it to the sample estimator:
% / MomentConvert[Cumulant[{1, 1, 1}], "SampleEstimator"]//Factor//TraditionalFormCompound Estimators (3)
Find the unbiased estimator of the second power of mean:
MomentConvert[Moment[1] ^ 2, "UnbiasedEstimator", "PowerSymmetricPolynomial"]//FullSimplify//TraditionalFormEvaluate it on a symbolic sample:
MomentEvaluate[%, {Subscript[x, 1], Subscript[x, 2], Subscript[x, 3], Subscript[x, 4]}]//FactorFind the sample population expectation:
Expectation[%, {Subscript[x, 1], Subscript[x, 2], Subscript[x, 3], Subscript[x, 4]}ProductDistribution[{NormalDistribution[μ, σ], 4}]]Compute the unbiased estimator of the product of cumulants, also known as polykay:
MomentConvert[Cumulant[2]Cumulant[3], "UnbiasedEstimator"]//TraditionalFormExpress it in terms of power symmetric polynomials:
MomentConvert[%, "PowerSymmetricPolynomial"]//FullSimplify//TraditionalFormFind the unbiased estimator of the product of multivariate central moments, also known as polyache:
MomentConvert[CentralMoment[{1, 2}]CentralMoment[{2, 1}], "UnbiasedEstimator"]//TraditionalFormFind the value of the estimator on a multivariate sample:
MomentEvaluate[%, RandomVariate[MultivariatePoissonDistribution[10, {2, 3}], 10 ^ 5]]//NCompare with sampling population moments:
MomentEvaluate[CentralMoment[{1, 2}]CentralMoment[{2, 1}], MultivariatePoissonDistribution[10, {2, 3}]]Cumulants of k-Statistics (1)
Cumulants of k-statistics are polynomials in sampling population expectations of certain monomials of k-statistics. They are built using umbral calculus, starting with expression of the multivariate cumulant in terms of raw moments:
cpoly = MomentConvert[Cumulant[{1, 2}], Moment]Each multivariate moment is understood as the sampling population expectation of the monomial in k-statistics. For instance, raw moment
stands for the product of expectation of
. Find the resulting unbiased estimator for
and
:
KStatistic[r_] := MomentConvert[Cumulant[r], "UnbiasedSampleEstimator"]cpoly /. {Moment[{r1_, r2_}] :> MomentConvert[KStatistic[2] ^ r1 KStatistic[1] ^ r2, {Cumulant, n}]}//SimplifyDefine a procedure for computation of cumulants of k-statistics:
KStatisticMonomial[a_, alpha_] := Apply[Times, (KStatistic /@ a) ^ alpha]CumulantOfKStatistics[order_] := Module[{ko, kp, res},
{ko, kp} = Transpose[Tally[order]];
res = MomentConvert[Cumulant[kp], Moment] /. Moment[e_] :> MomentConvert[KStatisticMonomial[ko, e], {Cumulant, n}];
Expand[Collect[res, _Cumulant, Factor], _Cumulant]
]Table[CumulantOfKStatistics[ConstantArray[1, r]], {r, 2, 6}]//TraditionalFormTable[CumulantOfKStatistics[{2}~Join~ConstantArray[1, r]], {r, 6}]//TraditionalFormThis implies that the sample mean and sample variance of a normal sample are independent:
MomentEvaluate[%, NormalDistribution[μ, σ]]Cumulants of k-statistics were tabulated because they were thought to give more concise expressions, and were used for computation of moments of estimators. Compute the cumulant of second k-statistics:
CumulantOfKStatistics[{2, 2}]//TraditionalFormCompute the cumulant of the product of k-statistics:
CumulantOfKStatistics[{2, 3}]//TraditionalFormCumulantOfKStatistics[{2, 2, 3}]//TraditionalFormExpressions for higher-order cumulants of k-statistics quickly become big:
CumulantOfKStatistics[{2, 2, 3, 3}]//TraditionalFormCombinatorial Uses of MomentConvert (1)
Compute the number of partitions of a set into subsets of given sizes:
MomentConvert[Moment[5], Cumulant]There are 10 ways to partition the set of 5 elements into subsets of 2 and 3 elements:
Coefficient[%, Cumulant[2] * Cumulant[3]]Construct partitions and count directly:
RemoveDuplicateSets[e_] := e //. x_List :> With[{y = Union[x]}, y /; y =!= x]SetPartitions[set_, ip_] := RemoveDuplicateSets[
Table[TakeList[p, ip], {p, Permutations[set]}]]Framed /@ SetPartitions[{a, b, c, d, e}, {2, 3}]Properties & Relations (5)
The binomial theorem defines relations between formal moments and formal central moments:
Table[Underoverscript[∑, k = 0, r]Binomial[r, k] Moment[k] (-Moment[1])^r - k, {r, 1, 5}]//TraditionalFormMomentConvert[#, CentralMoment]& /@ %Express formal factorial moments in terms of formal moments using Stirling numbers:
Table[Sum[StirlingS1[r, k]Moment[k], {k, 0, r}], {r, 5}]//TraditionalFormMomentConvert[#, FactorialMoment]& /@ %Polynomial in moments rewritten in terms of central moments may still involve the mean
:
MomentConvert[Moment[2], "CentralMoment"]The sample estimator of factorial moment is unbiased:
MomentConvert[FactorialMoment[2], "SampleEstimator"] == MomentConvert[FactorialMoment[2], "UnbiasedSampleEstimator"]//TraditionalFormMomentConvert[%, "PowerSymmetricPolynomial"]Table[MomentConvert[FactorialMoment[k], "SampleEstimator", {"FactorialMoment", n}], {k, 6}]Compute cumulants through series expansion of logarithm of moment-generating function:
Log[1 + Sum[(t^k/k!)Moment[k], {k, 1, 3}] + O[t] ^ 4]//SimplifySum[(t^k/k!)MomentConvert[Cumulant[k], Moment], {k, 1, 3}] + O[t] ^ 4Possible Issues (2)
Conversion between forms of symmetric polynomials treats formal moments as constants:
MomentConvert[Cumulant[4], "PowerSymmetricPolynomial"]Expressions involving AugmentedSymmetricPolynomial and PowerSymmetricPolynomial are converted:
MomentConvert[AugmentedSymmetricPolynomial[{1, 1}]AugmentedSymmetricPolynomial[{2, 2}], "PowerSymmetricPolynomial"]//TraditionalFormMomentConvert requires input to be polynomial in formal and/or sample moments:
MomentConvert[Cumulant[4] / Cumulant[2] ^ 2, "SampleEstimator"]MomentConvert[PowerSymmetricPolynomial[2]^3 / 2, Moment]Neat Examples (2)
Cross convert between any pairs of formal moments:
Manipulate[TraditionalForm[f[n]] -> TraditionalForm@MomentConvert[f[n], g], {{f, Moment, "source"}, {Moment, CentralMoment, FactorialMoment, Cumulant}}, {{g, CentralMoment, "target"}, {Moment, CentralMoment, FactorialMoment, Cumulant}}, {{n, 2}, 1, 20, 1}]Cross convert between any pairs of multivariate formal moments:
Manipulate[TraditionalForm[f[{m, n}]] -> TraditionalForm@MomentConvert[f[{m, n}], g], {{f, Moment, "source"}, {Moment, CentralMoment, FactorialMoment, Cumulant}}, {{g, CentralMoment, "target"}, {Moment, CentralMoment, FactorialMoment, Cumulant}}, {{m, 2}, 1, 5, 1}, {{n, 2}, 1, 5, 1}]Related Guides
History
Text
Wolfram Research (2010), MomentConvert, Wolfram Language function, https://reference.wolfram.com/language/ref/MomentConvert.html.
CMS
Wolfram Language. 2010. "MomentConvert." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MomentConvert.html.
APA
Wolfram Language. (2010). MomentConvert. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MomentConvert.html
BibTeX
@misc{reference.wolfram_2026_momentconvert, author="Wolfram Research", title="{MomentConvert}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/MomentConvert.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_momentconvert, organization={Wolfram Research}, title={MomentConvert}, year={2010}, url={https://reference.wolfram.com/language/ref/MomentConvert.html}, note=[Accessed: 12-June-2026]}