STAT 638 (Fall 2026), Lecture 20
Overview
Samiran Sinha concludes Chapter 8's hierarchical model for 30-day hospital mortality, showing how posterior estimates shrink noisy hospital rates toward one another and how Metropolis-Hastings acceptance rates and autocorrelation affect sampling efficiency. He then introduces Chapter 9's linear regression, deriving the classical least-squares estimator and setting up a Bayesian model with a multivariate normal prior for regression coefficients and an inverse-gamma prior for the error variance.
Key takeaways
- Hierarchical pooling can move unstable hospital mortality estimates toward the shared group pattern: Hospital A shifts from an observed rate near 20% to a posterior mean around 14% to 15%.
- A high Metropolis-Hastings acceptance rate is not by itself evidence of efficient sampling: reducing proposal standard deviation to 0.2 raised acceptance to about 95% but also increased autocorrelation.
- High autocorrelation does not necessarily bias an MCMC estimate, but it increases its variability across runs; the lecture's repeated estimates had standard deviations of about 0.21 under higher autocorrelation and 0.033 under lower autocorrelation.
- For the normal linear regression model, maximum likelihood and least squares produce beta-hat = (X transpose X) inverse X transpose Y, with sampling covariance sigma squared times (X transpose X) inverse.
- Endogeneity arises when predictors are associated with regression errors, including through omitted variables; the lecture assumes conditional error mean zero given X.
- With a diffuse normal prior on beta, its Bayesian full conditional approaches a normal distribution centered at the least-squares estimate, linking Bayesian posterior inference to frequentist sampling results.
Chapters
- The lecture wraps up Chapter 8 and begins Chapter 9, with Chapter 7 postponed until after Chapter 10.
- The example uses 30-day mortality among patients admitted to five hospitals, treating each hospital as a group.
- Hierarchical modeling shares information across hospitals in the same geographic region, especially where admission counts differ.
- Trace plots for hospital mortality probabilities P1 through P5 and hyperparameters alpha and beta are used to assess chain behavior.
- The hospital probabilities appear to mix more freely, while alpha and beta show visibly stronger dependence between successive draws.
- Autocorrelation plots make the difference clearer: hospital probabilities have negligible autocorrelation, but alpha and beta have high autocorrelation.
- Metropolis-Hastings acceptance rates for alpha and beta are about 40% and 41%; changing proposal standard deviation can alter both acceptance and autocorrelation.
- Posterior summaries compare each hospital's raw mortality rate with its posterior mean and 95% credible interval.
- Hospital A's observed rate is about 20%, while its posterior mean moves toward roughly 14% to 15%; Hospital E's estimate remains close to its observed 10%.
- Shrinkage pulls noisy hospital estimates toward the overall pattern: Hospital C's observed rate near 9% moves toward about 10%.
- Posterior comparisons include a 0.15 probability that Hospital A's mortality exceeds 15% and an 83% probability that Hospital A's mortality exceeds Hospital E's.
- Sinha illustrates MCMC behavior by sampling from a known normal target with mean 1 and standard deviation 2 using a random-walk Metropolis proposal.
- With proposal standard deviation 0.2, acceptance rises to about 95%, but successive draws become tightly correlated.
- Repeated runs with high autocorrelation produce means such as 0.82, 0.92, and 1.03, illustrating greater run-to-run variability rather than systematic bias.
- With lower autocorrelation, repeated estimates cluster closer to 1; across repeated chains, the reported standard deviations of the estimates are about 0.21 versus 0.033.
- Regression studies associations between an outcome and explanatory variables, also called predictors or covariates.
- Sinha distinguishes numeric outcomes, suited to linear regression, from binary outcomes modeled with Bernoulli or binomial distributions.
- Multiple unordered categories call for a multinomial model, while ordered categories call for ordinal regression.
- Regression can support later causal inference, but association alone does not establish a causal effect.
- For P predictors, the model is Y = X transpose beta + epsilon, where beta contains unknown regression coefficients and epsilon is the noise.
- Across N observations, Y and epsilon are N-by-1 vectors, X is an N-by-P design matrix, and sigma squared is the unknown noise variance.
- The classical setup assumes normally distributed errors with mean zero and variance sigma squared, and requires the conditional error mean given X to be zero.
- Dependence between predictors and errors creates endogeneity, which can arise from omitted variables in observational social-science data; the course assumes no endogeneity.
- Under independent normal errors, the likelihood depends on the residual sum of squares, (Y - X beta) transpose (Y - X beta).
- Maximizing the likelihood for beta is equivalent to least squares, giving beta-hat = (X transpose X) inverse X transpose Y.
- Across repeated samples, beta-hat has a normal distribution with mean beta and covariance sigma squared times (X transpose X) inverse.
- Sinha gives the variance MLE as the residual sum of squares divided by N and identifies H = X(X transpose X) inverse X transpose as the symmetric, idempotent hat matrix.
- The Bayesian model combines the regression likelihood with priors for beta and sigma squared.
- Because beta is a vector, Sinha assigns it a multivariate normal prior with mean beta-zero and covariance Sigma-zero.
- The scalar error variance sigma squared receives an inverse-gamma prior, connecting this regression setup to normal-mean inference from Chapter 5.
- The joint posterior for beta and sigma squared is proportional to the likelihood multiplied by both prior distributions.
- The Bayesian computation uses full conditional distributions for beta and sigma squared, following the sampling strategy used for normal-model inference in Chapter 5.
- Completing the square in beta yields a multivariate normal full conditional whose mean and covariance depend on the data, prior, and sigma squared.
- As the prior precision approaches zero, the prior becomes diffuse and beta's conditional distribution approaches a normal distribution centered at the least-squares estimate, with covariance sigma squared times (X transpose X) inverse.
- The interpretation differs by framework: Bayesian inference treats observed data and beta-hat as fixed while describing beta's posterior distribution, whereas frequentist inference treats beta as fixed and beta-hat as random across samples.
Transcript excerpt
0:06 Sinha, Samiran: So today we'll be talking. Sinha, Samiran: About. Sinha, Samiran: Chapter 8. Sinha, Samiran: Hierarchical model. Sinha, Samiran: And, and Chapter 9. I'll start Chapter 9. Sinha, Samiran: Chapter 9 is about regression. Sinha, Samiran: We'll start with the linear regression. Sinha, Samiran: And keep in mind that we skipped Chapter 7. I'll come back to Chapter 7 after finishing Chapter 10.
1:15 Sinha, Samiran: Alright. Sinha, Samiran: So Sinha, Samiran: So, if you recall, we have been talking about a hierarchical model for making inference about the success probability. Sinha, Samiran: Bernoulli success probability from different groups.
2:09 Sinha, Samiran: And. Sinha, Samiran: The problem was, we wanted to make inference about Sinha, Samiran: The mortality rate of different hospitals. Sinha, Samiran: And different hospitals are different groups, because from every hospital, we got a bunch of patients' information. Sinha, Samiran: Number of patients admitted with myocardial infraction, or some kind of heart-related problem, and we counted how many of them have died within 30 days of… from the hospital release. Sinha, Samiran: And that mortality rate, we wanted to. Sinha, Samiran: make inference about the mortality rate. Now, one thing is. Sinha, Samiran: Can you not consider the raw mortality date? Yes, you can consider the raw mortality date. You just… just take the number of subjects who died out of the number of admitted people, admitted patients. That is absolutely all right, but this is. Sinha, Samiran: Very crude nowadays, right?
3:15 Sinha, Samiran: In the sense that some hospitals have a large number of admissions, whereas some hospitals have very few admissions, so why not Sinha, Samiran: Do the analysis, hierarchical analysis, which is available. in our disposal, and get more accurate estimates, where you can borrow some information. And borrowing some information is very reasonable in this context, because all the hospitals.
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.