Question: 8.5 Let us consider an example of the importance sampling variant of the acceptance rejection method. Consider again the problem of generating normally distributed pseudorandom

8.5 Let us consider an example of the importance sampling variant of the acceptance rejection method. Consider again the problem of generating normally distributed pseudorandom numbers for x > 0. Start with a function g(x) = a1e−a2 x . This is not to be a normalized density function, but a function always larger than the normal density function for x > 0.

(a) As the constants a1, a2 are decreased, eventually the exponential will touch the normal distribution at first at a single point. Suppose we have that condition. Find the relation this imposes between a1 and a2.

(b) Given the above relation, we can still change the exponential to have minimum area. Find the value of a1 and a2 to do this. (Remember to select the solution corresponding to the exponential touching the outer edge of the normal distribution, i.e., having more area than the normal distribution not less.)

(c) By taking the ratio of areas of the exponential and normal functions for x > 0, find the efficiency of this method, i.e., the fraction of the time the number is accepted.

(d) Program the procedure for doing this and generate 200 normally distributed numbers. Plot the distribution of the exponential and the normally distributed numbers. The CPU time per normal pseudorandom number depends on the number of uniform pseudorandom numbers needed (here two) and the number of special functions used (logs, exponentials, sines, etc.). Try to do this with only two special functions per normal number. Compare the efficiency of your program with the efficiency calculated in (c). Note: When picking the first (exponentially distributed) pseudorandom number, you must use a normalized exponential density function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Statistics Econometrics Questions!