MULTIVARIATE T RANDOM NUMBERName:
LET Y = <dist> RANDOM NUMBERS FOR I = 1 1 N
LET Y = LOC + SCALE*Y
Multivariate distributions, however, genrally require matrix operations. For this reason, random numbers for multivariate distributions each have their own unique syntax. Although you can generate P columns of t random numbers, this does take into account any correlation between the variables (i.e., they are independent).
To generate an NxP matrix of t random numbers in Dataplot, you must specify a Px1 mean vector, a PxP variance-covariance matrix, and the desired degress of freedom (i.e., the shape parameter for the t distribution). The mean vector specifies the location parameters for each of the P columns. The diagonal of the variance-covariance matrix specifies the scale parameters of the P columns. A single value is specified for the degrees of freedom (i.e., all columns assume a common degrees of freedom).
<mu> <sigma> <nu> <n>
where <mu> is a variable containing the desired location parameters;
<sigma> is a matrix containing the desired variance-covariance matrix;
<nu> is a number or parameter specifying the desired degrees of freedom;
<n> is a number or parameter specifying the desired number of rows;
and where <mat> is a matrix where the resulting multivariate normal random numbers are stored.
Dataplot determines the number of columns to generate from the number of rows in the <mu> vector. Note that the number of rows in <mu> must equal the number of rows (and columns) in <sigma> and <sigma> must be a symmetric positive-definite matrix (i.e., a value variance-covariance matrix).
READ MATRIX SIGMA
1 0.5 0.5
0.5 1 0.5
0.5 0.5 1
END OF DATA
LET N = 500
LET NU = 500
LET M = MULTIVARIATE T RANDOM NUMBERS MU SIGMA NU N
RDMNOR was written by Charlie Reeves while he was a member of the NIST Statistical Engineering Division.
"Introduction to Matrix Computations", G. W. Stewart, Academic Press, Algorithm 3.9, p. 142.
dimension 100 columns . read matrix sigma 1.0 -0.707107 0.0 0.0 0.0 -0.707107 1.0 0.5 0.5 0.5 0.0 0.5 1.0 0.5 0.5 0.0 0.5 0.5 1.0 0.5 0.0 0.5 0.5 0.5 1.0 end of data . let mu = data 0 0 0 0 0 let n = 500 let nu = 3 . let m = multivariate normal random numbers mu sigma n . multiplot corner coordinates 0 0 100 100 multiplot 2 3 title automatic loop for k = 1 1 5 relative histogram m^k end of loop
Date created: 5/16/2003