callmultmoments: Compute Multivariate Moment Symbolically

callmultmomentsR Documentation

Compute Multivariate Moment Symbolically

Description

Computes a multivariate normal moment by initializing variables, calling multmoments, and constructing output.

Usage

callmultmoments(moment)

Arguments

moment

A vector c(k1, ..., kn) specifying the moment X_1^{k_1} \cdots X_n^{k_n}.

Details

Each row of the representation gives the exponents for a single product of covariance terms. For example, (1, 2, 0) represents S_{11}^1 S_{12}^2 S_{22}^0, where the S_{ij} 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.

Value

An 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."

Author(s)

Kem Phillips kemphillips@comcast.net

References

\insertRef

Phillips2010symmoments

See Also

multmoments, and the methods toLatex, evaluate, and simulate in the symmoments package.

Examples

# Compute the moment for the 4-dimensional moment c(1,2,3,4):
m.1234 <- callmultmoments(c(1, 2, 3, 4))


symmoments documentation built on May 27, 2026, 9:06 a.m.