![]() |
Brighton Webs Ltd. statistical and data services for industry |
||||||||||||
|
Home Index Page |
Non-Uniform Random Numbers One method of generating non-uniform random numbers is based on based on transforming a standard continuous uniform distribution with a distributions inverse probability function:
where r is the non uniform number, u is a uniformly distributed random number in the range zero to one and g is the inverse probability function. However, some distributions such as the normal and gamma do not have an accessible inverse probability function. Whilst it is possible to use the cumulative probability function in an iteration process to get the value of x which corresponds to the value of u, this needs a lot of computational power. The method described below is based on the interpolation of a cumulative probability table. The methodology is intended for the generation of large quantities of random numbers. It works by performing a relatively small number of complex calculations (say, 1,000) for the compilation of the table and a large number of less complex ones to interpolate the table. For continuous distributions (e.g. Normal, Gamma etc.), a three stage process is used:
This methodology works for both truncated and non-truncated distributions. Source Random numbers for Discrete Distributions For discrete distributions (e.g. binomial) as similar process is used based on the rule that the random variable takes the value x when the random number r meets the condition: This is illustrated in the graphic below: For discrete distributions such as the Poisson where the value of the random variable has a theoretical maximum value of infinity, a similar methodology to that used for continuous distributions attempts to ensure that maximum values generated are consistent with the largest value output of the source of continuous random numbers |
||||||||||||
|
For more information: info@brighton-webs.co.uk |