Dataplot Vol 2 Vol 1

# MULTIVARIATE NORMAL RANDOM NUMBERS

Name:
MULTIVARIATE NORMAL RANDOM NUMBERS
Type:
Let Subcommand
Purpose:
Generate random numbers from a multivariate normal distribution.
Description:
For univariate distributions, Dataplot generates random numbers using the common syntax

LET <shape-parameter> = <value>
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 normal random numbers, this does take into account any correlation between the variables (i.e., they are independent).

To generate an NxP matrix of normal random numbers in Dataplot, you must specify a Px1 mean vector and a PxP variance-covariance matrix. 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.

Syntax:
LET <mat> = MULTIVARIATE NORMAL RANDOM NUMBERS
<mu> <sigma> <n>
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 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).

Examples:
LET MU = -5 0 5
1 0.5 0.5
0.5 1 0.5
0.5 0.5 1
END OF DATA
LET N = 500
LET M = MULTIVARIATE NORMAL RANDOM NUMBERS MU SIGMA N
Note:
Dataplot generates multivariate normal random numbers with a mean vector AMU and a variance-covariance matrix SIGMA using the RDMNOR routine written by Charlie Reeves while he was a member of the NIST Statistical Engineering Division.
Note:
As with univariate random numbers, the nultivariate normal random numbers are built on an underlying uniform random number generators. Dataplot supports a number of different uniform random number generators. For details, enter

HELP SET RANDOM NUMBER GENERATOR
Default:
None
Synonyms:
None
Related Commands:
 RANDOM NUMBERS = Generate random numbers for 60+ univariate distributions. SET RANDOM NUMBER GENERATOR = Specify which univariate generator to use. MULTIVARIATE T RANDOM NUMBERS = Generate multivariate t random numbers. INDEPENDENT UNIFORM RAND NUMB = Generate random numbers for independent uniform distributions. WISHART RANDOM NUMBERS = Generate random numbers for a Wishart distribution. DIRICHLET RANDOM NUMBERS = Generate random numbers for a Dirichlet distribution.
Reference:
"Continuous Multivariate Distributions Volume 1: Models and Applications", Johnson, Kotz, and Balakrishnan, Wiley, 2000.

"Introduction to Matrix Computations", G. W. Stewart, Academic Press, Algorithm 3.9, p. 142.

Applications:
Simulation, Bayesian Analysis
Implementation Date:
2003/3
Program:
```dimension 100 columns
.
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 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
Last updated: 5/16/2003