Generating Random Matrices

- BIOS 524 Project
- Brett Kliner
- Abigail Robinson

Goals of Project

- To use simulation to create a random vector X,

where XN(µ, S). - To simulate the probability that W gt w, where W

is a scalar generated from the X matrix. - W is generated from the mean vector, µ.
- W is generated fro the a k x 1 zero vector.

Applications

- This exercise is mostly academic with uses in

matrix algorithms and general linear models. - Hypothesis testing that the mean vector is equal

to the zero vector. - This will be useful in Dr. Johnsons General

Linear Models class next semester.

The Random X Vector

- The X vector (k x 1) will be replicated n times.
- X will have a mean vector µ, k x 1.
- X will be formed using the covariance matrix S, k

x k. - The user may specify n, µ and S.
- The mean vector µ (k x 1) replicated n times

gives us an n x k matrix.

The Random X Vector

- µ and S must match on dimension so matrix

multiplication can occur. - The covariance matrix must be symmetric, that is

S S. - S must also be positive definite which means that

all of the eigenvalues must be positive.

The Random X Vector

- Each column of the new n x k matrix will be

averaged using PROC MEANS. - Mean of each column
- Standard Deviation
- 95 Confidence interval on the mean
- The n x k matrix will be compared to the Vnormal

matrix.

The Random X Vector

- The call Vnormal function will be used to

generate an n x k Vnormal matrix. - PROC Means will be used to analyze each column.
- Mean of each column
- Standard Deviation
- 95 Confidence Interval

Computing W

- A quadratic form occurs when q xAx.
- W is a quadratic form where
- W (x - v) ?-1 (x v)
- v is a k x 1 vector of constants. We will

consider two cases of v - v µ
- v 0

When v µ

- When v µ, the distribution of W is considered

to be Chi-Square with k degrees of freedom. - The value of w is specified by the user.
- The probability that (Wgtw) is compared to the

call function 1 - ProbChi (w,k).

When v 0

- When v 0, the distribution of W is considered

to be a non-central chi-squared distribution with

k degrees of freedom and non-centrality parameter

ncp. - Notice that when v 0, W x ?-1 x.
- ncp is calculated by
- ncp v ?-1 v where v µ .

When v 0

- The probability that (W gt w), where
- W x ?-1 x, can be compared to the call

function 1 ProbChi (w, k, ncp).

The SAS Code

- Lets take a look at the SAS code that

accomplishes these tasks. - Please ask questions when they arise.