| mvrnorm2 | R Documentation |
Sigma in mvrnormTo accommodate more types of Sigma in function mvrnorm.
mvrnorm2(
n,
mu,
sd,
Sigma = diag(x = sd^2, nrow = d, ncol = d),
row.prefix,
col.prefix,
...
)
n |
integer scalar, sample size |
mu |
numeric scalar or vector,
multivariate means |
sd |
numeric scalar or a vector, standard deviation(s) |
Sigma |
numeric variance-covariance matrix, see function mvrnorm |
row.prefix, col.prefix |
(optional) character scalars |
... |
additional parameter of function mvrnorm |
Argument of parameter sd could be
sd is recycled to the length of mu
check that length of sd and mu must be the same
Then a diagonal matrix with vector sd^2 on the diagonal elements
is used as the variance-covariance
matrix \Sigma
Function mvrnorm2() returns a double matrix.
Workhorse function mvrnorm from package MASS is faster than ?mvtnorm::rmvnorm.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.