mu <- c(2, 1) #mean vector
sigma <- matrix(c(2^2, 0.5*2*1, 0.5*2*1, 1^2), 2, 2) #covariacne matrix
sigma.chol <- chol(sigma) #decompose covariance matrix
#f <- mvnorm_chol(mu, sigma.chol) #draw sample
Run the code above in your browser using DataLab