Coursework 2
贝叶斯数据分析代写 Write a Gibbs sampler in Matlab to implement the Lasso prior as described in Appendix 2.2 of Kyung, Gilly, Ghosh, and Casella (2010).
- Due: March Submit in Moodle. Credit: 20% of final grade
- Submit (1) a zipped folder containing all code and (2) a table of simulation results in a word or pdf document.
In this assignment, you will implement group Lasso prior. 贝叶斯数据分析代写
In many applications, there are natural ways to divide covariates into groups a priori (e.g., indicator variables) so that the same level of shrinkage is applied within a given group. Researchers might also want to utilize such prior knowledge to improve efficiency of estimation. The group Lasso prior for K such groups is defined as follows:
where is a p-dimensional vector of slopes with βGk being a mk-dimensional vector such that X is a n × p matrix of covariates. Notice that the shrinkage parameter τ2k is group-specific.
For details of the prior and conditional posterior distributions, see Kyung, Gilly, Ghosh, and Casella (2010) Penalized Regression, Standard Errors, and Bayesian Lassos, Bayesian Analysis.
Follow the instruction below for your assignment: 贝叶斯数据分析代写
- Write a Gibbs sampler in Matlab to implement the Lasso prior as described in Appendix 2.2 of Kyung, Gilly, Ghosh, and Casella (2010).
- Write a Gibbs sampler in Matlab to implement the group Lasso prior as described in Ap-pendix 2.3 of the paper.
- Write a code that generates data according to Examples 4 and 5 of Section 5.1 of the paper. 贝叶斯数据分析代写
- Conduct a Monte Carlo experiment by generating 10 data sets based on the code that you wrote in 3 and by estimating the model using the code from 1 and 2. Use same values of the hyperparameters, r and δ, between the Lasso and the group Lasso priors. For the Gibbs sampler, discard the first 100 iterations as burn-in and keep the next 1,000 iterations for estimation. Compute the mean squared errors (MSEs) of β, using the posterior mean as the point estimate. Make sure to set a seed rng() at the beginning of your main Matlab script that implements the experiment so that I can later replicate your results.
- Produce a table of results summarizing the average MSEs as well as the average estimation times of the two priors under the two data-generating-processes. Briefly discuss your findings.
更多代写:Philosophy哲学代考 gre代考多少钱 北美law作业代写 systematic review怎么写 申请论文写作提示 论文写不出来有什么好的办法