For good uniform random number generators, check out the work by Pierre at the University of Montreal. Pierre L'Ecuyer's papers can be downloaded by ftp or HTML. Uniform random number generator: I get frequently asked for a good reliable uniform random number generator. For binary sequences produced by cryptographic random number generators (RNGs). Complexity test described in the Crypt-XS package is based on Lempel-Ziv compression. Utilizing the SHA-1 generator suggests that for sequence lengths of. 3 This file may be found on Marsaglia's Random Number CDROM,.
![Complexity Complexity](/uploads/1/2/5/8/125845473/954863471.jpg)
Generate Random Numbers Using Uniform Distribution Inversion
This example shows how to generate random numbers using the uniform distribution inversion method. This is useful for distributions when it is possible to compute the inverse cumulative distribution function, but there is no support for sampling from the distribution directly.
Step 1. Generate random numbers from the standard uniform distribution.
Use
rand
to generate 1000 random numbers from the uniform distribution on the interval (0,1).The inversion method relies on the principle that continuous cumulative distribution functions (cdfs) range uniformly over the open interval (0,1). If is a uniform random number on (0,1), then generates a random number from any continuous distribution with the specified cdf
F
.Step 2. Generate random numbers from the Weibull distribution.
Use the inverse cumulative distribution function to generate the random numbers from a Weibull distribution with parameters
A = 1
and B = 1
that correspond to the probabilities in u
. Plot the results.The histogram shows that the random numbers generated using the Weibull inverse cdf function
wblinv
have a Weibull distribution.Step 3. Generate random numbers from the standard normal distribution.
The same values in
u
can generate random numbers from any distribution, for example the standard normal, by following the same procedure using the inverse cdf of the desired distribution.![The complexity of nonuniform random number generation pdf files download The complexity of nonuniform random number generation pdf files download](/uploads/1/2/5/8/125845473/423022918.png)
The histogram shows that, by using the standard normal inverse cdf
norminv
, the random numbers generated from u
now have a standard normal distribution.See Also
hist
| norminv
| rand
| wblinv
Related Topics
Acknowledgements
The authors thank the contributors of the original TPCx-HS development committee, Andrew Bond (Red Hat), Andrew Masland (NEC), Avik Dey (Intel), Brian Caufield (IBM), Chaitanya Baru (SDSC), Da Qi Ren (Huawei), Dileep Kumar (Cloudera), Jamie Reding (Microsoft), John Fowler (Oracle), John Poelman (IBM), Karthik Kulkarni (Cisco), Meikel Poess (Oracle), Mike Brey (Oracle), Mike Crocker (SAP), Paul Cao (HP), Reza Taheri (VMware), Simon Harris (IBM), Tariq Magdon-Ismail (VMware), Wayne Smith (Intel), Yanpei Chen (Cloudera), Michael Majdalany (L&M), Forrest Carman (Owen Media), and Andreas Hotea (Hotea Solutions). Thanks to Manankumar Trivedi for his support with benchmark testing and analysis.
Authors also thank Satinder Sethi for his guidance and support with this effort.