rmvnorm: Multivariate normal simulation.

View source: R/hoff_functions.R

rmvnormR Documentation

Multivariate normal simulation.

Description

Simulate a multivariate normal random matrix.

Usage

rmvnorm(n, mu, Sigma, Sigma.chol = chol(Sigma))

Arguments

n

number of mvnormal vectors to simulate.

mu

mean vector.

Sigma

covariance matrix.

Sigma.chol

Cholesky decomposition of Sigma.

Details

This function simulates multivariate normal random vectors.

Author(s)

Peter Hoff.

Examples

# 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)

dcgerard/tensr documentation built on Oct. 4, 2022, 5:58 p.m.