Acceptance-Rejection method The acceptance-rejection method is - - PowerPoint PPT Presentation

acceptance rejection method
SMART_READER_LITE
LIVE PREVIEW

Acceptance-Rejection method The acceptance-rejection method is - - PowerPoint PPT Presentation

Acceptance-Rejection Method Acceptance-Rejection method The acceptance-rejection method is usually used when the inverse transform method is not directly applicable or is inefficient. To simulate a sample x of X with pdf f X . Aim: 1 Consider a


slide-1
SLIDE 1

Acceptance-Rejection Method

Acceptance-Rejection method

The acceptance-rejection method is usually used when the inverse transform method is not directly applicable or is inefficient. Aim: To simulate a sample x of X with pdf fX.

1 Consider a random variable Y with pdf fY whose sample can be

simulated.

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 38 / 46

slide-2
SLIDE 2

Acceptance-Rejection Method

Acceptance-Rejection method

The acceptance-rejection method is usually used when the inverse transform method is not directly applicable or is inefficient. Aim: To simulate a sample x of X with pdf fX.

1 Consider a random variable Y with pdf fY whose sample can be

simulated.

2 Choose a constant c such that

fX(t) ≤ cfY (t), ∀t. The random variable Y is said to majorize X.

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 38 / 46

slide-3
SLIDE 3

Acceptance-Rejection Method

Acceptance-Rejection method

The acceptance-rejection method is usually used when the inverse transform method is not directly applicable or is inefficient. Aim: To simulate a sample x of X with pdf fX.

1 Consider a random variable Y with pdf fY whose sample can be

simulated.

2 Choose a constant c such that

fX(t) ≤ cfY (t), ∀t. The random variable Y is said to majorize X.

1

Suppose X and Y are discrete random variables with pmfs pi = Pr{X = i}, qi = Pr{Y = i}. Then c can be chosen as follows: c = max pj qj : j ≥ 1

  • R.B. Lenin

(rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 38 / 46

slide-4
SLIDE 4

Acceptance-Rejection Method

Acceptance-Rejection method

The acceptance-rejection method is usually used when the inverse transform method is not directly applicable or is inefficient. Aim: To simulate a sample x of X with pdf fX.

1 Consider a random variable Y with pdf fY whose sample can be

simulated.

2 Choose a constant c such that

fX(t) ≤ cfY (t), ∀t. The random variable Y is said to majorize X.

1

Suppose X and Y are discrete random variables with pmfs pi = Pr{X = i}, qi = Pr{Y = i}. Then c can be chosen as follows: c = max pj qj : j ≥ 1

  • 2

Suppose X and Y are continuous random variables with PDFs fX and fY . Then c can be chosen as c = max fX(x) fY (x) : ∀x

  • .

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 38 / 46

slide-5
SLIDE 5

Acceptance-Rejection Method

Acceptance-Rejection method · · ·

Figure: Acceptance-Rejection method

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 39 / 46

slide-6
SLIDE 6

Acceptance-Rejection Method

Acceptance-Rejection method · · ·

The algorithm for this method is as follows:

1 Generate a random variate y1 from the distribution of Y . R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 40 / 46

slide-7
SLIDE 7

Acceptance-Rejection Method

Acceptance-Rejection method · · ·

The algorithm for this method is as follows:

1 Generate a random variate y1 from the distribution of Y . 2 Generate a uniform random number variate y2 between 0 and cfY (y1)

as follows:

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 40 / 46

slide-8
SLIDE 8

Acceptance-Rejection Method

Acceptance-Rejection method · · ·

The algorithm for this method is as follows:

1 Generate a random variate y1 from the distribution of Y . 2 Generate a uniform random number variate y2 between 0 and cfY (y1)

as follows:

1

Generate a uniform random number r.

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 40 / 46

slide-9
SLIDE 9

Acceptance-Rejection Method

Acceptance-Rejection method · · ·

The algorithm for this method is as follows:

1 Generate a random variate y1 from the distribution of Y . 2 Generate a uniform random number variate y2 between 0 and cfY (y1)

as follows:

1

Generate a uniform random number r.

2

Compute y2 = 0 + (cfY (y1) − 0)r = cfY (y1)r.

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 40 / 46

slide-10
SLIDE 10

Acceptance-Rejection Method

Acceptance-Rejection method · · ·

The algorithm for this method is as follows:

1 Generate a random variate y1 from the distribution of Y . 2 Generate a uniform random number variate y2 between 0 and cfY (y1)

as follows:

1

Generate a uniform random number r.

2

Compute y2 = 0 + (cfY (y1) − 0)r = cfY (y1)r.

3 If y2 < fX(y1), then x = y1, else go to Step 1. R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 40 / 46

slide-11
SLIDE 11

Acceptance-Rejection Method

Acceptance-Rejection method · · ·

The above algorithm is equivalent to the following: steps:

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 41 / 46

slide-12
SLIDE 12

Acceptance-Rejection Method

Acceptance-Rejection method · · ·

The above algorithm is equivalent to the following: steps:

1 Generate a random variate y1 from the distribution of Y . 2 Generate a uniform random number r in [0, 1]. R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 41 / 46

slide-13
SLIDE 13

Acceptance-Rejection Method

Acceptance-Rejection method · · ·

The above algorithm is equivalent to the following: steps:

1 Generate a random variate y1 from the distribution of Y . 2 Generate a uniform random number r in [0, 1]. 3 If r ≤ fX(y1)

cfY (y1), then x = y1, else go back to step 1.

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 41 / 46

slide-14
SLIDE 14

Acceptance-Rejection Method Gamma random variate

Gamma random variate for 1 < k < 5

The variate is generated by the acceptance-rejection method, where the majorizing distribution is Erlang with parameter λ and k, where k = ⌊k⌋.

Figure: Gamma random variate for k = 2.5 and λ = 1

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 42 / 46

slide-15
SLIDE 15

Acceptance-Rejection Method Gamma random variate

Gamma random variate for k < 1

Let X be a gamma random variable with parameters λ, k.

1 Generate two random numbers r1 and r2. R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 43 / 46

slide-16
SLIDE 16

Acceptance-Rejection Method Gamma random variate

Gamma random variate for k < 1

Let X be a gamma random variable with parameters λ, k.

1 Generate two random numbers r1 and r2. 2 Compute x1 = r 1 k

1 , x2 = r

1 1−k

2

.

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 43 / 46

slide-17
SLIDE 17

Acceptance-Rejection Method Gamma random variate

Gamma random variate for k < 1

Let X be a gamma random variable with parameters λ, k.

1 Generate two random numbers r1 and r2. 2 Compute x1 = r 1 k

1 , x2 = r

1 1−k

2

.

3 Generate an exponential random variate with parameter λ, say, y. R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 43 / 46

slide-18
SLIDE 18

Acceptance-Rejection Method Gamma random variate

Gamma random variate for k < 1

Let X be a gamma random variable with parameters λ, k.

1 Generate two random numbers r1 and r2. 2 Compute x1 = r 1 k

1 , x2 = r

1 1−k

2

.

3 Generate an exponential random variate with parameter λ, say, y. 4 Then the sample x of X is x =

yx1 x1 + x2 .

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 43 / 46

slide-19
SLIDE 19

Acceptance-Rejection Method Gamma random variate

Gamma random variate for k > 5

Let a = ⌊k⌋. Then choose the sample x of X randomly

1 from Erlang with parameters λ, a with probability 1 − (k − a). R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 44 / 46

slide-20
SLIDE 20

Acceptance-Rejection Method Gamma random variate

Gamma random variate for k > 5

Let a = ⌊k⌋. Then choose the sample x of X randomly

1 from Erlang with parameters λ, a with probability 1 − (k − a). 2 from Erlang with parameters λ, a + 1 with probability k − a. R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 44 / 46

slide-21
SLIDE 21

Acceptance-Rejection Method Normal random variate

Normal random variate - Polar form (Box-Muller form)

1 Generate two uniform random numbers r1 and r2 in [0, 1].

Define vi = 2ri − 1, i = 1, 2 and let w = v2

1 + v2 2 .

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 45 / 46

slide-22
SLIDE 22

Acceptance-Rejection Method Normal random variate

Normal random variate - Polar form (Box-Muller form)

1 Generate two uniform random numbers r1 and r2 in [0, 1].

Define vi = 2ri − 1, i = 1, 2 and let w = v2

1 + v2 2 .

2 If w = 0 or w > 1, go back to step 1. R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 45 / 46

slide-23
SLIDE 23

Acceptance-Rejection Method Normal random variate

Normal random variate - Polar form (Box-Muller form)

1 Generate two uniform random numbers r1 and r2 in [0, 1].

Define vi = 2ri − 1, i = 1, 2 and let w = v2

1 + v2 2 .

2 If w = 0 or w > 1, go back to step 1. 3 Let y =

  • −2 log w

w , x1 = v1y and x2 = v2y. Then x1 and x2 are IID N(0, 1) random variates.

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 45 / 46

slide-24
SLIDE 24

Acceptance-Rejection Method Normal random variate

Normal random variate - Polar form (Box-Muller form)

1 Generate two uniform random numbers r1 and r2 in [0, 1].

Define vi = 2ri − 1, i = 1, 2 and let w = v2

1 + v2 2 .

2 If w = 0 or w > 1, go back to step 1. 3 Let y =

  • −2 log w

w , x1 = v1y and x2 = v2y. Then x1 and x2 are IID N(0, 1) random variates. Refer Simulation by Sheldon M. Ross.

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 45 / 46

slide-25
SLIDE 25

Acceptance-Rejection Method Log-normal random variate

Log-normal random variate

1 Generate a random variate y according to N(µ, σ2). R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 46 / 46

slide-26
SLIDE 26

Acceptance-Rejection Method Log-normal random variate

Log-normal random variate

1 Generate a random variate y according to N(µ, σ2). 2 A log-normal random variate x is then given by

x = ey.

R.B. Lenin (rblenin@daiict.ac.in) () Random Variate Generation Autumn 2007 46 / 46