rmvnorm | R Documentation |
Simulate from a Multivariate Normal Distribution
rmvnorm(n = 1, mu, v, method = "eigen")
n |
the number of samples required |
mu |
a vector giving the mean of the random variables |
v |
the covariance matrix of the random variables |
method |
The method used to decompose |
An m \times n
where n
is the length of mu
.
v = matrix(c(10,3,3,2), 2, 2)
y = rmvnorm(n = 4000, 1:2, v)
# should be close to 1:2
# rowMeans(y)
# should be close to v
# var(t(y))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.