Please describe all your work in clear terms, before implementing R code. Each question should include a description of your approach with clear indication of where I can find the associated source code. Your code should be attached to your assignment or uploaded online to a repository I can freely access.
Consider the implementation of a posterior simulation algorithm for Bayesian adaptive LASSO. More precisely consider the following model:
Y | β,σ2 ∼ N(Xβ,σ2In) Let β = (β[1],…,βp)0, the model is completed with priors:
βj | τj2 ∼ N(0,τj2); j = 1,…,p
h = 1/σ2 ∼ Gamma(0.1,rate = 10)
- Consider p = 1. Simulate 5,000 Monte Carlo samples from the conditional prior β | τ2 = 1 and obtain a plot of the density using the R function density.
- Consider p = 1. Simulate 5,000 Monte Carlo samples from the marginal prior β, considering λ2 = 2, so that E(τ2 | λ) = 1. Obtain a plot of the density as in
- Consider p = 1. Add a hyper prior on γ = 1/λ ∼ Gamma(a,rate = b). Assess how the marginal prior of β changes for a = 1 and values of b ≥ 1.
- Considering the hyper prior in c., describe a Markov Chain Monte Carlo algorithm to sample from the posterior distribution of β and σ2.
- Implement such algorithm in R and compare your results with estimates obtained using glmnet(). In particular, you should test your results on the diabetes data available from lars, (use the matrix of predictors x).
- For the diabetes data, fix λ and produce a regularization path for adaptive Bayesian Lasso obtained on a grid of values for the tuning parameter λ. Describe your approach and compare your result with the path obtained using glmnet().
- Free λ and carry out a sensitivity analysis assessing the behavior of the posterior distribution of β and σ2, as hyper parameters a and b are changed. Explain clearly the rationale you use to assess sensitivity and provide recommendations for the analysis of the diabetes data.
- [Extra credit] Using rcpp attempt and quantify acceleration of your code in (e.).
Reviews
There are no reviews yet.