Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. What physical and mental tasks does the worker accomplish?

Answered: 1 week ago

Question

5. Why is the job done?

Answered: 1 week ago

Question

4. How does the worker do the job?

Answered: 1 week ago