Answered You can hire a professional tutor to get the answer.

QUESTION

Use R software to answer the following question. Show the R code. Use acceptance-rejection method to set up a function to generate samples from a...

Use R software to answer the following question. Show the R code.

1. Use acceptance-rejection method to set up a function to generate samples from a distribution with pdf of f2(x) with support, [0,1]. 

2. Plot the samples you created and add line of the expected distribution to the plot

3. Use Monte Carlo integration to estimate the value of the integral using calculate the mean.

4. Use Monte Carlo integral to estimate the same integral, but this time utilizing the sampler you created in Problem 2. (hint: don't sample from the uniform distribution)

5. Compare the estimated variance of the estimates generated by the Acceptance-rejection and Monte Carlo integration with 1000 replicates and generate an estimate of the 95% confidence intervals.

  • Attachment 1
  • Attachment 2
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question