rmvnorm | R Documentation |
This function draws from a multivariate normal distribution.
rmvnorm(mu, Sigma)
mu |
The mean vector of length |
Sigma |
The covariance matrix of dimension |
The function builds upon the following fact: If ε = (ε_1,…,ε_n), where each ε_i is drawn independently from a standard normal distribution, then μ+Lε is a draw from the multivariate normal distribution N(μ,Σ), where L is the lower triangular factor of the Choleski decomposition of Σ.
A numeric vector of length n
.
mu <- c(0,0) Sigma <- diag(2) rmvnorm(mu = mu, Sigma = Sigma)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.