Docsity

Assignment 5 for Bayesian Inference and Analysis | ST 740, Assignments of Statistics

Toggle sidebar
bg1
ST740 – Assignment 5 – Due 10/31
1. Bayesian Lasso: Analyze R’s crime data:
>library(MASS)
>data(UScrime)
>?UScrime
>y<−UScrime[,16]
>x<−as.matrix(UScrime[,-16])
Analyze these data using the model described in:
Park T, Casella G (2008). The Bayesian Lasso. JASA,103, 681–686.
•Write and turn in commented R code to analyze the Bayesian Lasso using the
augmented model in (5) of Park and Cassella.
•Fit this model for several values of λand with λhaving a gamma prior as in
Section 3.2. Compare the results. Are the data informative about λ?
•In which situations would you use the Bayesian Lasso rather than the usual
Bayesian linear regression model with improper priors for the regression coeffi-
cients? Justify your choice.
•What is the advantage of the Bayesian Lasso over frequentist penalized regressions
such as the Lasso?
2. Robust linear regression: A robust linear regression model is yi∼N(x0
iβ, τ cπi),
where β∼N(0,0.01Ip), τcπiis a precision, πi∼Bern(p), τ∼Gamma(0.01,0.01), and
p, c ∈[0,1].
•In this model, πican be interpreted as an indicator that observation iis an
outlier. Give an expression for the full conditional probability that observation i
is an outlier.
•Make a plot (on the same graph) of the full condition probability that πi= 1 as
a function of cfor all combinations of p∈ {0.01,0.1}and zi=√τ(yi−x0
iβ)∈
{1,3,5}. Based on this plot, select reasonable values for pand c. Justify your
choice.
•Fit this model in WinBUGS using the “Stacks” data in “Examples Volume I”.
Turn in your commented code. Fit the model three times, first ignoring outliers
by setting c= 1, second with the values of cand pyou identified in the previous
question, and third with priors c∼Uniform(0,0.5) and p∼Uniform(0,0.2).
•Compare the results of the three models. Is there any evidence of outliers? Are
the regression coefficients affected by outliers? Are the data informative about c
and p?
1

Partial preview of the text

Download Assignment 5 for Bayesian Inference and Analysis | ST 740 and more Assignments Statistics in PDF only on Docsity!

ST740 – Assignment 5 – Due 10/

  1. Bayesian Lasso: Analyze R’s crime data:

library(MASS) data(UScrime) ?UScrime y< −UScrime[,16] x< −as.matrix(UScrime[,-16])

Analyze these data using the model described in:

Park T, Casella G (2008). The Bayesian Lasso. JASA, 103 , 681–686.

  • Write and turn in commented R code to analyze the Bayesian Lasso using the augmented model in (5) of Park and Cassella.
  • Fit this model for several values of λ and with λ having a gamma prior as in Section 3.2. Compare the results. Are the data informative about λ?
  • In which situations would you use the Bayesian Lasso rather than the usual Bayesian linear regression model with improper priors for the regression coeffi- cients? Justify your choice.
  • What is the advantage of the Bayesian Lasso over frequentist penalized regressions such as the Lasso?
  1. Robust linear regression: A robust linear regression model is yi ∼ N (x′ iβ, τ cπi^ ), where β ∼ N (0, 0. 01 Ip), τ cπi^ is a precision, πi ∼ Bern(p), τ ∼ Gamma(0.01,0.01), and p, c ∈ [0, 1].
  • In this model, πi can be interpreted as an indicator that observation i is an outlier. Give an expression for the full conditional probability that observation i is an outlier.
  • Make a plot (on the same graph) of the full condition probability that πi = 1 as a function of c for all combinations of p ∈ { 0. 01 , 0. 1 } and zi =

τ (yi − x′ iβ) ∈ { 1 , 3 , 5 }. Based on this plot, select reasonable values for p and c. Justify your choice.

  • Fit this model in WinBUGS using the “Stacks” data in “Examples Volume I”. Turn in your commented code. Fit the model three times, first ignoring outliers by setting c = 1, second with the values of c and p you identified in the previous question, and third with priors c ∼ Uniform(0,0.5) and p ∼ Uniform(0,0.2).
  • Compare the results of the three models. Is there any evidence of outliers? Are the regression coefficients affected by outliers? Are the data informative about c and p?