Rejection Method
Study guide: Exam MAS-I
The Rejection Method is a method of simulating a random variable X with density f from candidates drawn from another density g that is easier to simulate, accepting each candidate with a probability that depends on the ratio f/g. The constant c in the method must satisfy f(x) \le c\,g(x) for every x, and the smallest such constant is
c = \max_x \frac{f(x)}{g(x)}
- The maximum is over the values of
xwheref(x) > 0.
The method repeats the following steps until a candidate is accepted:
- Generate a candidate
Ywith densityg. - Generate a random number
U, uniform on(0, 1)and independent ofY. - If
U \le f(Y)/(c\,g(Y)), accept the candidate and setX = Y. Otherwise return to step 1.
The candidate is accepted when
U \le \frac{f(Y)}{c\,g(Y)}
The choice of c makes this ratio at most 1, so it is a probability. An accepted value has density f. To find the maximum of f/g, set its derivative equal to zero, solve for the critical point, and evaluate the ratio there.
Claim sizes, in thousands, have density
f(x) = x e^forx > 0. Candidates are drawn from the exponential density with mean 2,g(x) = \frac12 e^. What is the smallest validc, and is the candidateY = 1.8326accepted with the random numberu = 0.95?
- The ratio is
\frac{f(x)}{g(x)} = 2x e^{-x/2}.- Its derivative,
(2 - x)e^{-x/2}, is zero atx = 2, soc = 2(2)e^{-1} = 4/e = 1.4715.- The acceptance threshold is
\frac{f(Y)}{c\,g(Y)} = \frac{Y}{2}\,e^{1 - Y/2}, which is 0.9963 atY = 1.8326.- Since
0.95 \le 0.9963, the candidate is accepted, and the simulated claim size is 1.8326 thousand.
A uniform candidate density
When the candidates are uniform on (0, 1), g(x) = 1, so the ratio f/g is f itself, and the smallest valid constant is the maximum of the density:
c = \max_{0 < x < 1} f(x)
The candidate is then accepted when U \le f(Y)/c.
A random variable has density
f(x) = 20x(1 - x)^3for0 < x < 1and is simulated with uniform candidates. What is the smallest validc, and which of the pairs(Y, U) = (0.30, 0.80)and(0.70, 0.20)are accepted?
- The derivative
f'(x) = 20(1 - x)^2(1 - 4x)is zero atx = \frac14.- The smallest valid constant is
\begin{aligned} c &= f\left(\tfrac14\right) \\ &= 20\left(\tfrac14\right)\left(\tfrac34\right)^3 \\ &= \tfrac{135}{64} \\ &= 2.109 \end{aligned}
- The acceptance threshold is
\frac{f(Y)}{c} = \frac{256}{27}\,Y(1 - Y)^3.- At
Y = 0.30the threshold is 0.9756. Since0.80 \le 0.9756, the candidate is accepted, andX = 0.30.- At
Y = 0.70the threshold is 0.1792. Since0.20 > 0.1792, the candidate is rejected.
Number of iterations
Each iteration accepts its candidate with probability 1/c, independently of the other iterations. The number of iterations N needed to produce one value therefore has a geometric distribution with success probability 1/c, and its mean is
E[N] = c
The smallest valid constant gives the fewest iterations on average. It is always at least 1, and it is closer to 1 when g is closer to f.
For the density
f(x) = 20x(1 - x)^3with uniform candidates, what is the probability that an iteration is accepted, and how many iterations are needed on average?
- With
c = \frac{135}{64}, an iteration is accepted with probability\frac{64}{135} = 0.474.- On average
c = 2.109iterations are needed for each simulated value.
Using the maximum of
fwhengis not uniform The constant is the maximum off/g, not off. Forf(x) = x e^{-x}with exponential candidates of mean 2, the maximum offise^{-1} = 0.368, which would make the acceptance ratio greater than 1. The correct constant is4/e = 1.4715.