Learn R Programming

CVarE (version 1.1)

rmvnorm: Multivariate Normal Distribution.

Description

Random generation for the multivariate normal distribution. $$X \sim N_p(\mu, \Sigma)$$

Usage

rmvnorm(n = 1, mu = rep(0, p), sigma = diag(p))

Arguments

n

number of samples.

mu

mean

sigma

covariance matrix.

Value

a \(n\times p\) matrix with samples in its rows.

Examples

Run this code
# NOT RUN {
CVarE:::rmvnorm(20, sigma = matrix(c(2, 1, 1, 2), 2))
CVarE:::rmvnorm(20, mu = c(3, -1, 2))

# }

Run the code above in your browser using DataLab