APPROVED: Chairman, Richard G
Total Page:16
File Type:pdf, Size:1020Kb
COMPUTERMETHODS FOR GE}IERATI~GPSEUOO-RANOOM NUMBERS FROMPEARSOK DISTRIBUTIONS AND MIXTURES OF PEARSONAND UNIFORMDISTRIBUTIONS by Donald Gale Thomas Thesis submitted to the Graduate Faculty of the Virginia Polytechnic Institute in candidacy for the degree of MASTEROF SCIENCE in statistics APPROVED: Chairman, Richard G. Krutchkoff, PhD• Boyd Harshbarger, PhD. Whitney L• Johnson Raymond H. Myers, PhD. May 1966 Blacksburg, Virginia -2- TABLEOF CONTENTS Chapter Pa.ge INTRODUOTION• • • • • • • • • • • • • • • • • • • • • • • 7 II. A BRIEF SURVEYOF METHODSOF GENERATWGPSEUDO-RANDOM 1'.'U1,1BERS• • • • • • • • • • • • • • • • • • • • • • • • . ll 2.1 Definition and Use of Pseudo-Random Numbers . 11 2.2 CommonMethods of Generating Pseudo-Random Numbers. • 11 2.21 Mid-Square Methods. • • • • • • • • • • • • • • l} 2.22 Multiplicative Congruential Methods • • • • • • 15 2.2} Mixed Congruential Methods. • • • • • • • • • • 14 2.24 Multiplicative vs. Mixed Generators • • • • • • 15 2.25 Other Methods • • • • • • • • • • • • • • • • • 16 III. A BRIEF SURVEYOF METHODSOF TESTING RANDOMNUMBERS •• • • 18 }ol Necessity for Testing • • • • • • • • • • • • • • • • 18 }.2 Tests of Fit ••••••••••••••••••• . 20 2 ,.21 x .Goodness of Fit • • • . • • • • . • • 20 }o22 Kolmogorov Statistic. • • • • • • • • • • • • • 21 }.2; Moments • • .. • • • • • .. • • • • • • • • • • • 21 Tests of Performance ••• . • • • • • • 21 ,.,1Runs Up and Down • • • • • • • • • • • • • . 22 ,.,2 Runs Above and Below Mean .. .. • • • • 22 ,.,, Serial Correlation •••• 22 ;.:,4 Other Tests of Performance. • • it .. • • • • • 2; IV• PEARSON'SSYSTEM OF FREQUENCYCURVES • • • e ·• • • • • • 24 Definition and Theory ••• • • • • • • • • • • • 24 TABLEOF OONrE1"'1'5(Continued) Chapter Page 4.2 Types • • • • • • • • • • • • • • • • • • • • • • • • 25 Uses. • • • • • • • • • • • • • • • • • • • • • • • • 27 v. PURGE2SUBROUTINE • • • • • • • • • • • • • • • • • • • • • 5.1 Description and Purpose ••••••• •• ~. • • • • • ;1 5.2 Method of Operation • • • • • • • • • • • • • • • • • ;; 5.; Operating Information • • • • • • • • • • • • • • • • ;6 5.;1 Data Input Options ••••••••• • • • • • • ;7 5.;2 Parameter Options • • • • • • • • • • • • • • • 40 5.;; Regeneration. • • • • • • • • • • • • • • • • • 42 5.;4 Variables Available thru COMMON• • • • • • • • 44 Error Conditions. • • • • • • • • • • • • • • • 46 5.4 Sample Input and Output • • • • • • • • • • • • • • • 48 5•5 Tests of PURGE2 •••••••• • • • • • • • • • • • VI. MIX SUBROUTINE• • • • • • • • • • • • • • • • • • • • • • 6.1 Description and Purpose • • • • • • • • • • • • • • • 59 6.2 Method • • • • • • • • • • • • . 60 6.; Operating Information • • • • • • • • • • • • • • • • 62 6.;1 Data Input Option • • • • • • • • • • • • • • • 6. ;2 Regeneration • • • • • • • • • • • • • • • • • • 64 6.;; Variables Available 't.hru COMMON • • • • • • • 66 Error Conditions ••• • • • • • • • • • • • • • 66 . 6.4 Sample Input and Output • • • • • • • • • • • • • • • 68 TABLEOF CONI'E1~S(Continued) Chapter Page VII •. APPLICATIONTO INVESTIGATIONOF ROBUSTNESS• • • • • • • • 75 7.1 Confidence Interval Problem •••• • • • • • • • • • 75 7.2 Methods of Estimation • • • • • • • • • • • • • • • • 75 1., Monte Carlo Example • • • • • • • • • • • • • • • • • 77 7.4 Conclusions • • • • • • • • • • • • • • • • • • • • • 82 VIII. ACKNOWLEDGEMENTS• • • • • • • • • • • • • • • • • • • • • 85 IX. BIBLIOGRAPHY• • • • • • • • • • • • • • • • • • • • • 84 x. VITA • • • • • • • • • • • • • • • • • • • • • • • • • • • 87 XI. APPENDIX • • • • • • • • • • • • • • • • • • • • • • • • • 88 Flowohal-t.and Listings tor PURGE2• • • • • • • • • • • • • 89 Flowchart and Listings for MIX •••••••••••••• 114 LIST OF TABLES Table Page l. Types of Pearson Curves Used. • • • • • • • • • • • • • • • 28 2. Chart Relating the Type of Pearson Frequency Curve to the Values of~, 4 • • • • • • • • • • • • • • • • • • • • • • 29 ' µ'J. ,. Values of the Arg-uments for PURGE2. • • • • • • • • • • • • ,6 4. Option Oard Format. • • • • • • • • • • • • • • • • • • • • }7 Moment Card Format •• . • • • • • • • • • • • • • • • 6. Variables in PURGE2Available "thru COl/.1.MON• • • • • • • • • 2 Values of Sample Moments from a x10 Distribution • • • • • • 8. Values of Sample Moments from a Bell Shaped Type I Distri- bution • • • • • • • • • • • • • • . • • • . • • . • • . 57 9. Values of Sample Moments from a J-Shaped Type I Distribu- tion. • • • . • . • . • . • • • • • • • . • . • . 57 10. Values of Sample Moments from a U-Shaped Type I Distribu- tion • • • • • . • • • • • • • • • • . • • • . • • • • • • 58 11. Values of the Arguments for MIX • • • • • • • • • • • • • • 6, 12. Control Card Format • • • • . • . • • • • • • • • • . • . 64 1,. Variables in MIX Available t.hru COMl,10N• • • • • • • • • • • 67 14. Types of Curves Used in Tables 15 t.hru 21 • • . • • • 78 15. Confidence Interval Data (normal) • • • • • • . • • • • . 79 2 16. Confidence Interval De.ta (XlO) • • • • • • • • • • • . • • • 79 17. Confidence Interval De.ta (Type I Bell) • • . • • • • • . • 80 18. Confidence Interval Data (Type I J) • • • • • • . • • • • • • 80 Confidence Interval 19. Data (Type I U) • • • " • • • • • • • • • 80 20. Confidence Interval Data (rype I L) • • • • • • • • • • • • • 81 21. Confidence Interval Data (t\,lixture Be11) • • • • • • • • • • . 81 -6- LIST OF FIGURES Figure Page l. Admissable Region for /?J, and /32 • • • • • • • • • • • • • • 47 2. Moment Card Input ••••• • • • • • • • • • • • • • • • • 49 ;. FURGE2 Output • • • • • • • • • • • • • • • • • • • • • • • 5() 4. PURGE2Output • • • • • • • • • • • • • • • • • • • • • • • 51 5• PURGE2Output • • • • ••••••••• • •••• • • • • • 52 6. Data Point Oard Input •••••• 7. Moment Oard Input Using Force Fit Option. • • • • • • • • • 54 8. Data Point Card Input with Special Format •••• • • • • • 55 9. Input for MIX • • • • • • • • • • • • • • • • • • • • • • • 69 10. MIX Output • • • ••••••••••••••••••••• • 70 11. MIX Output ••••••••••••••••• • • • .. • • • • 71 12. MIX Output • • • • • • • • • • • • • • • • • • • • • • • • • 72 1;. MIX Output • • .. • • • • • • • • • • • • • • • • • • • • • • 7} 14. MIX Output • • • • • • • • • • • • • .. • • G • • • • • • • • 74 -7- I• II'ITRODUO'l'ION 1he advent of the modern high speed computer has brought many changes in our society. Complex problems, in almost every discipline, heretofore unsolvable in a lifetime because of the massive computations involved, may now be solved in minutes with the aid of these high speed computers. One technique, made particularly attractive by the computer era is that of Monte Carlo methods which comprise that branch of mathe- matics concerned with synthetic experiments involving random numbers. These methods are often useful on a wide variety of problems beyond the available resources of theoretical mathematics. Since large sequences of random numbers are desired, techniques have been devised for generating them in a completely deterministic manner such that the resulting sequence of numbers, often called pseudo-random numbers, appears random. In this thesis, a brief survey of existing methods for generation and testing of pseudo-random numbers is presented. One serious limita- tion inherent in these generation methods ia that they are~ easily modified to produce random numbers from distributions other than those for which they were written. To overcome this limitation Oooper, Davis and Dono (1965) devel- oped a computer program in FORTRANII which generates random numbers from Pearson distributions. The distribution may be specified by supplying the program with either the first four moments of the desired dis-t.ribution or sample data from that distribution. The program then -8- computes and prints out the parameters for the Pearson distribution fitted and if desired, generates random numbers from said distribution and/or produces a graph of the distribution. The program he..e been considerably revised and improved as well as converted to be used as a FORTRANIV subroutine. This subroutine is entered from the mainline probram by using the FORTRANcall statement OALLPURGE2(Nl,N2) where Nl and N2 are arguments which describe the option desired. Initially, depending on the option selected, the subroutine reads data cards (provision is also made for internal specification of moments) which describe the Pearson distribution to be fitted. The distribution is fitted and parameters for the Pearson curve with origin at the mean are printed. At this point, one hundred random numbers are generated (if the generation option was selected) and returned to the calling program as implied arguments via the CO:MMONstatement. If desired, sample moments from the generated data are calculated. If more random numbers are desired from the same distribution, the subroutine may be recalled, for each batch of one hundred numbers required, by an argument option which does not necessitate refitting the curve. This procedure produces ten to twenty thousand random numbers per minutev A graph of the distribution may be obtained on the final call (the graph option destroys the facility for further generation without refitting). The first four moments of the Pearson distribution along with {31 , f3,,. and I{ may be printed as well as comparable values -9- calculated from the generated numbers. In order to remove the restriction of generating pseudo-random numbers from only unimodal distributions as done in the original version of PURGE, another subroutine is developed which allows random numbers to, be generated