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**,*^{2}*I _{n}*) Let

*= (*

^{[1]}

*,,*)

_{p}^{0}, the model is completed with priors:

* _{j }*|

_{j}^{2 }

*N*(0

*,*

_{j}^{2});

*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*/**Gamma*(*a,rate*=*b*). Assess how the marginal prior of*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^{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
- Free
^{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.