Laplace ratio-of-uniforms envelope 2026-10-14
For the unnormalized Laplace distribution probability density function , the ratio-of-uniforms method uses . The maximum of is one. On , the maximum of occurs at and equals . On , it occurs at and equals . Thus the displayed rectangle contains the region. Its area is , while the target region has area . Uniform proposals in the rectangle, accepted when , therefore return the correct Laplace distribution with acceptance probability .
Past exam of the mathematics course of the University of Cambridge 2002 iii Paper 40 1 a ii Solution Created 2026-10-03 Updated 2026-10-14
Integrating out the second coordinate gives the probability density function of the marginal distributionThus the ratio has the normalized target probability density function. The factor from the Jacobian determinant is essential; merely transforming the rectangular coordinates as if they remained uniform would give a different probability density function. This is the basis of the ratio-of-uniforms method.
Past exam of the mathematics course of the University of Cambridge 2004 iii Paper 40 3 iv Solution Created 2026-10-03 Updated 2026-10-14
For , use the unnormalized normal shape . The ratio-of-uniforms method samples uniformly fromIts boundary is . The largest possible occurs at and equals , giving the normal ratio-of-uniforms envelope , .
Use independent uniform pairs to propose and . Accept precisely whenTo verify its distribution, change coordinates from to , with and Jacobian determinant . The accepted point is uniform on , and the marginal probability density function of is proportional toThus the result is . The region has positive finite area , and the acceptance probability is . The case requires simply returning zero.
Past exam of the mathematics course of the University of Cambridge 2005 iii Paper 47 3 b i Solution Created 2026-10-03 Updated 2026-10-14
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 .
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 40 3 a Solution Created 2026-10-03 Updated 2026-10-14
Let be proportional to the target probability density function, with . Define the ratio-of-uniforms method through the regionDraw uniformly with respect to area on and return . To prove its law, change variables from to . The Jacobian determinant is , and the allowed interval for is . ConsequentlyThe joint density of is therefore on that interval. Integrating out givesFor an already normalized density, and the region has area . The name refers to the two coordinates of a uniformly sampled region; drawing two unrelated uniforms on arbitrary intervals and taking their ratio would not give the target law.