powered by
Simulate random variables from a multivariate normal distribution.
rmvn(n, mu = 0, sigma = matrix(1))
Number of simulation replicates.
Mean vector.
Variance-covariance matrix.
Matrix of size n by length(mu), each row corresponding to a replicate.
length(mu)
Use Cholesky decomposition of sigma, from chol.
sigma
chol
rnorm
# NOT RUN { x <- rmvn(100, c(1,2), matrix(c(1,1,1,4), ncol = 2)) # }
Run the code above in your browser using DataLab