Statistics Toolbox    
mvtrnd

Random matrices from the multivariate t distribution

Syntax

Description

r = mvtrnd(C,df,cases) returns a matrix of random numbers chosen from the multivariate t distribution, where C is a correlation matrix. df is the degrees of freedom and is either a scalar or is a vector with cases elements. If p is the number of columns in C, then the output r has cases rows and p columns.

Let t represent a row of r. Then the distribution of t is that of a vector having a multivariate normal distribution with mean 0, variance 1, and covariance matrix C, divided by an independent chi-square random value having df degrees of freedom. The rows of r are independent.

C must be a square, symmetric and positive definite matrix. If its diagonal elements are not all 1 (that is, if C is a covariance matrix rather than a correlation matrix), mvtrnd computes the equivalent correlation matrix before generating the random numbers.

Example

See Also

mvnrnd, trnd


  mvnrnd nanmax