首页    期刊浏览 2024年10月07日 星期一
登录注册

文章基本信息

  • 标题:The Ziggurat Method for Generating Random Variables
  • 本地全文:下载
  • 作者:George Marsaglia ; Wai Wan Tsang
  • 期刊名称:Journal of Statistical Software
  • 印刷版ISSN:1548-7660
  • 电子版ISSN:1548-7660
  • 出版年度:2000
  • 卷号:5
  • 期号:1
  • 页码:1-7
  • 语种:English
  • 出版社:University of California, Los Angeles
  • 摘要:We provide a new version of our ziggurat method for generating a random variable from a given decreasing density. It is faster and simpler than the original, and will produce, for example, normal or exponential variates at the rate of 15 million per second with a C version on a 400MHz PC. It uses two tables, integers k i , and reals w i . Some 99% of the time, the required x is produced by: Generate a random 32-bit integer j and let i be the index formed from the rightmost 8 bits of j. If j < k, return x = j x w i . We illustrate with C code that provides for inline generation of both normal and exponential variables, with a short procedure for settting up the necessary tables.
国家哲学社会科学文献中心版权所有