Starting from:

$29.99

STA360-602 Homework 6 Solution


General instructions for homeworks: Please follow the uploading file instructions according to the syllabus. You will give the commands to answer each question in its own code block, which will also produce plots that will be automatically embedded in the output file. Each answer must be supported by written statements as well as any code used. Your code must be completely reproducible and must compile. Syllabus: (https://github.com/resteorts/modernbayes/blob/master/syllabus/syllabus-sta602-spring19.pdf)
Commenting code Code should be commented. See the Google style guide for questions regarding commenting or how to write code https://google.
github.io/styleguide/Rguide.xml. No late homework’s will be accepted.
1. Lab component. Refer to lab 6 (Gibbs sampling, Module 7, Part I). This will not be graded, but you will be expected to know this for the exam.
(a) (5 points) Write code to produce trace plots and running averageplots for the censored values for 200 iterations. Do these diagnostic plots suggest that you have run the sampler long enough? Explain.
(b) (5 points) Now run the chain for 10,000 iterations and update yourdiagnostic plots (traceplots and running average plots). Report your findings for both traceplots and the running average plots for θ and the censored values. Do these diagnostic plots suggest that you have run the sampler long enough? Explain.
(c) (5 points) Give plots of the estimated density of θ | ··· and z9 | ···. Be sure to give brief explanations of your results and findings. (Present plots for 10,000 iterations).
1
(d) (5 points) Finally, let’s suppose that r = 10,a = 1,b = 100. Do the posterior densities in part (c) change for θ | ··· and z9 | ···? Do the associated posterior densities change when r = 10,a = 100,b = 1? Please provide plots and an explanation to back up your answer. (Use 10,000 iterations for the Gibbs sampler).
2

More products