STAT 638 (Fall 2026), Lecture 31
Watch on YouTube →
Overview
Samiran Sinha demonstrates Bayesian Gibbs sampling for four-variable air-quality data with missing values, using 5,000 iterations and discarding 1,000 burn-in draws to estimate the mean vector, covariance matrix, and ozone-wind association. He compares joint Bayesian missing-value sampling with one-time missForest imputation and MICE, emphasizing that fixed imputations omit imputation uncertainty; the lecture also covers AI use, project assessment, and course deadlines.
Key takeaways
- Joint Bayesian Gibbs sampling propagates missing-value uncertainty by resampling missing entries during every iteration, unlike analysis of a single fixed imputation.
- For the four-variable air-quality example, the ozone-wind posterior correlation is approximately -0.57, with a 95% credible interval of about -0.67 to -0.44.
- A posterior correlation should be summarized by computing the correlation for each posterior covariance draw, then taking the mean and credible interval across those draws.
- MICE generates imputations from chained conditional models, while missForest uses random forests without a parametric model; either method's suitability depends on the data and analysis goals.
- A one-time imputation can understate uncertainty and often yields narrower credible intervals because imputed values are treated as known.
- AI-generated statistical code requires human verification: Sinha notes that generated code may choose an independent rather than dependent prior, changing the intended model.
Chapters
- The example models ozone, solar radiation, wind, and temperature jointly under a four-dimensional multivariate normal distribution.
- About 40 to 45 rows contain missing entries, grouped by whether one, two, or three variables are missing.
- Gibbs sampling treats missing values as unknown parameters and initializes them before iterating.
- Within each iteration, missing entries are sampled from their conditional normal distribution, univariate for one missing value and multivariate for multiple missing values.
- The sampler then updates the mean vector and covariance matrix from their full conditional distributions.
- A Wishart draw is inverted to obtain the covariance matrix, and the run stores 5,000 parameter draws.
- After removing 1,000 burn-in iterations, the retained posterior mean draws have dimensions 4,000 by 4, one column for each air-quality variable.
- Sinha reviews posterior distributions, means, standard deviations, and 95% credible intervals for the four components of the mean vector.
- The covariance matrix summarizes variances on its diagonal and pairwise covariances off the diagonal.
- The posterior ozone-wind correlation is about -0.57, with a 95% credible interval from approximately -0.67 to -0.44, indicating a negative association.
- Sinha calculates correlation for each stored covariance draw before summarizing its posterior, rather than relying only on a ratio of posterior means.
- Partial correlation adjusts for the other variables and is calculated from the inverse covariance, or precision, matrix as -A₁₃ divided by the square root of A₁₁A₃₃.
- The missForest package uses random forests and decision trees to fill missing entries without specifying a parametric imputation model.
- After one missForest imputation, the completed dataset is analyzed with standard Bayesian sampling while imputed values remain fixed.
- Unlike joint Gibbs sampling, this workflow does not propagate imputation uncertainty and may produce narrower credible intervals.
- Observed entries remain unchanged in the missForest-completed dataset, while only missing cells receive imputed values.
- Sinha compares posterior means and credible intervals from fixed imputation with the earlier Gibbs analysis, which resampled missing values at every iteration.
- The fixed-imputation intervals are generally expected to be narrower, although MCMC randomness means that this is not guaranteed in every run.
- MICE, or multiple imputation by chained equations, fits conditional models for missing variables using the other variables and samples replacement values.
- The R package can generate multiple completed datasets; analyzing multiple imputations helps represent randomness in the imputation process.
- Sinha cautions that random forests can miss important nonlinear predictors in noisy settings, while MICE may suit smaller datasets and Bayesian neural networks may be considered for much larger datasets.
- Sinha says Chapter 7 will not be on the exam, while the other chapters remain in scope; he is considering conceptual questions alongside calculation-oriented questions.
- He encourages AI for explanations, project writing, and code generation, but students must verify that code matches the intended model and understand every part of their work.
- Project writing will receive peer grading using a rubric, while Sinha assesses presentations through individual question-and-answer responses.
- Students should submit an R Markdown file and its HTML output, with code chunks hidden if desired; hidden code does not count toward the word limit.
- If data cleaning requires a separate file or downloaded data, Sinha recommends including those materials in a ZIP folder; figures should appear in the submitted output.
- Project writing is due by the 15th, presentation dates are listed in the project assignment, and possible extra topics include Gaussian processes and the Kalman filter.
Transcript excerpt
0:01 Sinha, Samiran: All right, so let's get started. In today's lecture, we will talk about missing data methods. We started talking about missing data technique, and in the last lecture, we were discussing about the code. Sinha, Samiran: And in that code, we did the first part, identification of the missing data pattern. Sinha, Samiran: There are 3 different types of missing data. For some rows, you remember, we are talking about air quality data, which had 4 Sinha, Samiran: Response variables, and we wanted to, make inference about the mean and the covariance metrics of those four responses under the multivariate normal distribution assumption. Sinha, Samiran: The issue is that about About 40 or 45 rows had some missing values.
0:57 Sinha, Samiran: Either in one variable missing, or two or three variables missing, so there are three defaulted missing types, and depending on the missing types, we need to sample those missing entries Sinha, Samiran: from the respective conditional distribution. Those conditional distributions are multivariate normal, again. Sinha, Samiran: So, let's, let's… do that. Sinha, Samiran: And to start, Sinha, Samiran: the GIF sampling step, we need to initialize missing values, because the missing values are treated as parameter, and for gift sampling.
1:54 Sinha, Samiran: We need to initialize all the parameters. Sinha, Samiran: Okay, so this is some basic parameters for the gift sampling. We said, the number of samplings.
3:23 Sinha, Samiran: Number of iterations, 5,000. Sinha, Samiran: then you'll be storing the theta value. Theta is the mean parameter vector, and the sigma… sigma is a matrix, so those matrices will be stored in this array. Sinha, Samiran: And this is within… this is the loop, within the loop. Let me show you what is going on within the loop. First. Sinha, Samiran: we sample… The missing entries, okay? So for…
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.