```Date: Fri, 4 Sep 2009 23:06:05 -0700 Reply-To: Dale McLerran Sender: "SAS(r) Discussion" From: Dale McLerran Subject: Re: Simulate t variables (gttir) In-Reply-To: <6eca73440909041801o5ebd44adl95c0c2bb825f9b35@mail.gmail.com> Content-Type: text/plain; charset=iso-8859-1 I can't tell you how SAS implements random number generation for the t-distribution. However, I would be surprised if they have not implemented an efficient generator. What I can tell you is that the uniform distribution RNG of the RAND function is the Mersenne-Twister algorithm and this has been credited as a very good algorithm. It has a very long period (you would never be able to cycle through the sequence or random numbers in your lifetime) and it has very good randomness properties. As I am sure you know, generating random variates from the uniform distribution is the first step to generating r.v.'s for other distributions. That the RNG for the uniform distribution is the Mersenne-Twister algorithm does not tell us anything about what algorithm is employed to generate r.v.'s for other distributions. It could be that for the t-distribution, RAND is using the fast algorithm. If it were me, I would just stick with the RAND function. You will probably spend more time coding and testing anything you develop than you would save (if you even could save time during execution of your own code). Dale --------------------------------------- Dale McLerran Fred Hutchinson Cancer Research Center mailto: dmclerra@NO_SPAMfhcrc.org Ph: (206) 667-2926 Fax: (206) 667-5977 --------------------------------------- --- On Fri, 9/4/09, OR Stats wrote: > From: OR Stats > Subject: Re: Simulate t variables (gttir) > To: SAS-L@LISTSERV.UGA.EDU > Date: Friday, September 4, 2009, 6:01 PM > yes, the argument for the algorithm > is that it savec computational time. i > will run A-D using the steps from previous email > thread. i will try this > one below to see. i may read thi article more > carefully as in my initial > scan it did not mention the number of replications to run. > > On Fri, Sep 4, 2009 at 7:31 PM, Dale McLerran wrote: > > > I have not coded such an algorithm. But if you > simply > > need to generate a r.v. following a t-distribution, > then > > why not use the RAND function? > > > > Dale > > > > --------------------------------------- > > Dale McLerran > > Fred Hutchinson Cancer Research Center > > mailto: dmclerra@NO_SPAMfhcrc.org > > Ph: (206) 667-2926 > > Fax: (206) 667-5977 > > --------------------------------------- > > > > > > --- On Fri, 9/4/09, OR Stats > wrote: > > > > > From: OR Stats > > > Subject: Simulate t variables (gttir) > > > To: SAS-L@LISTSERV.UGA.EDU > > > Date: Friday, September 4, 2009, 4:21 PM > > > Hello Listserve: > > > > > > Has anyone implemented the fast algorithm for > generating > > > deviates from the > > > student's t family in SAS? The author wrote > the GNU > > > library > > > > > > gttir() > > > > > http://books.google.com/books?id=O0YoPJNWZbcC&pg=PA313&lpg=PA313&dq=GTTIR+MONAHAN&source=bl&ots=qmxzHzN8tz&sig=5JgsqjmH0f3QaufwU65kbjK-8i4&hl=en&ei=OJ-hSsCmFtDfnAec6tiqBQ&sa=X&oi=book_result&ct=result&resnum=3#v=onepage&q=GTTIR%20MONAHAN&f=false > > > > > > The algorithm is suppose to generate the > variables to use > > > for > > > Acceptance-Rejection for goodness of fit test for > student's > > > t. My question > > > is, for those of you who have coded this same > algorithm in > > > SAS, how many > > > random # (from 0 to 1) did you use? > > > > > > ```

Back to: Top of message | Previous page | Main SAS-L page