Skip to main content
Log in

Computer methods for efficient sampling from largely arbitrary statistical distributions

Methoden zur effizienten Erzeugung nicht-gleichverteilter Pseudo-Zufallszahlen mit nahezu beliebiger Verteilungsfunktion

  • Published:
Computing Aims and scope Submit manuscript

Abstract

Given a basic pseudo-random number generator which returns uniformly distributed samplesU from the interval (0, 1) and a statistical distribution as defined by its distribution functionF(x). Then the inversion methodX←F −1 (U) produces samples fromF(x). A procedure is developed which prepares “guide tables” in order to facilitate this inversion so that sampling becomes efficient for arbitraryF(x).

For discrete distributions these tables are small and easy to set up, and the resulting sampling algorithm compares well with known general methods. Continuous distributions require longer set-up times and more space for tables. These are prepared using given probability densitiesf(x). The method can cope with “reasonable”f(x) including most cases which are commonly encountered in statistics. The reported computational experience, on Poisson, Normal, Gamma and Cauchy distributions, indicates that our general routine is almost as fast as the best known sampling algorithms which were specially designed for these distributions.

Zusammenfassung

Gegeben sei ein Pseudo-Zufallszahlen-Generator, der gleichverteilte StichprobenU aus dem Intervall (0, 1) liefert, und eine statistische Verteilung, beschrieben durch ihre VerteilungsfunktionF(x). Dann erzeugt die InversionsmethodeXF −1(U) Stichproben vonF(x). Ein Verfahren wird entwickelt, das “Guide”-Tafeln erstellt, mit dem Ziel, diese Inversion zu ermöglichen, so daß das Verfahren für beliebigeF(x) effizient wird.

Für diskrete Verteilungen sind diese Tafeln klein und leicht zu erstellen, und der entstehende Stichproben-Algorithmus kann mit bekannten allgemeinen Verfahren gut konkurrieren. Stetige Verteilungen erfordern längere Vorbereitungszeiten und mehr Speicherplatz für die Tafeln. Diese werden mit Hilfe gegebener Wahrscheinlichkeitsdichtenf(x) vorbereitet. Die Methode ist anwendbar auf “vernünftige”f(x), einschließlich der normalerweise in der Statistik vorkommenden Fälle. Aufgrund der angeführten Rechenerfahrung mit Poisson-, Normal-, Gamma- und Cauchy-Verteilungen zeigt sich, daß unser allgemeines Verfahren fast so schnell ist, wie die besten bekannten Methoden, die speziell auf diese Verteilungen zugeschnitten wurden.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Abramowitz, M., Stegun, I. A.: Handbook of mathematical functions, 9th. ed., p. 795. New York: Dover Publications 1965.

    Google Scholar 

  2. Ahrens, J. H., Dieter, U.: Computer methods for sampling from the exponential and normal distributions. Communications of the ACM15, 873–882 (1972).

    Article  Google Scholar 

  3. Ahrens, J. H., Dieter, U.: Extensions of Forsythe's method for sampling from the normal distribution. Mathematics of Computation27, 927–937 (1973).

    Google Scholar 

  4. Ahrens, J. H., Dieter, U.: Computer methods for sampling from gamma, beta, Poisson and binomial distributions. Computing12, 223–246 (1974).

    Google Scholar 

  5. Atkinson, A. C.: The computer generation of Poisson random variables. Applied Statistics28, 29–35 (1979).

    Google Scholar 

  6. Atkinson, A. C.: Recent developments in the computer generation of Poisson random variables. Applied Statistics28, 260–263 (1979).

    Google Scholar 

  7. Chen, H. C., Asau, Y.: On generating random variates from an empirical distribution. AIIE Transactions6, 163–166 (1974).

    Google Scholar 

  8. Fishman, G. S.: Principles of discrete event simulation, 1st ed., pp. 392–429. New York: Wiley Interscience 1978.

    Google Scholar 

  9. Kohrt, K. D.: Efficient sampling from non-uniform statistical distributions. Diploma Thesis, University Kiel, 1980.

  10. Marsaglia, G.: Generating discrete random variables in a computer. Communications of the ACM6, 37–38 (1963).

    Article  Google Scholar 

  11. Marsaglia, G., Bray, T. A.: A convenient method for generating normal variables. SIAM Review6, 260–264 (1964).

    Article  Google Scholar 

  12. Marsaglia, G.: The squeeze method for generating gamma variates. Computers and mathematics with applications3, 321–325 (1977).

    Article  Google Scholar 

  13. Walker, A. J.: An efficient method for generating discrete random variables with general distributions. ACM Transactions on Mathematical Software3, 253–256 (1977).

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Ahrens, J.H., Kohrt, K.D. Computer methods for efficient sampling from largely arbitrary statistical distributions. Computing 26, 19–31 (1981). https://doi.org/10.1007/BF02243420

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF02243420

Keywords

Navigation