0% found this document useful (0 votes)
8 views

Acceptance_and_Rejection_Random_number_generation

Uploaded by

khushiyadav88400
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Acceptance_and_Rejection_Random_number_generation

Uploaded by

khushiyadav88400
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Acceptance and Rejection Random number

generation
Umesh Pathak
December 2024

1 Random number Generation


1.1 Acceptance and Rejection Method
The Acceptance-Rejection Method (also known as the **Rejection Sam-
pling Method**) is a technique used to generate random numbers from a
target probability distribution. It works by generating random numbers
from a simpler distribution (known as the **proposal distribution**) and
”accepting” or ”rejecting” them based on how well they match the target
distribution.

This method is especially useful when the inverse CDF method is difficult
to apply or when sampling from complex distributions.


Key Idea:
Proposal Distribution (q(x)): A distribution from which it’s easy to gen-
erate random numbers.
Target Distribution (p(x)): The distribution you want to sample from.
Scaling Constant (M): A constant that ensures the proposal distribution
is always greater than or equal to the target distribution. It must satisfy
these conditions:

M · q(x) ≥ p(x) for all x.


1
**Steps in the Acceptance-Rejection Method**

1. **Choose a Proposal Distribution (q(x))**:


- Select a distribution q(x) that is easy to sample from and is similar to the
target distribution p(x).

2. **Determine the Scaling Constant (M)**:


- Find the constant M such that:

M · q(x) ≥ p(x) for all x.


This ensures that the proposal distribution can ”cover” the target distribu-
tion.

3. **Generate a Random Number**:


- Generate a random number x∗ from the proposal distribution q(x).
- Generate a uniform random number u from U (0, 1).

4. **Acceptance or Rejection**:
- Accept the proposed number x∗ with probability:

p(x∗ )
Accept if u ≤ .
M · q(x∗ )
- If accepted, return x∗ .
- If rejected, repeat the process until you accept a value.


**Example: Generating Random Numbers from a Normal Dis-
tribution**
Suppose we want to generate random numbers from a **Normal distri-
bution** with mean µ = 0 and standard deviation σ = 1, but we only know
how to sample from a **Uniform distribution**.
**Step 1: Choose a Proposal Distribution** - We can use a **Uniform dis-
tribution** as the proposal distribution q(x), which is easy to sample from.
**Step 2: Determine the Scaling Constant (M)** - The Normal distribution
has a bell-shaped curve, and the Uniform distribution is rectangular. To
ensure that the scaling constant M satisfies M · q(x) ≥ p(x), we can use M
that is sufficiently large to cover the Normal distribution’s peak.

2
- Typically, the constant M is chosen based on the maximum value of the
target distribution p(x).

**Step 3: Generate Random Numbers** - Sample a number x∗ from the


**Uniform distribution** q(x). - Sample a number u from the **Uniform
distribution** U (0, 1).

**Step 4: Acceptance or Rejection**


- Accept x∗ if:

p(x∗ )
u≤
M · q(x∗ )
- If x∗ is accepted, return the value; otherwise, repeat the process.

**Example: Uniform Proposal Distribution to Normal Target**


Let’s use the following distributions:
- **Target distribution (Normal)**: p(x) — normal distribution N (0, 1).
- **Proposal distribution (Uniform)**: q(x) — uniform distribution on the
interval [−3, 3].

1. **Target Distribution**: The normal distribution p(x) is given by:


1 x2
p(x) = √ e− 2

2. **Proposal Distribution**: The uniform distribution q(x) is:
1
q(x) = for −3≤x≤3
6

This is uniform over the interval [−3, 3].

3. **Scaling Constant (M)**:


To ensure M · q(x) ≥ p(x), we determine M . In this case, we choose M based
on the normal distribution’s peak value at x = 0, where p(x) = √12π ≈ 0.3989.
Thus, we can set M ≈ 1.2 to ensure the inequality holds.

3
4. **Generate Random Numbers**:
- Sample x∗ from the uniform distribution q(x) on the interval [−3, 3].
- Generate a uniform random number u from U (0, 1). - Accept x∗ if u ≤
p(x∗ )
M ·q(x∗ )
, otherwise reject it.


**Advantages of the Acceptance-Rejection Method**
1. **Flexibility**:
- Works for any target distribution with a known probability density function
(PDF), as long as a proposal distribution can be chosen.

2. **Simplicity**:
- The method is conceptually simple and requires no complex mathematical
computations beyond the sampling process.

**Limitations**
1. **Efficiency**: - The method can be inefficient if the proposal distribu-
tion q(x) is not close enough to the target distribution p(x), as many random
numbers might be rejected.
2. **Choice of Proposal Distribution**:
- Selecting a good proposal distribution is critical to the performance of this
method. A poor choice can result in many rejections.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy