Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(6 points) Consider the function g(:L') = cos2(12;r:) X |:r:3 + 6:3 2| > (6 points) Consider the function = COS2(12X) > < -k 6T
(6 points) Consider the function g(:L') = cos2(12;r:) X |:r:3 + 6:3 2| >
(6 points) Consider the function = COS2(12X) > < -k 6T 21 > < In this problem, we use rejection sampling to generate random variables with pdf f@) = cg@). (a) (2 points) Plot g over its domain. What is a uniform proposal distribution q that covers the support of f? What is the largest possible constant M such Ithat the scaled target distribution p@) = Mg@) satisfies p@) q@) for all x? (b) (2 points) Suppose you run rejection sampling with target p and proposal q from part (a) until you generate n samples and your sampler runs a total of N > n times, including n acceptances and N n rejections. Explain how you can use n, N and M to estimate c. Hint: the ratio of acceptances n to total runs N is an approximation of the ratio between the area under the curve p@) and the area under q@). Hint: remember what happens if you integrate a pdf over its entire support. (c) (2 points) Use rejection sampling to generate a sample of size 103 from p@). Since f@) is a pdf and it's proportional to p@), we can display its estimate easily: plot a normalized histogram of your sample, and overlay a smooth kernel density estimate, that will provide more information on the shape of the estimated distribution. Repeat the previous steps increasing the number of samples to 106.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started