simulate.moment: Compute a Multivariate Moment Using Monte Carlo Integration

simulate.momentR Documentation

Compute a Multivariate Moment Using Monte Carlo Integration

Description

Computes a multivariate normal moment by Monte Carlo integration.

Usage

## S3 method for class 'moment'
simulate(object, nsim, seed = NULL, Mean, Sigma, ...)

Arguments

object

An object of class 'moment' representing E[X_1^{k_1} \cdots X_n^{k_n}].

nsim

The number of samples to generate in computing the integral.

seed

An integer for the random number generator (set.seed).

Mean

The mean vector of (X_1, \dots, X_n).

Sigma

Covariance matrix of (X_1, \dots, X_n), dimension n \times n, expressed as a vector stacked by row.

...

Included only for consistency with the generic function.

Value

An approximate numerical value of the specified moment.

Note

Non-central moments can be approximated by specifying Mean. For central moments, set Mean to a vector of zeros.

The mvtnorm package must be installed for this function to utilize rmvnorm.

Author(s)

Kem Phillips kemphillips@comcast.net

References

\insertRef

Rizzo2008symmoments

See Also

callmultmoments, and the methods toLatex and evaluate.

Examples

# Using 10000 samples, estimate the central moment for the moment c(2,4) 
# at the specified covariance matrix and mean (0,0):
library(mvtnorm)
simulate(callmultmoments(c(2, 4)), 10000, NULL, c(0, 0), c(2, 1, 1, 4))


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