BIS 567A- Assignment 4- Due 10/29/2020 1. Suppose we assume Yi|λi ind∼ Poisson (λi), i = 1, . . . , n with ln (λi) = β0 + β1xi + φi and φi|σ2 iid∼ N ( 0, σ2 ) . We specify the following prior distributions: • β0 ∼ N ( 0, 1002 ) ; • β1 ∼ N ( 0, 1002 ) ; • σ2 ∼ Inverse Gamma (0.01, 0.01). This represents a Poisson regression model that accounts for potential overdispersion that is often observed in actual count data (greater variability in the data than expected). We will fit this model in two different ways (both Bayesian) and compare the performance of each algorithm. Our interest is in estimating β0, β1, and σ 2. The R file “HW4.RData” contains n = 1, 000 observed data points (y) along with the covariate of interest (x). Please do not use a Bayesian software package for this assignment (e.g., JAGS, Proc MCMC). (a) Create an MCMC sampling algorithm to sample from the joint posterior distribution f ( ln (λ1) , . . . , ln (λn) , β0, β1, σ 2|Y ). Provide full details on the full conditional distribu- tions, commented code for fitting your MCMC algorithm, and a table that summarizes your posterior inference for each of the parameters (posterior mean, posterior standard deviation, 95% credible interval). Do not include inference for ln (λi) in the table. (b) Create an MCMC sampling algorithm to sample from the joint posterior distribution f ( φ1, . . . , φn, β0, β1, σ 2|Y ). Provide full details on the full conditional distributions, commented code for fitting your MCMC algorithm, and a table that summarizes your posterior inference for each of the parameters (posterior mean, posterior standard devi- ation, 95% credible interval). Do not include inference for φi in the table. (c) For each algorithm, provide some evidence to suggest that the algorithm has converged and that you have collected enough posterior samples to make accurate inference. (d) How do the results in parts (a) and (b) compare? Based on your experience, which algorithm do you prefer and why? 1
欢迎咨询51作业君