Answered step by step
Verified Expert Solution
Link Copied!

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

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

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

Recommended Textbook for

Contemporary Business Mathematics With Canadian Applications

Authors: Ali R. Hassanlou, S. A. Hummelbrunner, Kelly Halliday

12th Edition

0135285011, 978-0135285015

More Books

Students also viewed these Mathematics questions