View source: R/hoff_functions.R
rmvnorm | R Documentation |
Simulate a multivariate normal random matrix.
rmvnorm(n, mu, Sigma, Sigma.chol = chol(Sigma))
n |
number of mvnormal vectors to simulate. |
mu |
mean vector. |
Sigma |
covariance matrix. |
Sigma.chol |
Cholesky decomposition of |
This function simulates multivariate normal random vectors.
Peter Hoff.
# Simulate several matrices and compute the mean. Y <- tensr:::rmvnorm(100, c(1, 2, 3), matrix(c(3, 0, 1, 0, 1, -1, 1, -1, 2), 3, 3)) colMeans(Y) cov(Y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.