One route is inverse transform sampling: if is the standard normal cumulative distribution function, then has the normal distribution with mean and variance .
Alternatively the Box-Muller transform uses two independent uniform inputs :To verify this, set and . The radial density is for , and the angle is independent and uniform. Their joint density is . Changing to Cartesian coordinates divides by the Jacobian determinant , givingThis factors into two standard normal densities, proving both normality and independence. Then provides the required means and variances. Implementations must avoid the zero input to the logarithm; ideal continuous uniforms hit it with probability zero.
Articles by others on the same topic
There are currently no matching articles.