powered by
Generate random numbers from a multivariate normal distribution. It can be used to create correlated random numbers.
multi_rnorm(n, mean, sd)
A matrix with n rows and as many columns as mean values.
The number of samples desired for each variable.
A vector giving the mean of each variable.
A valid covariance matrix.
mus <- c(0, 3, 5) sigmas <- matrix(c(1, 0.265, 2.19, 0.265, 0.25, 0.66, 2.19, 0.66, 9), ncol = 3) mat <- multi_rnorm(100, mus, sigmas) var(mat)
Run the code above in your browser using DataLab