Question: Agenda: Accept-Reject algorithm 1. Write a function to simulate an N(0, 1) random variates using the AcceptReject algorithm with a Cauchy candidate. 2. Simulate 1000

Agenda: Accept-Reject algorithm 1. Write a function to simulate an N(0, 1) random variates using the AcceptReject algorithm with a Cauchy candidate. 2. Simulate 1000 N (0, 1) random variates using your function to estimate E[Y3 log(1 + |Y|)] and PT(Y e [1, 2]). Be sure to include a Monte Carlo standard error with your estimates. 3. What was the acceptance rate of the Accept-Reject algorithm? Is this close to the theoretical acceptance rate? 4. Write a function that continues simulation until the sample size is large enough so that your Monte Carlo error is less than 6 = 0.001 for estimating a general statistic stat (which will be a function). You function should also return the observed acceptance rate of the AcceptReject algorithm and a Monte Carlo standard error. 5. Use your function to estimate E[Y3 log(1 + |Y|)] and Pr(Y 6 [1,2]) with e = 0.001. Report your estimates along with condence intervals based on the Monte Carlo standard error. What was the acceptance rate
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
