S3 Generating Normal RV's

The probability Integral Transformation is a useful method to generate many different kinds of random variables. Suppose that F(x) is the CDF of a continous random variable X. Suppose that G(x) is the INVERSE of F(x). This means that the two functions cancel each other, so that G(F(x)=x. We can use this inverse function G to construct a random variable with CDF F from a uniform random variable. The following theorem shows how:

THEOREM: Suppose U is a uniform random variable on [0,1] and define X=G(U). Then random variable X has CDF F(x).

PROOF: Calculate the P(X<x)=P(G(U)<x). Now we can apply the monotonic function F to both sides of the inequality: a < b is equivalent to F(a) < F(b) because F is a monotonic increasing function. Thus P(G(U)<x)=P(F(G(U))<F(x))=P(U<F(x)). The last equality follows because F and G are inverses of each other, and they cancel each other. Now note that F(x) is a probability which lies between 0 and 1 and hence P(U<F(x))=F(x). This derivation shows that P(X<x)=F(x), which is what we set out to prove.

APPLICATION: If we have the INVERSE G of the CDF F of any random variable X, then we can generate this random variable from a U(0,1) random variable by applying G: X=G(U).

Generating Normal Random Variables in EXCEL. One simple method is to use the DATA ANALYSIS package. If this does not show on the EXCEL menu, then it must be ADDed IN. Within Data Analysis, there is Random Number Generation, and within this, there is a way to generate Normals. This method generates static normals. That is, it generates on fixed set of normals, however many are specified by the user. Once generated, these numbers are fixed and unchanging.

For some purposes, we would like to generate DYNAMIC random variables. These change everytime something on the spreadsheet changes. These are useful in certain situations, especially when we are doing simulations. The built in EXCEL function RAND() generates dynamic Uniform U(0,1) random variables, which change whenever any cell on the spreadsheet changes. Applying the inverse of the normal cdf to this function will give us dynamic random normal numbers. The required EXCEL command is: NORMSINV(RAND()).

To provide another example of how the probability integral transform is used to generate different types of random variables from the uniform, we show how to generate an exponential random variable, which is also Gamma(1,1).