Rejection Sampling - Acceptance-Rejection Method - Accept-Reject Algorithm
- when cumulative distribution function 𝐹(𝑥) has a complicated form but a probability density function 𝑓(𝑥) is available, random variables with this density can be generated by Rejection Method
- is a type of exact simulation method
- is a basic technique used to generate observations from a distribution
Theorem
Let a pair (𝑋,𝑌) have Uniform distribution over the region
- 𝐴 = {(𝑥,𝑦) | 0 ≤ 𝑦 ≤ 𝑓(𝑥)}
for some probability density function 𝑓.
Then 𝑓 is the density of 𝑋
proof
Algorithm
- find such numbers 𝑎, 𝑏, and 𝑐 that 0 ≤ 𝑓(𝑥) ≤ 𝑐 for 𝑎 ≤ 𝑥 ≤ 𝑏
- the bounding box stretches along the 𝑥-axis from 𝑎 to 𝑏 and along the 𝑦-axis from 0 to 𝑐
- obtain Standard Uniform random variables 𝑈 and 𝑉 from a random number generator or a table of random numbers
- define:
- 𝑋 = 𝑎 + (𝑏 − 𝑎)𝑈
- 𝑌 = 𝑐𝑉
- no we can infer:
- 𝑋 has 𝑈𝑛𝑖𝑓𝑜𝑟𝑚(𝑎, 𝑏) distribution
- 𝑌 has 𝑈𝑛𝑖𝑓𝑜𝑟𝑚(0, 𝑐) distribution
- point (𝑋,𝑌) is Uniformly distributed in the bounding box
- if 𝑌 > 𝑓(𝑋), reject the point and return to step 3. If 𝑌 ≤ 𝑓(𝑋), then 𝑋 is the desired random variable having the density 𝑓(𝑥)
|
A pair (𝑋,𝑌) should have a Uniform distribution in the region under the graph of 𝑓(𝑥)
|
A histogram of Beta random variables generated by rejection method
|
/acceptance-rejection-method/sampling/rejection-method.png)
/acceptance-rejection-method/sampling/rejection-method-1.png)
/acceptance-rejection-method/sampling/rejection-method-2.png)