Print

Print


Dear All

A function for generation of uniform(0,1) random number
in FORTRAN is given in the following book:

Applied Statistics Algorthms
Editors:P.Griffiths and I.D.Hill
Published by Ellis Horwood Limited

Algorithm AS 183-An efficient and portable pseudo-random
number generator by B.A.Whichmann and I.D.Gill,Pg.No.238.

                FUNCTION
                --------
   FUNCTION UN(IX,IY,IZ)
   IX=171*MOD(IX,177)-2*(IX/177)
   IY=122*MOD(IY,176)-35*(IY/176)
   IZ=170*MOD(IZ,178)-63(IZ/178)
   IF(IX.LT.0)IX=IX+30269
   IF(IY.LT.0)IY=IY+30307
   IF(IZ.LT.0)IZ=IZ+30323
   UN=AMOD(FLOAT(IX)/30269.0+FLOAT(IY)/30307.0+
1  FLOAT(IZ)/30323.0,1.0)
   RETURN
   END

The above function is written in FORTRAN for 16-bit computer.The procedure for determination of the constants in the program is not explained in the book.Kindly suggest references/procedure for
deternination of constants for 64-bit or in general m-bit computer.
           also suggest any other efficicnt function for generation of u(0,1) random number.

                                M.KRISHNA REDDY
                                DEPT. OF STATISTICS
                                OMANIA UNIVERSITY
                                HYDERABAD-500 007
                                INDIA




_____________________________________________________
Chat with your friends as soon as they come online. Get Rediff Bol at
http://bol.rediff.com

Participate in crazy auctions at http://auctions.rediff.com/auctions/