Question: Consider the trivariate random vector ( Y 1 , Y 2 , Y 3 ) with the density f ( y 1 , y 2

Consider the trivariate random vector (Y1,Y2,Y3) with the density
f(y1,y2,y3)=cexp{-(y1+y2+y3+y1y2+2y2y3+4y1y3)};,y10,y20,y30.
where c>0 is the normalizing constant so that the density integrates to 1.
Problem 3(a)[3 points]
Obtain the distribution of conditional densities of Yi|Yj,Yk for all possible distinct values of ijk. Show
your work.
Problem 3(b)[5 points]
Implement the Gibbs sampling algorithm to generate values from the joint density of (Y1,Y2,Y3). Specifically,
run a chain with 10,000 points, and burn the first 1000 initially generated values. Then, print the approximation
for the mean and covariance matrix of (Y1,Y2,Y3) based on your generated sample. Also, plot the histogram
of the marginals distribution of Y1 only superimposed by a smoothed density curve. Set breaks =50 for the
histogram, and use the density() function for the density curve to be superimposed.
Problem 3(c)[ points]
Apply the Metropolis-Hastings algorithm to generate values from (Y1,Y2,Y3) using a chain with 50,000 points.
Set the proposal density to the trivariate normal density with covariance matrix equal to two times the
identity matrix (i.e.,2**I). Your code should implement the following:
Use the mvrnorm() function in the package MASS to generate multivariate normal values.
Begin your simulation with seed 2024.
Start with the initial value y1=y2=y3=1.
Your code should compute the acceptance rate and print it at the end.
Burn the first 5000 points from the chain, and plot the histogram of the marginals of Y1,Y2, and Y3,
superimposed by a smoothed density curve. Set breaks =50 for the histogram, and use the density()
function for the density curve to
be superimposed.
! need rcode.
 Consider the trivariate random vector (Y1,Y2,Y3) with the density f(y1,y2,y3)=cexp{-(y1+y2+y3+y1y2+2y2y3+4y1y3)};,y10,y20,y30. where

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 Databases Questions!