3.4.1 NUMERICAL DISTRIBUTIONS 117 max(Ul, UZ,. . . (Web host server)
3.4.1 NUMERICAL DISTRIBUTIONS 117 max(Ul, UZ,. . . , Ut) has the distribution function F(z) = xt, for 0 < 2 5 1. This is the basis of the maximum-of-t test given in Section 3.3.2. Note that the inverse function in this case is F-l(y) = fl. In the special case t = 2, we see therefore that the two formulas x=&7 and X = max( U1, UZ) (9) will give equivalent distributions to the random variable X, although this is not obvious at first glance. We need not take the square root of a uniform deviate. The number of tricks like this is endless: any algorithm that employs random numbers as input will give a random quantity with some distribution as output. The problem is to find general methods for constructing the algorithm, given the distribution function of the output. Instead of discussing such methods in purely abstract terms, we shall study how they can be applied in important cases. C. The normal distribution. Perhaps the most important nonuniform, continuous distribution is the so-called normal distribution with mean zero and standard deviation one: z F(z) = -!—t2/2 dt. (10) & s -tee The significance of this distribution was indicated in Section 1.2.10. Note that the inverse function F-l is not especially easy to compute; but we shall see that several other techniques are available. (1) The polar method, due to G. E. P. Box, M. E. Muller, and G. Marsaglia. (See Annals Math. Stat. 28 (1958), 610; and Boeing Scientific Res. Lab. report Dl-82-0203 (1962).) Algorithm P (Polar method for normal deviates). This algorithm calculates two independent normally distributed variables, X1 and X2. Pl. [Get uniform variables.] Generate two independent random variables, UI, U2, uniformly distributed between zero and one. Set VI c 2Ul -1, V2 c 2U2 -1. (Now VI and V2 are uniformly distributed between -1 and +l. On most computers it will be preferable to have VI and V2 represented in floating point form at this point.) P2. [Compute S.] Set S t VT + Vi. P3. [Is S 2 I?] If S 2 1, return to step Pl. (Steps Pl through P3 are executed 1.27 times on the average, with a standard deviation of 0.587; see exercise 6.) P4. [Compute Xl, X2.1 Set X1, X2 according to the following two equations: -21nS -21nS X2=& (11) Xl=v1 -, r ~ /—– s S These are the normally distributed variables desired. 1