mvtrnd
Multivariatetrandom numbers
Syntax
R = mvtrnd(C,df,cases)
R = mvtrnd(C,df)
Description
R = mvtrnd(C,df,cases)
returns a matrix of random numbers chosen from the multivariatetdistribution, whereC
is a correlation matrix.df
is the degrees of freedom and is either a scalar or is a vector withcases
elements. Ifp
is the number of columns inC
, then the outputR
hascases
rows andp
columns.
Lett
represent a row ofR
. Then the distribution oft
is that of a vector having a multivariate normal distribution with mean 0, variance 1, and covariance matrixC
, divided by an independent chi-square random value havingdf
degrees of freedom. The rows ofR
are independent.
C
must be a square, symmetric and positive definite matrix. If its diagonal elements are not all 1 (that is, ifC
is a covariance matrix rather than a correlation matrix),mvtrnd
rescalesC
to transform it to a correlation matrix before generating the random numbers.
R = mvtrnd(C,df)
returns a single random number from the multivariatetdistribution.