Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the trivariate random vector (Y1, Y2, Ya) with the density f(31, 92, 13) = c x exp {-(91 + 32 + 93 + 3192
Consider the trivariate random vector (Y1, Y2, Ya) with the density f(31, 92, 13) = c x exp {-(91 + 32 + 93 + 3192 + 29293 + 4y193)} ; 31 2 0,y2 2 0,y3 2 0. 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|Y,, Y, for all possible distinct values ofi # j # k. 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) [5 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*/). 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 = 12 = 13 = 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
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