STAT 638 (Fall 2026), Lecture 24
Overview
Samiran Sinha explains Bayesian variable selection with spike-and-slab priors, then introduces MCMC methods for posterior inference when standard conditional distributions are difficult to sample from. A simulation with 100 observations, 50 predictors, and 5 true effects illustrates inclusion probabilities, while a logistic-regression example develops Metropolis-Hastings sampling and its connection to Gibbs sampling.
Key takeaways
- A spike-and-slab prior separates near-zero coefficients from potentially nonzero effects, letting posterior inclusion probabilities quantify support for each predictor.
- In the N=100, P=50 simulation with five true effects, the method gave its strongest inclusion support to three of the five important features, illustrating that posterior selection can miss real effects.
- Bayesian variable-selection methods should be assessed across repeated datasets using false-positive and false-negative behavior, since reducing one type of error can increase the other.
- Metropolis-Hastings can sample from a posterior known only up to a proportionality constant, because the unknown normalizing constant cancels in the acceptance ratio.
- A symmetric random-walk proposal, such as the normal proposal with standard deviation 0.1 in the logistic example, cancels proposal-density terms and reduces acceptance calculations to target-density ratios.
- Gibbs sampling is the direct-draw special case of single-component Metropolis-Hastings: proposing from the exact full conditional makes every proposal acceptable.
Chapters
- For linear regression, marginal likelihoods can compare models analytically, but evaluating many models becomes costly as the predictor count grows.
- MCMC can explore models according to their posterior probabilities and estimate variable inclusion probabilities without calculating every model's marginal likelihood.
- Bayesian Model Averaging and Bayesian Adaptive Sampling, or BAS, are introduced as approaches for identifying important predictors.
- The example has 442 diabetes patients and a one-year disease-progression outcome measured after baseline.
- The dataset has 10 baseline covariates, expanding to 64 predictors when second-order and interaction terms are added.
- When many candidate predictors may be irrelevant, variable selection aims to retain a smaller, more interpretable model.
- Each regression coefficient βk uses a two-component mixture: a narrow normal spike near zero for exclusion and a broader normal slab for inclusion.
- An indicator Zk follows a Bernoulli distribution with inclusion probability ω; ω receives a beta prior.
- The slab variance τk² and regression error variance σ² receive inverse-gamma priors, with hyperparameters specified by the analyst.
- The approach targets sparse models and is useful in settings such as genomic studies with thousands of gene-expression predictors.
- With P candidate predictors, the prior expected model size is P times the prior inclusion probability, A1/(A1+A2).
- The package defaults to A1=1 and can set A2=(P−M)/M to target expected model size M.
- The simulation generates N=100 observations with P=50 standard-normal features, but only 5 coefficients are nonzero.
- The five true effects are drawn from Uniform(−1,1), and the response adds standard-normal noise to Xβ.
- Posterior inclusion probabilities range from 0 to 1; in the simulation, features 2, 4, and 5 receive the strongest support among the 5 true predictors.
- Using 0.5 as a selection threshold, features 1 and 3 are missed, while some irrelevant features receive moderate support.
- The posterior for a coefficient can show a near-zero spike and a nonzero slab, conveying uncertainty about whether that effect is present.
- Repeated simulations can assess false positives, false negatives, and F1 score; reducing false discoveries and missed effects often requires a tradeoff.
- The logistic-regression example predicts diabetes among women using pregnancies, blood pressure, BMI, diabetes pedigree, and age.
- Each predictor is centered and scaled, so an age coefficient describes the change in log odds for a one-standard-deviation increase, not a one-year increase.
- The probability of a positive outcome is logistic(Xᵀβ), with an intercept and five regression coefficients assigned normal priors.
- MCMC is motivated by the difficulty of drawing from posterior or full conditional distributions when conjugate forms are unavailable.
- For independent binary outcomes Yi, the likelihood is the product of Bernoulli probabilities with success probabilities θi=logistic(Xiᵀβ).
- The Bayesian posterior is proportional to the logistic likelihood multiplied by the prior distributions on the regression coefficients.
- Posterior samples can produce coefficient means and credible intervals, but the full conditional distributions for β components do not have convenient standard forms.
- Metropolis-Hastings provides a general sampling strategy when direct conditional sampling is impractical.
- At iteration k, draw a candidate X* from proposal distribution Q given the current value Xk, then calculate an acceptance ratio using the target and proposal densities.
- Accept the candidate with probability min(1,R), implemented by comparing a uniform random draw with the capped ratio; otherwise retain Xk.
- Proposal choice matters: symmetric proposals cancel the Q terms in the ratio, yielding the Metropolis algorithm.
- An independent proposal does not depend on Xk; it works well when Q resembles the target density but can perform poorly when the match is weak.
- A single-component algorithm updates one coordinate at a time, targeting that coordinate's conditional distribution given the remaining parameters.
- Sampling each coordinate with Metropolis-Hastings requires only the target density up to a proportionality constant.
- Gibbs sampling is a special case: when the proposal equals the full conditional distribution, the acceptance probability is 1.
- For each parameter, use a direct Gibbs draw when possible, or a Metropolis-Hastings step when its conditional is known only up to a normalizing constant.
- The R-style logistic MCMC example runs 10,000 iterations and treats the first 2,000 as burn-in, updating every coefficient in each iteration.
- Coefficients start at zero or other modest values; very large initial values can make the logistic exponential terms overflow and stop chain movement.
- Each coefficient uses a symmetric normal random-walk proposal centered at its current value with standard deviation 0.1.
- The code compares proposed and current log-likelihood-plus-log-prior values and accepts when log(U) is below the log acceptance ratio; convergence diagnostics and results are deferred to the next lecture.
Transcript excerpt
0:01 Sinha, Samiran: Today, we'll talk about… linear regulations. Sinha, Samiran: Recreation. Sinha, Samiran: From Chapter 9. Sinha, Samiran: And, MCMC computation. Sinha, Samiran: From Chapter 10, I'm not sure whether I'll be able to start, but this is the next one. Sinha, Samiran: Now, as you have seen, I plan… Sinha, Samiran: Lot of extra thing to teach you. Sinha, Samiran: After Chapter 10, GLM. Sinha, Samiran: Gaussian process. Sinha, Samiran: Pauline Pilter, okay? So these topics are already given.
0:53 Sinha, Samiran: If you are interested, you can go ahead and study on your own. Sinha, Samiran: If I get time, then definitely I'll visit those items. Sinha, Samiran: These are extra something. Sinha, Samiran: All right, so Chapter 9, we have been talking about model selection. Sinha, Samiran: And for a linear graduation context, model selection can be done very nicely, analytically. Sinha, Samiran: If you calculate the marginal likelihood. Sinha, Samiran: Of your data, given a model that can be done. Sinha, Samiran: But even when a number of predictors is very large, that means we have to calculate marginal likelihood for many, many, many models. Therefore, we talked about MCMC computation, where Sinha, Samiran: You do not need to calculate marginal likelihood.
1:53 Sinha, Samiran: For every model, but… you can… Sinha, Samiran: MCMC computation. The MCMC chain will visit all possible models according to their underlying probabilities. Sinha, Samiran: And we can use that MCMC output To… to identify important models, Models with higher posterior probabilities. Sinha, Samiran: And we can also calculate the inclusion probabilities. Sinha, Samiran: For… for the variables, for the predictor variables. Sinha, Samiran: And so, we talked about this one, model averaging for large P using
2:46 Sinha, Samiran: give sampling, although I say it is for large P, but we are going to apply this on the same dataset with 3 predictor variables.
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Samiran Sinha.