2601

The Complexity Of Nonuniform Random Number Generation Pdf

How To Generate Non- Uniform Random Numbers In Excel Worksheets. Distribution Fitting Software & Articles. Non- Uniform Random Numbers.

Non-Uniform Random Variate Generation Non-Uniform Random Variate Generation (originally published with Springer-Verlag, New York, 1986) School of Computer Science McGill University Preface to the Web Edition When I wrote this book in 1986, I had to argue long and hard with Springer Verlag to publish it. They printed a small number of copies, and never bothered with a second printing, even though, surprisingly, there seemed to be some continued demand for the book. I have asked Springer to print more copies, but they flatly refused, unless I was willing to publish a second edition with them in the near future.

Burnt once, why would I trust them with a second edition? Also, I figured that since Springer had gross income about 500,000 US dollars from my books with them, that they would be more generous with their royalties and more responsive to demands for second printings.

The contrary is true in fact: royalties are decreasing (they stand now at 7.5% per book), and I feel that I am just one of the many academic rape victims. As the book is out of print, the copyright and ownership is mine, so I do with it what I want.

On these web pages, you will find a fine scan of my book in text searchable PDF format (thanks, HK). This is the original text. A list of errata is. Furthermore, I give anyone the permission, even without asking me, to take these PDF files to a printer, print as many copies as you like, and sell them for profit. If you would like me to advertise the sales points of the hard copies, please let me know.

To the libraries: Please do not charge patrons for copying this book. I grant everyone the right to copy at will, for free. So, there you have it. Eventually, I will do this with all my books. While I love Springer, my honeymoon with them is over. I will of course never start any affairs with the champion bloodsuckers like Elsevier, Kluwer or Dekker.

Outfits I like are SIAM (nonprofit), Dover (great pricing) and Oxford University Press (allowing authors to post books on the web). With the arrival of Amazon, book advertising is no longer necessary, and one can publish with any company, really. So, it will be a matter of a few years before the old publishers will come back to the academics on their hands and knees asking for manuscripts. The with all PDF files is provided for your convenience.

Below, you will find a table of contents and an index, both in HTML format: look for a keyword, note the page number, go to the right chapter via the table, and you are done. Luc Devroye Montreal, September 29, 2003 Table of contents TABLE OF CONTENTS I.

General outline. About our notation.

A few important univariate densities. Assessment of random variate generators. Distributions with no variable parameters. Parametric families.

Operations on random variables. Order statistics.

Sums of independent random variables. Sums of independent uniform random variables. The inversion method.

The inversion principle. Inversion by numerical solution of $F(X)=U$. Explicit approximations. The rejection method. Development of good rejection algorithms. Generalizations of the rejection method. Wald's equation.

Letac's lower bound. The squeeze principle. Recycling random variates. Decomposition as discrete mixtures. Decomposition into simple components.

Partitions into intervals. The waiting time method for asymmetric mixtures. Polynomial densities on $[0,1]$. Mixtures with negative coefficients.

The acceptance-complement method. Simple acceptance-complement methods. Acceleration by avoiding the ratio computation. An example: nearly flat densities on $[0,1]$. The inversion method. Inversion by truncation of a continuous random variate. Comparison-based inversions.

The method of guide tables. Inversion by correction.

Table look-up methods. The table look-up principle. Multiple table look-ups. The alias method. The alias-urn method. Geometrical puzzles. Other general principles.

The rejection method. The composition and acceptance-complement methods. Motivation for the chapter. The Forsythe-von Neumann method.

Description of the method. Von Neumann's exponential random variate generator.

Monahan's generalization. An example: Vaduva's gamma generator. Almost-exact inversion. Monotone densities on $[0, inf )$. Polya's approximation for the normal distribution. Approximations by simple functions of normal random variates. Many-to-one transformations.

The principle. The absolute value transformation. The inverse gaussian distribution. The series method.

Analysis of the alternating series algorithm. Analysis of the convergent series algorithm. The exponential distribution. The Raab-Green distribution. The Kolmogorov-Smirnov distribution. Representations of densities as integrals. Khinchine's and related theorems.

The inverse-of-$f$ method for monotone densities. Convex densities. Recursive methods based upon representations. A representation for the stable distribution. Densities with Polya type characteristic functions.

The ratio-of-uniforms method. Several examples. Uniform and exponential spacings. Uniform spacings. Exponential spacings. Generating ordered samples.

Generating uniform $[0,1]$ order statistics. Bucket sorting. Bucket searching. Generating exponential order statistics.

Generating order statistics with distribution function F. Generating exponential random variates in batches.

The polar method. Radially symmetric distributions. Generating random vectors uniformly distributed on $C sub d$. Generating points uniformly in and on $C sub 2$.233 4.4. Generating normal random variates in batches. Generating radially symmetric random vectors. The deconvolution method.

The Poisson process. Simulation of homogeneous Poisson processes. Nonhomogeneous Poisson processes. Global methods for nonhomogeneous Poisson process simulation. Generation of random variates with a given hazard rate. Connection with Poisson processes.

The inversion method. The composition method. The thinning method. DHR distributions. Dynamic thinning.

Analysis of the dynamic thinning algorithm. Generating random variates with a given discrete hazard rate.

The sequential test method. Hazard rates bounded away from 1.280 3.4.

Discrete dynamic thinning. Black box philosophy. Log-concave densities. Inequalities for log-concave densities. A black box algorithm.

The optimal rejection algorithm. The mirror principle. Non-universal rejection methods.

Inequalities for families of densities. Bounds for unimodal densities. Densities satisfying a Lipschitz condition. Normal scale mixtures. The inversion-rejection method. The principle. Bounded densities.

Unimodal and monotone densities. Monotone densities on $[0,1]$. Bounded monotone densities: inversion-rejection based on Newton-Raphson iterations. Bounded monotone densities: geometrically increasing interval sizes. Lipschitz densities on $[0, inf )$. Composition versus rejection. Strip methods.

Example 1: monotone densities on $[0,1]$.362 2.3. Other examples. Grid methods. Generating a point uniformly in a compact set $A$. Avoidance problems.

Fast random variate generators. The normal density. The tail of the normal density.

Composition/rejection methods. The exponential density. Marsaglia's exponential generator. The rectangle-wedge-tail method.

The gamma density. The gamma family. Gamma variate generators. Uniformly fast rejection algorithms for $a >= 1$.407 3.4. The Weibull density.

Johnk's theorem and its implications. Gamma variate generators when $a 3.7. The tail of the gamma density. Stacy's generalized gamma distribution.

The beta density. Properties of the beta density. Overview of beta generators. The symmetric beta density.

Uniformly fast rejection algorithms. Generators when $min (a,b) 4.6.

The t distribution. Ordinary rejection methods. The Cauchy density.

The stable distribution. Definition and properties. Overview of generators. The Bergstrom-Feller series. The series method for stable random variates. Nonstandard distributions. Bessel function distributions.

The logistic and hyperbolic secant distributions. The von Mises distribution. The Burr distribution. The generalized inverse gaussian distribution. Goals of this chapter. Generating functions. A universal rejection method.

The geometric distribution. Definition and genesis. The Poisson distribution. Basic properties. Overview of generators.

Simple generators. Rejection methods. The binomial distribution. Overview of generators. Simple generators. The rejection method.

Recursive methods. Symmetric binomial random variates. The negative binomial distribution. The logarithmic series distribution. The Zipf distribution.

A simple generator. The Planck distribution. The Yule distribution. General principles. The conditional distribution method. The rejection method. The composition method.

Discrete distributions. Linear transformations. The multinormal distribution.

Linear transformations. Generators of random vectors with a given covariance matrix. The multinormal distribution. Points uniformly distributed in a hyperellipsoid. Uniform polygonal random vectors. Singular distributions. Bivariate distributions.

Creating and measuring dependence. Bivariate uniform distributions. Bivariate exponential distributions. A case study: bivariate gamma distributions. The Dirichlet distribution. Definitions and properties.

Liouville distributions. Some useful multivariate families. The Cook-Johnson family. Multivariate Khinchine mixtures.

Random matrices. Random correlation matrices. Random orthogonal matrices. Random $R times C$ tables. Classical sampling.

The swapping method. Classical sampling with membership checking 613 2.3. Sequential sampling. Standard sequential sampling.

The spacings method for sequential sampling. The inversion method for sequential sampling. The ghost point method. The rejection method. Reservoir sampling. The reservoir method with geometric jumps.

General principles. The decoding method. Generation based upon recurrences. Random permutations.

Simple generators. Random binary search trees. Random binary trees. Representations of binary trees. Generation by rejection.

Generation by sequential sampling. The decoding method. Random partitions. Recurrences and codewords. Generation of random partitions.

Random free trees. Prufer's construction. Klingsberg's algorithm. Free trees with a given number of leaves. Random graphs. Random graphs with simple properties. Connected graphs.

Tinhofer's graph generators. Bipartite graphs. The maximum of iid random variables. Overview of methods. The quick elimination principle. The record time method.

Random variates with given moments. The moment problem. Discrete distributions. Unimodal densities and scale mixtures. Convex combinations.

Characteristic functions. Problem statement. The rejection method for characteristic functions. A black box method. Problem statement. A detour via characteristic functions. Rejection based upon a local central limit theorem.

A local limit theorem. The mixture method for simulating sums. Sums of independent uniform random variables.

Discrete event simulation. Future event set algorithms. Reeves's model. Linear lists. Tree structures.

Regenerative phenomena. The principle. Random walks. Birth and death processes. Phase type distributions. The Magic Path Of Intuition Pdf To Word. The generalization of a sample. Problem statement.

Sample independence. Consistency of density estimates. Sample indistinguishability. Moment matching. Generators for $f sub n$. The random bit model. Some examples.

The Knuth-Yao lower bound. The lower bound. Optimal and suboptimal DDG-tree algorithms. Suboptimal DDG-tree algorithms. Optimal DDG-tree algorithms. Distribution-free inequalities for the performance of optimal DDG-tree algorithms.

782 784 817 2-3 tree 613 2-3 tree in discrete event simulation 747 Abramowitz, M. 297 302 391 415 678 absolute continuity 172 absolute value transformation 147 absorbing Markov chain 757 acceptance complement method for discrete distributions 116 acceptance-complement method 75 accelerated 78 for Cauchy distribution 81 451 for Poisson distribution 502 for t distribution 446 of Ahrens and Dieter 77 79 squeeze principle for 78 aceptance-complement method for nearly flat densities 79 adaptive inversion method 38 adaptive strip method 367 adjacency list 669 admissible algorithm 9 admissible generator 9 10 Afifi, A.A. 606 Aho, A.V. 90 92 214 372 669 Ahrens, J.H. 36 72 76 77 84 98 121 145 359 379 380 383 391 396 397 405 413 420 423 424 425 432 502 507 518 523 538 617 Ahrens-Dieter generator for exponential distribution 397 Aitchison, J. 594 Akima, H. 763 Alder, B.J.

372 algorithm B2PE for beta distribution 305 309 algorithm B4PE for beta distribution 305 algorithm of Nijenhuis and Wilf for classical sampling 618 algorithm 2 Ali, M.M. 578 alias method algorithm 108 bit-based 777 set-up 109 with two tables 109 alias-urn method 110 almost-exact inversion method 133 for exponential distribution 134 for gamma distribution 137 139 141 145 for monotone densities 134 for normal distribution 135 380 for t distribution 143 alternating series method 153 analysis of 154 exponential version of 154 for exponential distribution 158 for Kolmogorov-Smirnov distribution 162 for Raab-Green distribution 158 analytic characteristic function 685 Ananthanarayanan, K. 359 Anderson, T. Stargate Atlantis Stagione 5 Ita Download Skype here. W. 168 716 Anderson-Darling statistic 168 Andrews, D.F. 326 approximations for inverse of normal distribution function 36 arc sine distribution 429 481 as the projection of a radially symmetric random vector 230 deconvolution method 239 polar method for 482 properties of 482 Archer, N.P. 687 Arfwedson's distribution 497 Arfwedson, G.

497 Arnason, A.N. 432 Arnold, B.C. 482 583 Arnold, D.B. 592 656 Asau, Y. 96 assessment of generators 8 association 574 576 589 asymmetric Kolmogorov-Smirnov statistics 167 asymmetric mixtures 71 asymptotic independence 760 Atkinson's algorithm for Poisson distribution 518 Atkinson, A.C.

121 379 380 404 432 439 440 443 480 502 505 507 518 Atkinson-Whittaker method for beta distribution 440 443 autocorrelation matrix 571 AVL tree in discrete event simulation 747 avoidance problems 372 grid method for 373 Baase, S. 214 Babu, A.J.G. 304 305 309 432 Badel, M.

571 Bailey, B.J.R. 36 balanced binary search tree in discrete event simulation 746 balanced parentheses 652 ball-in-urn method 608 609 for multinomial distribution 558 for random bipartite graphs 671 Banks, J.

4 736 Barbu, G. 204 Barlow, R.E. 260 277 343 356 742 Barnard, D.R. 367 Barndorff-Nielsen, O. 329 330 478 483 Barnett, V. 582 Barr, D.R.

566 Bartels's bounds 460 461 Bartels, R. 458 459 460 462 Bartlett's kernel 762 765 767 inversion method for 767 order statistics method for 766 rejection method for 765 Bartlett, M.S. 762 Barton, D.E. 168 519 Basu, D. 594 batch method for exponential distribution 223 Beasley, J.D. 36 Beckman, R.J. 175 Bell, J.R.

236 380 Bendel, R.B. 4 Bentley, J.L. 215 Berenson, M.L.

215 220 Bergstrom, H. 459 460 Bergstrom-Feller series for stable distribution 459 460 461 Berman's method analysis of 419 for beta distribution 418 for gamma distribution 419 420 Berman's theorem 416 Berman, M.B.

416 420 Bernoulli distribution 486 521 properties of 689 Bernoulli generator 769 Bernoulli number 490 493 550 Bernoulli trial 521 Berry-Esseen theorem application of 225 Besag, J.E. 372 Bessel function distribution 469 type I 469 type II 469 Bessel function 469 integral representation for 470 modified 469 of the first kind 473 755 of the second kind 469 Best's rejection method for gamma distribution 410 Best, D.J.

– Easily Fit Distributions in Excel • over 55 • goodness-of-fit tests • interactive graphs • random numbers Even though the RAND function can be useful for generating Uniform random numbers, most of the time you will need to model various non-uniform distributions, such as the Normal, Lognormal, Exponential, Gamma, and others. In fact, the Uniform distribution arises in a very limited number of applications, so the chances are your worksheet models will rarely deal with this distribution. Excel doesn't provide any functions for directly generating random numbers from the popular continuous and discrete distributions, however, you can use the standard capabilities of Excel and the inverse transform method to create such a function yourself. How To Use The Inverse Transform Method In theory, the inverse transform method is very easy to use: to generate a random number from any probability distribution with cumulative distribution function F(x), you need to take the following steps: • generate a random number from the Uniform distribution: u=Uniform(0,1), and • calculate x=F -1(u), where F -1(u) is the inverse cumulative distribution function (ICDF) of the same distribution, and x is the resulting random number. To implement this method in Excel, you can use the RAND function to generate random numbers from the Uniform distribution, and apply the built-in functions to calculate the ICDF. The standard Excel package allows you to calculate the ICDF for a limited number of probability distributions: Beta (the function name is BETAINV), Chi-Squared (CHIINV), F distribution (FINV), Gamma (GAMMAINV), Lognormal (LOGINV), Normal (NORMINV), and Student's t (TINV).

For example, the following formula will return the inverse CDF of the Normal distribution with mean=1 and standard_deviation=2 evaluated at p=0.2: =NORMINV(0.2; 1; 2) Replacing 0.2 with RAND will yield the Normal random number generation formula: =NORMINV(RAND(); 1; 2) Similarly, you can generate random numbers from the other distributions available in Excel. If the distribution you need to use in your worksheet models is not supported, you can create the inverse CDF formula yourself, based on the analytic expression for the cumulative distribution function. For example, the Exponential distribution CDF is defined as: F(x) = 1 − exp(−λ * x), and the inverse CDF is: F -1(u) = −ln(1−u) / λ, so, for example, if the value of the λ parameter is 0.5, the resulting Excel generation formula will be as follows: =−LN(1−RAND()) / 0.5 Limitations Of The Inverse Transform Method. – Easily Fit Distributions in Excel • over 55 • goodness-of-fit tests • interactive graphs • random numbers Despite the fact that the inverse transform method can be used to generate random numbers from some distributions, this approach has a number of limitations.

The main problem is that this method is based on the inverse cumulative distribution function, which is not well defined for all distributions: • the inverse transform method only works with continuous distributions, and cannot be used with discrete distributions such as the Poisson, Binomial, Geometric, and Hypergeometric models; • for some continuous distributions, the inverse CDF is not available in closed form, and cannot be easily calculated in Excel; • the standard Excel functions BETAINV, CHIINV, GAMMAINV, LOGINV, NORMINV etc. Are all based on the approximation formulas, which usually results in accuracy issues (and low-quality random numbers).

The inverse transform method uses Uniform random numbers, so the limitations of the RAND function come into play as well. And finally, to successfully apply this method, you have to derive and use the analytic expressions for the inverse CDF of the distributions you are dealing with, which is a very time-consuming and error-prone process. Along with the inverse transform method, there are a number of algorithms that can be used to generate random numbers from specific non-uniform distributions, however, these methods cannot be implemented in Excel worksheets due to their relative complexity. Non-Uniform Random Numbers - Using EasyFitXL allows you to easily generate random numbers from more than 50 popular continuous and discrete distributions, ensuring that you never face the challenges of the standard Excel approach.

For each distribution, EasyFitXL provides a separate worksheet function based on the generation algorithm optimized for that particular distribution. The functions are optimized for performance and can be used with any Excel version starting with Excel 2000, including the latest version. EasyFitXL supports the multi-threaded worksheet recalculation feature of Excel 2010 and 2007, significantly decreasing the calculation times on multi-core computers, enabling you to save time when running large simulations. EasyFitXL makes it easy for you to insert an appropriate function into your worksheet using the standard Excel Insert Function dialog. The random number generation functions are grouped into a separate category called 'EasyFitXL (Random Numbers)'.

– Easily Fit Distributions in Excel • over 55 • goodness-of-fit tests • interactive graphs • random numbers For example, using NormalRand(2; 1) in your worksheets will generate high-quality random numbers from the Normal distribution with parameters σ=2 (standard deviation, or scale parameter) and μ=1 (mean, or location parameter). For this particular distribution, EasyFitXL uses the generation method based on the, which is considered to be one of the best methods for generating Normal random numbers in terms of quality and performance, in contrast to the inverse transform method. Visual Random Number Generation The standard Excel behaviour is to automatically update all the cells containing random numbers when the worksheet is recalculated. When performing Monte Carlo simulations, this feature is used to recalculate the entire model thousands of times, each time with a new set of random numbers.

However, if you need to generate a single set of random numbers from a particular distribution and store the numbers in a current sheet or another location, using worksheet functions is not the best idea. EasyFitXL offers an easy solution to this problem: select 'Random Numbers' from the EasyFitXL menu. Conclusion The standard Excel package includes a basic set of functions which can be used to generate random numbers from a limited number of distributions. You can also extend the functionality of Excel by developing your own formulas based on the inverse transform method, however, this approach is quite time-consuming and error-prone, and does not work for all distributions. To overcome the limitations of Excel, prevent calculation errors, and increase the performance of your worksheet models, you can use the add-in allowing to easily generate high-quality random numbers from all the commonly used probability distributions. See also: (the 1st part of this article) (www.vertex42.com).