Article Menu |
Generating Normal Distributed Random Numbersby M.A. (Thijs) van den Berg This article describes the most common methods used in generating nomral distributed random numbers.
[edit] The simple sum approximationThe simpelest algorithm to generate (approximately) Normal distributed random numbers is to sum twelve uniform random numbers This will give random numbers that are approximately normally distributed with mean zero and standard deviation (and variance) one. [edit] The Box-Muller transformThe Box-Muller transform is used to transform uniform distributed random variables into Normal distributed random values. There are two version of the transform. [edit] Rectangular formThe rectangular form uses two uniform distributed random between 0 and 1, [edit] Polar formThe polar form is the preferred form, it's more stable and faster than the rectangular form. It used uniform distributed sampled from the unit circle and converts them into into two uncorrelated Normal distributed numbers. The uniform distributed sampled from the unit circle can be acquired by taking random number between -1 and 1, − 1 < U1,U2 < 1 untill you have two that lie inside a circe, i.e. The Normal random numbers are then calcualted using: [edit] The Inverse Normal DistributionAnother method for generating Normal distributed random numbers is to run uniform random numbers 0 < x < 1 through the inverse Normal distribution. This method is particularly useful when using high dimensional low discrepancy sequences like Sobol, Hastons, Faure. These generators generate specific random numbers that can't be used to feed into the Box-Muller transform without losing their properties. The equation below gives the Hastings approximation to the inverse Normal distribution N − 1(x). The approximation has a maximum error of 1.0 * 10^-5. with [edit] High precision algorithmA high precision algorithm with an absolute value less than 1.15*10^−9 in the entire region can be found on the following page (Peter J. Acklam): http://home.online.no/~pjacklam/notes/invnorm/ [edit] Acceptance-rejection methodThe acceptance rejection method is a very simple algorithm that can be used to generate random numbers given any probability distribution function.
For each random point it is checked to see if it lies above or below the probability distribution function. This is done by computing the height of the probability distribution function at the x value of the random point.
Looking at the plot, it is easily understood that the probability distribution of the x values of the green points will mimic the probability distribution function (blue line). [edit] Ziggurat algorithm"The Ziggurat Method for Generating Random Variables" [edit] Comments
[edit] amit7ul said ...[edit] sitmo said ...If you can generate gamma distributed random variables G(a,b) then T=x/sqrt(g) will Student-t distributed, where x is a standard normal draw, and g is a gamma distributed G(n/2, 0.5) draw. --sitmo 09:42, 12 September 2007 (CEST) |
and substract 6.
and transform them into two uncorrelated Normal distributed numbers.


is there a good reference for generating student-t distributed randoms for a specified degree of freedom
--amit7ul 11:45, 23 August 2007 (CEST)