3.4.1 NUMERICAL DISTRIBUTIONS 123 Table 1 EXAMPLE OF

3.4.1 NUMERICAL DISTRIBUTIONS 123 Table 1 EXAMPLE OF TABLES USED WITH ALGORITHM M* j p3 P,+ls QJ 5 y3+= 2, zj+l6 %+1 L&+15 J-$+15 0 ,000 ,067 0.00 0.59 0.20 0.21 0.0 1 ,849 ,161 ,236 -0.92 0.96 1.32 0.24 0.2 ,505 25.00 2 ,970 ,236 ,206 -5.86 -0.06 6.66 0.26 0.4 ,773 12.50 3 .855 .285 .234 -0.58 0.12 1.38 0.28 0.6 ,876 8.33 4 ,994 ,308 ,201 -33.13 1.31 34.93 0.29 0.8 ,939 6.25 5 ,995 ,304 ,201 -39.55 0.31 41.35 0.29 1.0 ,986 5.00 6 ,933 ,280 ,214 -2.57 1.12 2.97 0.28 1.2 ,995 4.06 7 ,923 ,241 ,217 -1.61 0.54 2.61 0.26 1.4 ,987 3.37 8 ,727 ,197 ,275 0.67 0.75 0.73 0.25 1.6 ,979 2.86 9 1.000 ,152 ,200 0.00 0.56 0.00 0.24 1.8 ,972 2.47 10 ,691 ,112 ,289 0.35 0.17 0.65 0.23 2.0 ,966 2.16 11 ,454 ,079 ,440 -0.17 0.38 0.37 0.22 2.2 ,960 1.92 12 ,287 ,052 ,698 0.92 -0.01 0.28 0.21 2.4 ,954 1.71 13 ,174 ,033 1.150 0.36 0.39 0.24 0.21 2.6 ,948 1.54 14 ,101 ,020 1.974 -0.02 0.20 0.22 0.20 2.8 ,942 1.40 15 ,057 ,086 3.526 0.19 0.78 0.21 0.22 3.0 ,936 1.27 *In practice, this data would be given with much greater precision; the table shows only enough figures so that interested readers may test their own algorithms for computing the values more accurately. M3. [Wedge or tail?] (Now 15 < j 5 31, and each particular value j occurs with probability p3.) If j = 31, go to M7. M4. [Get U 2 V.] Generate two new uniform deviates, U, V; if U > V, exchange U * V. (We are now performing Algorithm L.) Set X c S,-is+ 5 U. M5. [Easy case?] If V 5 Dj, go to M9. M6. [Another try?] If V > U + E~(e(s~~~~-xz)~z -l), go back to step M4; otherwise go to M9. (This step is executed with low probability.) M7. [Get supertail deviate.] Generate two new independent uniform deviates, U, V,andsetXcdS-21nV. M8. [Reject?] If UX 2 3, go back to step M7. (This will occur only about one-twelfth as often as we reach step M8.) M9. [Attach sign.] If q!~ = 1, set X e -X. 1 This algorithm is a very pretty example of mathematical theory intimately interwoven with programming ingenuity-a fine illustration of the art of com- puter programming! Only steps Ml, M2, and M9 need to be performed most of the time, and the other steps aren t terribly slow either. The first publications of the rectangle-wedge-tail method were by G. Marsaglia, Annals Math. Stat. 32 (1961), 894-899; G. Marsaglia, M. D. MacLaren, and T. A. Bray, CACA4 7 (1964), 4-10. Further refinements of Algorithm M have been developed by G. Marsaglia, K. Ananthanarayanan, and N. J. Paul, hf. Proc. Letters 5 (1976), 27-m.

Leave a Reply