Probability

Rejection Sampling

A student keeps randomly placed dots inside a circular outline.

Rejection Sampling definition

Rejection sampling generates draws from a target distribution by accepting some proposals and discarding others.

In Spanish
muestreo por rechazo
Topic
Probability simulation and sampling

Rejection Sampling in a picture

Rejection Sampling diagramUniform points proposed in a square can be kept only when they fall inside its inscribed disk.Generate a candidateDraw uniformly in the squareTest the candidateKeep points inside the diskRepeat until enough are keptThe accepted points are uniform on the disk
Uniform points proposed in a square can be kept only when they fall inside its inscribed disk.

How it works

For a target density f and proposal density g, choose M so f(x) ≤ M g(x) everywhere. Draw Y from g, then accept it with probability f(Y)/(M g(Y)). The accepted draws have density f. The proposal must cover every place where the target has positive density.

Worked examples

Sample uniformly in a unit disk using the square [−1, 1]².

Propose x and y uniformly and independently from [−1, 1]. Keep the point if x² + y² ≤ 1.

What fraction is accepted on average in that example?

The area ratio is π/4.

If f and g are normalized and M = 2, what is the expected acceptance rate?

1/M = 1/2.

Common mistake

Ensure the proposal covers the target and the acceptance probability never exceeds one.

Quick check

A proposed point is uniformly drawn in a square for an inscribed-disk sampler. When do you keep it?

Can a rejected point appear in the sample?

Show answer

No.

What happens to acceptance when M grows?

Show answer

The average acceptance rate 1/M decreases.

Sources

Flashcard

Rejection Sampling

Reveal the definition

Rejection sampling generates draws from a target distribution by accepting some proposals and discarding others.

Effortless Math. “Rejection Sampling.” Math Dictionary.