Algorithm 599: sampling from Gamma and Poisson distributions

A) r e t u r n s a s a m p l e S f r o m t h e s t a n d a r d g a m m a d i s t r i b u t i o n w i t h p r o b a b i l i t y d e n s i t y f u n c t i o n y(x) = xa-ie-X/F(a), w h e r e a-~ A > 0. delivers s a m p l e s T f r o m t h e s t a n d a r d n o r m a l d i s t r i b u t i o n. T h e integer v a r i a b l e I R initially defines t h e s e e d of t h e b a s i c r a n d o m n u m b e r sequence. I R is to be e q u a t e d to s o m e p o s i t i v e i n t e g e r of t h e f o r m 4 x K + 1 (our s t a n d a r d s e q u e n c e for t e s t r u n s was b a s e d on I R = 1). A caI1 of a n y of t h e five r o u t i n e s will cause the initialization to t a k e effect (inside S U N I F () , s e c o n d part) a n d to r e s e t I R to-1. F r o m t h e n on this I R < 0 signifies t h a t h e n c e f o r t h t h e p a r a m e t e r I R is a d u m m y variable. Permission to copy without fee all or part of this maternal is granted provided that the copies are not made or dlstmbuted for direct commercial advantage, the ACM copyright notice and the title of …