Use the ratio-of-uniforms method on
Writing gives and . Consequently
because 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 when
Reject 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 to
Normalizing 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 gives
The inverse transform sampling method takes uniform on and solves . Hence
Since 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 function
as 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 (0)

There are currently no matching articles.