Multivariate normal random numbers
returns a matrix R
= mvnrnd(mu
,sigma
,n
)R
of n
random vectors
chosen from the same multivariate normal distribution, with mean vector
mu
and covariance matrix sigma
. For
more information, see Multivariate Normal Distribution.
mvnrnd
requires the matrix sigma
to
be symmetric. If sigma
has only minor asymmetry, you can
use (sigma + sigma')/2
instead to resolve the
asymmetry.
In the one-dimensional case, sigma
is the variance, not
the standard deviation. For example, mvnrnd(0,4)
is the same
as normrnd(0,2)
, where 4
is the variance
and 2
is the standard deviation.
[1] Kotz, S., N. Balakrishnan, and N. L. Johnson. Continuous Multivariate Distributions: Volume 1: Models and Applications. 2nd ed. New York: John Wiley & Sons, Inc., 2000.