|
WISHART RANDOM NUMBERName:
,
).
In order to generate the Wishart variates, you need to specify the following:
What is returned is a pxp sample variance-covariance matrix.
where <mu> is a variable containing the desired location parameters; <sigma> is a matrix containing the desired variance-covariance matrix; <n> is a number or parameter specifying the sample size; and where <mat> is a matrix where the resulting Wishart random numbers are stored. The number of rows in <mu> must equal the number of rows and columns in the <Sigma> matrix. The <Sigma> matrix must be a valid variance-covariance matrix (i.e., symmetric and positive definite).
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 M = WISHART RANDOM NUMBERS MU SIGMA N
"Statistical Distributions", Third Edition, Evans, Hastings, and Peacock, Wiley, 2000, pp. 204-205.
dimension 100 columns
.
. Test Wishart random numbers
.
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 = 200
.
let w = wishart random numbers mu sigma n
.
set write decimals 3
print w
The following outout is generated.
MATRIX W -- 5 ROWS
-- 5 COLUMNS
VARIABLES--W1 W2 W3 W4 W5
0.923 -0.653 -0.024 0.577 -0.013
-0.653 0.462 0.017 -0.408 0.009
-0.024 0.017 0.527 0.558 0.564
0.577 -0.408 0.558 2.045 0.644
-0.013 0.009 0.564 0.644 1.121
Date created: 7/7/2004 |