IDEAS home Printed from https://ideas.repec.org/a/jss/jstsof/v005i08.html
   My bibliography  Save this article

The Ziggurat Method for Generating Random Variables

Author

Listed:
  • Marsaglia, George
  • Tsang, Wai Wan

Abstract

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 ki, and reals wi. 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

Suggested Citation

  • Marsaglia, George & Tsang, Wai Wan, 2000. "The Ziggurat Method for Generating Random Variables," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 5(i08).
  • Handle: RePEc:jss:jstsof:v:005:i08
    DOI: http://hdl.handle.net/10.18637/jss.v005.i08
    as

    Download full text from publisher

    File URL: https://www.jstatsoft.org/index.php/jss/article/view/v005i08/ziggurat.pdf
    Download Restriction: no

    File URL: https://www.jstatsoft.org/index.php/jss/article/downloadSuppFile/v005i08/rnorrexp.c
    Download Restriction: no

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Ahmed Bensaida, 2012. "Improving the Forecasting Power of Volatility Models," International Journal of Academic Research in Accounting, Finance and Management Sciences, Human Resource Management Academic Research Society, International Journal of Academic Research in Accounting, Finance and Management Sciences, vol. 2(3), pages 51-64, July.
    2. Nordahl, Helge A., 2008. "Valuation of life insurance surrender and exchange options," Insurance: Mathematics and Economics, Elsevier, vol. 42(3), pages 909-919, June.
    3. Diaz-Emparanza, Ignacio, 2014. "Numerical distribution functions for seasonal unit root tests," Computational Statistics & Data Analysis, Elsevier, vol. 76(C), pages 237-247.
    4. Leong, Philip H. W. & Zhang, Ganglie & Lee, Dong-U & Luk, Wayne & Villasenor, John, 2005. "A Comment on the Implementation of the Ziggurat Method," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 12(i07).
    5. Yalta, A. Talha & Schreiber, Sven, 2012. "Random Number Generation in gretl," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 50(c01).
    6. Huthmacher, Klaus & Herzwurm, André & Gnewuch, Michael & Ritter, Klaus & Rethfeld, Baerbel, 2015. "Monte Carlo simulation of electron dynamics in liquid water," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 429(C), pages 242-251.
    7. Harman, Radoslav & Lacko, Vladimír, 2010. "On decompositional algorithms for uniform sampling from n-spheres and n-balls," Journal of Multivariate Analysis, Elsevier, vol. 101(10), pages 2297-2304, November.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:jss:jstsof:v:005:i08. See general information about how to correct material in RePEc.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: (Christopher F. Baum) or (). General contact details of provider: http://www.jstatsoft.org/ .

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service hosted by the Research Division of the Federal Reserve Bank of St. Louis . RePEc uses bibliographic data supplied by the respective publishers.