File Download
  Links for fulltext
     (May Require Subscription)
Supplementary

Article: A simple method for generating gamma variables

TitleA simple method for generating gamma variables
Authors
KeywordsAlgorithms
Gamma distribution
Performance
Random number generation
Ziggurat method
Issue Date2000
PublisherAssociation for Computing Machinery, Inc.
Citation
Acm Transactions On Mathematical Software, 2000, v. 26 n. 3, p. 363-372 How to Cite?
AbstractWe offer a procedure for generating a gamma variate as the cube of a suitably scaled normal variate. It is fast and simple, assuming one has a fast way to generate normal variables. In brief: generate a normal variate x and a uniform variate U until In(U) < 0.5x2 + d - dv + dln(u), then return dv. Here, the gamma parameter is α ≥ 1, and v = (1 + x/√9d)3, with d = α - 1/3. The efficiency is high, exceeding 0.951, 0.981, 0.992, 0.996 at α = 1, 2, 4, 8. The procedure can be made to run faster by means of a simple squeeze that avoids the two logarithms most of the time: return dv if U < 1 - 0.0331x4. We give a short C program for any α ≥ 1, and show how to boost an α < 1 into an α > 1. The gamma procedure is particularly fast for C implementation if the normal variate is generated in-line, via the #define feature. We include such an inline version, based on our ziggurat method. With it, and an inline uniform generator, gamma variates can be produced in 400MHz CPUs at better than 1.3 million per second, with the parameter a changing from call to call. Categories and Subject Descriptors: G.4 [Mathematics of Computing]: Mathematical Software; 1.6 [Computing Methodologies]: Simulation and Modeling.
Persistent Identifierhttp://hdl.handle.net/10722/89056
ISSN
2023 Impact Factor: 2.7
2023 SCImago Journal Rankings: 1.040
ISI Accession Number ID
References

 

DC FieldValueLanguage
dc.contributor.authorMarsaglia, Gen_HK
dc.contributor.authorTsang, WWen_HK
dc.date.accessioned2010-09-06T09:51:50Z-
dc.date.available2010-09-06T09:51:50Z-
dc.date.issued2000en_HK
dc.identifier.citationAcm Transactions On Mathematical Software, 2000, v. 26 n. 3, p. 363-372en_HK
dc.identifier.issn0098-3500en_HK
dc.identifier.urihttp://hdl.handle.net/10722/89056-
dc.description.abstractWe offer a procedure for generating a gamma variate as the cube of a suitably scaled normal variate. It is fast and simple, assuming one has a fast way to generate normal variables. In brief: generate a normal variate x and a uniform variate U until In(U) < 0.5x2 + d - dv + dln(u), then return dv. Here, the gamma parameter is α ≥ 1, and v = (1 + x/√9d)3, with d = α - 1/3. The efficiency is high, exceeding 0.951, 0.981, 0.992, 0.996 at α = 1, 2, 4, 8. The procedure can be made to run faster by means of a simple squeeze that avoids the two logarithms most of the time: return dv if U < 1 - 0.0331x4. We give a short C program for any α ≥ 1, and show how to boost an α < 1 into an α > 1. The gamma procedure is particularly fast for C implementation if the normal variate is generated in-line, via the #define feature. We include such an inline version, based on our ziggurat method. With it, and an inline uniform generator, gamma variates can be produced in 400MHz CPUs at better than 1.3 million per second, with the parameter a changing from call to call. Categories and Subject Descriptors: G.4 [Mathematics of Computing]: Mathematical Software; 1.6 [Computing Methodologies]: Simulation and Modeling.en_HK
dc.languageengen_HK
dc.publisherAssociation for Computing Machinery, Inc.en_HK
dc.relation.ispartofACM Transactions on Mathematical Softwareen_HK
dc.rightsACM Transactions on Mathematical Software. Copyright © Association for Computing Machinery, Inc.en_HK
dc.subjectAlgorithmsen_HK
dc.subjectGamma distributionen_HK
dc.subjectPerformanceen_HK
dc.subjectRandom number generationen_HK
dc.subjectZiggurat methoden_HK
dc.titleA simple method for generating gamma variablesen_HK
dc.typeArticleen_HK
dc.identifier.openurlhttp://library.hku.hk:4550/resserv?sid=HKU:IR&issn=0730-0301&volume=26&spage=363&epage=372&date=2000&atitle=A+simple+method+for+generating+gamma+variablesen_HK
dc.identifier.emailTsang, WW:tsang@cs.hku.hken_HK
dc.identifier.authorityTsang, WW=rp00179en_HK
dc.description.naturelink_to_OA_fulltext-
dc.identifier.doi10.1145/358407.358414-
dc.identifier.scopuseid_2-s2.0-0040519931en_HK
dc.identifier.hkuros67143en_HK
dc.relation.referenceshttp://www.scopus.com/mlt/select.url?eid=2-s2.0-0040519931&selection=ref&src=s&origin=recordpageen_HK
dc.identifier.volume26en_HK
dc.identifier.issue3en_HK
dc.identifier.spage363en_HK
dc.identifier.epage372en_HK
dc.identifier.isiWOS:000166623100003-
dc.publisher.placeUnited Statesen_HK
dc.identifier.scopusauthoridMarsaglia, G=6603739473en_HK
dc.identifier.scopusauthoridTsang, WW=7201558521en_HK
dc.identifier.issnl0098-3500-

Export via OAI-PMH Interface in XML Formats


OR


Export to Other Non-XML Formats