rand.mnormal | R Documentation |
Use this function to get random samples from a multivariate normal distribution.
rand.mnormal(n, mu = NULL, sigma = NULL, p = NULL, byRow = TRUE)
n |
The number of samples to generate. |
mu |
The mean vector of the distribution.
If |
sigma |
The covariance matrix of the distribution.
If |
p |
The dimension of the distribution, if both |
byRow |
If |
A list containing the generated sample (p x n
), mu
, and sigma
.
s1 <- rand.mnormal(10, mu = c(0, 0), sigma = matrix(c(1, 0.5, 0.5, 1), ncol = 2))
s2 <- rand.mnormal(10, mu = c(1,1), sigma = NA, p = 2)
s3 <- rand.mnormal(10, p = 2, byRow = FALSE) #standard normal
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.