Computes a multivariate normal moment by initializing variables, calling multmoments, and constructing output
callmultmoments(moment)
Arguments
moment: vector c(k1,... ,kn) specifying the moment X1k1 ... Xnkn
Returns
A object of class 'moment', which is a list with three components:
moment: the input moment vector
representation: a matrix containing the representation in terms of upper-triangular matrices
coefficients: the coefficients corresponding to the rows of the representation
If the sum of the exponents is odd, returns -1 and prints "Sum of powers is odd. Moment is 0."
If any exponent is negative, returns -2 and prints "All components of the moment must be non-negative."
If any exponent is not an integer, returns -3 and prints "All components of the moment must be integers."
Details
Each row of the representation gives the exponents for a single product of covariance terms. For example, (1,2,0) represents S111 S12 S22**0, where the Sij are the covariances. The full moment is the sum of these terms multiplied by their respective coefficients. If the sum of the exponents is odd, the moment is 0.
References
K Phillips, Symbolic Computation of the Central Moments of the Multivariate Normal Distribution, Journal of Statistical Software, 2010.