Using the accept-reject algorithm, generate observations from the binomial distribution as target distribution and the uniform distribution
Question:
Using the accept-reject algorithm, generate observations from the binomial distribution as target distribution and the uniform distribution as proposal distribution. Reverse the roles and carry out the simulation and note the differences, if any.
Data is accept-reject algorithm
Simulation from an Arbitrary Distribution using Accept-Reject Algorithm. Suppose that X is a discrete RV which assumes values 1 to 10 with respective probabilities 0.05, 0.17, 0.02, 0.14, 0.11, 0.06, 0.05, 0.04, 0.17, and 0.19. Naturally, simulation from a discrete uniform distribution with N = 10 can serve here as the proposal density. It is immediately clear in this problem that c = 0.19∕0.1 = 1.9. Thus, an accept-reject sampling technique here first requires us to generate a random number between 1 and 10, say i. Next, a number in the unit interval is generated and if this number is less than pi∕(0.1 × 1.2), i will be selected as a random observation for X. A small program is given next, which implements the accept-reject technique for the problem in hand.
Step by Step Answer:
A Course In Statistics With R
ISBN: 9781119152729
1st Edition
Authors: Prabhanjan N. Tattar, Suresh Ramaiah, B. G. Manjunath