mvrnorm2 | R Documentation |
Sigma
in mvrnormTo accommodate more types of Sigma
in function mvrnorm.
mvrnorm2(n, mu, Sigma, ...)
n |
integer scalar, sample size |
mu |
numeric scalar or vector,
multivariate means |
Sigma |
numeric, either
a scalar, a vector or a matrix,
variance-covariance
matrix |
... |
additional parameter of function mvrnorm |
Argument of parameter Sigma
could be
First, Sigma
is recycled to the length of mu
.
Then a diagonal matrix with vector Sigma
on the diagonal elements
is used as the variance-covariance
matrix \Sigma
First, check that length of Sigma
and mu
must be the same.
Then the diagonal matrix is used as \Sigma
Sigma
is used as \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.