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.