A linear congruential generator starts with an integer seed and iteratesThe outputs lie in and are used as pseudorandom numbers approximating a uniform distribution. They are deterministic once the seed is fixed. The largest possible period is , since there are only states; good period alone does not establish independence or good multivariate uniformity.
The full-period criterion for a mixed congruential generator says that period for every seed occurs exactly whenFor , these conditions reduce toThe multiplier must satisfy both and . A positive shift alone is insufficient: for example, a shift divisible by three cannot give period when the multiplier is one modulo three. If the required coprime shift has already been chosen, the condition on the multiplier alone is for an integer .
Use the ratio-of-uniforms method onWriting gives and . Consequentlybecause the derivative vanishes at . Thus the normal ratio-of-uniforms envelope is the rectangle , .
Generate independent with uniform distribution on , set and , and accept precisely whenReject and repeat otherwise. On acceptance return . One can compare logarithms instead of exponentials to avoid underflow.
For a proof, the change of variables has Jacobian determinant . A uniform point in therefore gives an -density proportional toNormalizing yields the required normal distribution with mean zero and variance . The region area is ; dividing it by the rectangle area gives acceptance probability .
For , integrating the Weibull distribution probability density function givesThe inverse transform sampling method takes uniform on and solves . HenceSince is also uniform, is an equivalent implementation. For any , the resulting event has probability , verifying its distribution.
Assume . Draw an independent component indicator with a Bernoulli distribution of success probability . On success, generate the normal distribution from part (i) and return its absolute value; this has the half-normal distribution probability density function on . On failure, generate the Weibull distribution from part (ii). Use fresh independent uniforms for the chosen component.
The law of total probability gives the output probability density functionas required. The factor two belongs inside the half-normal component; the probability of choosing that component is , not .
Articles by others on the same topic
There are currently no matching articles.