mvrnorm_cpp | R Documentation |
Generates random numbers from a multivariate normal distribution with specified mean and covariance matrix using a C++ implementation.
mvrnorm_cpp(n = 1, mu, Sigma)
n |
The number of random samples to generate. Defaults to 1. |
mu |
The mean vector of the distribution. |
Sigma |
The covariance matrix of the distribution. |
A numeric matrix where each row is a random sample from the multivariate normal distribution.
# Example usage
mu <- c(0, 0)
Sigma <- matrix(c(1, 0.5, 0.5, 1), 2, 2)
mvrnorm_cpp(5, mu, Sigma)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.