| simulate.moment | R Documentation |
Computes a multivariate normal moment by Monte Carlo integration.
## S3 method for class 'moment'
simulate(object, nsim, seed = NULL, Mean, Sigma, ...)
object |
An object of class |
nsim |
The number of samples to generate in computing the integral. |
seed |
An integer for the random number generator ( |
Mean |
The mean vector of |
Sigma |
Covariance matrix of |
... |
Included only for consistency with the generic function. |
An approximate numerical value of the specified moment.
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.
Kem Phillips kemphillips@comcast.net
Rizzo2008symmoments
callmultmoments, and the methods toLatex
and evaluate.
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.