callmultmoments {symmoments} | R Documentation |
Compute multivariate moment symbolically
Description
Computes a multivariate normal moment by initializing variables, calling multmoments, and constructing output
Usage
callmultmoments(moment)
Arguments
moment |
vector c(k1,... ,kn) specifying the moment X1**k1 *...* Xn**kn |
Details
Each row of the representation gives the exponents for a single product of covariance terms. For example, (1,2,0) represents S11**1 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.
Value
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."
Author(s)
Kem Phillips <kemphillips@comcast.net>
References
K Phillips, Symbolic Computation of the Central Moments of the Multivariate Normal Distribution, Journal of Statistical Software, 2010.
See Also
multmoments and the methods toLatex, evaluate, and simulate in symmoments
Examples
# Compute the moment for the 4-dimensional moment c(1,2,3,4):
m.1234 <- callmultmoments(c(1,2,3,4))