Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. (30 points) Suppose that X and Y have joint p.m.f. (a) Generate n=104 random variables Y1,,Yn using a rejection sampling. You can use a
2. (30 points) Suppose that X and Y have joint p.m.f. (a) Generate n=104 random variables Y1,,Yn using a rejection sampling. You can use a Bernoulli distribution with parameter 1/2 as a candidate (proposal) distribution. Provide the (empirical) marginal p.m.f. of Y based on your random numbers and compare it with the (exact) marginal p.m.f. of Y. (b) Generate n=104 pairs of random variables {(Xi,Yi)}i=1n using a method of composition with P(X=xY=y) and P(Y=y). Provide your estimates of P(X=x),x=0,1,2 (the empirical marginal p.m.f. of X based on your random numbers) and compare them with the exact values of P(X=x) (the exact marginal p.m.f. of X ). (c) Generate n=104 pairs of random variables {(Xi,Yi)}i=1n using a Gibbs sampler. Provide your estimates of P(X=x,Y=y),P(X=x), and P(Y=y),x=0,1,2 and y=0,1 and compare them with the exact values. 2. (30 points) Suppose that X and Y have joint p.m.f. (a) Generate n=104 random variables Y1,,Yn using a rejection sampling. You can use a Bernoulli distribution with parameter 1/2 as a candidate (proposal) distribution. Provide the (empirical) marginal p.m.f. of Y based on your random numbers and compare it with the (exact) marginal p.m.f. of Y. (b) Generate n=104 pairs of random variables {(Xi,Yi)}i=1n using a method of composition with P(X=xY=y) and P(Y=y). Provide your estimates of P(X=x),x=0,1,2 (the empirical marginal p.m.f. of X based on your random numbers) and compare them with the exact values of P(X=x) (the exact marginal p.m.f. of X ). (c) Generate n=104 pairs of random variables {(Xi,Yi)}i=1n using a Gibbs sampler. Provide your estimates of P(X=x,Y=y),P(X=x), and P(Y=y),x=0,1,2 and y=0,1 and compare them with the exact values
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