STAT 638 (Fall 2026), Lecture 32
Overview
Samiran Sinha reviews Exam 1 concepts and worked Bayesian analyses, including posterior prediction, hierarchical shrinkage, and why deleting repeated MCMC states distorts the target distribution. Using 100,000 posterior draws with seed 638, he analyzes Titanic survival with independent Beta(2,2) priors, then derives and codes Gibbs updates for a three-group anorexia model; the estimated posterior mean weight change for family treatment is 6.90.
Key takeaways
- With two conditionally independent future outcomes sharing an uncertain rate, the joint posterior predictive probability is E[Q(lambda)^2 | data], not [E(Q(lambda) | data)]^2; positive posterior variance makes the former larger.
- In hierarchical normal models, smaller groups are shrunk more strongly toward the overall mean because their sample estimates contain less information.
- Deleting only repeated MCMC states is state-dependent filtering that changes posterior occupancy frequencies; fixed-interval thinning is a different operation.
- For Titanic adult third-class females, 76 survivors and 89 non-survivors with a Beta(2,2) prior produce a Beta(78,91) posterior.
- The Titanic posterior probability that female survival exceeds male survival by at least 25 percentage points is approximately 0.86, while the predictive probability for strictly more survivors among two females and one male is 0.6271.
- In the anorexia Gibbs sampler, each group-mean conditional precision is 1/16 + Nj/25, and the shared-mean conditional precision is 1/100 + 3/16; the family-treatment posterior mean weight change is 6.90.
Chapters
- For two future loom break counts Y1 and Y2, conditional independence holds given the shared unknown rate lambda.
- Writing Q(lambda) = P(Y > 40 | lambda), the posterior predictive probability that both counts exceed 40 is E[Q(lambda)^2 | data].
- A positive posterior variance for Q(lambda) makes E[Q(lambda)^2 | data] larger than the square of E[Q(lambda) | data].
- When two groups have the same sample mean above the overall mean and equal observation variances, their sample sizes determine how much their estimates are pooled.
- The group with fewer observations, Group A, has less information and is shrunk more toward the overall mean than Group B.
- Removing every repeated MCMC state changes the frequency with which the chain occupies regions of the posterior, so the retained draws no longer represent the original target distribution.
- Fixed-interval thinning, such as retaining every tenth iteration, differs from deleting states based on whether a proposal was rejected.
- Repeated states are meaningful: they record the chain staying in the same region after a rejected proposal.
- The analysis uses R's built-in Titanic dataset, restricted to adult passengers in third class; the frequency variable represents passenger counts in each row.
- Female and male survival probabilities, pF and pM, are modeled separately with independent binomial sampling conditional on those probabilities.
- Each survival probability receives an independent Beta(2,2) prior, and the subsequent Monte Carlo calculations use 100,000 draws with seed 638.
- For adult third-class females, the data record 76 survivors and 89 non-survivors, giving a Beta(78,91) posterior under the Beta(2,2) prior.
- The female posterior follows by adding the 76 successes and 89 failures to the prior's two shape parameters.
- The same conjugate Beta-binomial update is applied to the male survival probability using the male passenger counts.
- Sinha estimates P(pF > pM + 0.25 | data) by counting how many of 100,000 joint posterior draws satisfy the condition.
- The estimated posterior probability that female survival exceeds male survival by at least 25 percentage points is 0.86.
- The exam also asks for an equal-tailed 95% posterior credible interval for the survival-probability ratio pF/pM.
- The hypothetical group contains two female and one male adult third-class passenger, with outcomes independent conditional on pF and pM.
- Strictly more females than males survive in three cases: both females survive and the male does not, or both females survive and the male does, or exactly one female survives and the male does not.
- The exactly-one-female-survives probability uses the binomial term 2 pF(1-pF); averaging the conditional event probability over posterior draws gives 0.6271.
- The outcome is post-treatment weight minus pre-treatment weight from the anorexia dataset in the MASS package.
- For control, cognitive behavior therapy (CBT), and family treatment (FT), the model is Yij | theta_j ~ Normal(theta_j, 25), theta_j | mu ~ Normal(mu, 16), and mu ~ Normal(0, 100).
- All three variance values, 25, 16, and 100, are variances rather than standard deviations; the unknown parameters are three group means and the shared mean mu.
- Completing the square gives each group mean theta_j a normal full conditional combining its group sample mean, sample size Nj, observation variance 25, and prior variance 16.
- For each group, the conditional precision is 1/16 + Nj/25, and the conditional mean weights mu and the group sample mean by their respective precisions.
- Combining the three group-level normal priors with mu's Normal(0,100) prior gives mu a normal full conditional with precision 1/100 + 3/16, centered using the average of theta1, theta2, and theta3.
- Sinha sets up R code to calculate group sample sizes and sample means, initialize theta values and mu, then iteratively sample the three theta parameters and mu from their full conditional distributions.
- The code stores draws for the control, CBT, and FT means along with mu; initialization should not affect inference if the chain has converged.
- The reported posterior mean weight change for family treatment is 6.90; the other two exam questions are deferred to the next lecture.
Transcript excerpt
0:00 Sinha, Samiran: So today, we'll talk about your Exam 1, exam, okay? Sinha, Samiran: On the exam, the exam. Sinha, Samiran: review. Sinha, Samiran: Discuss. Sinha, Samiran: Oh, shit. Sinha, Samiran: By the way, everybody did… Extremely well. All of you got 100. Sinha, Samiran: So… There is no question. Sinha, Samiran: But this is my responsibility to discuss all the questions. Sinha, Samiran: Question 1, 2 future rooms have independent portion brake counts? Sinha, Samiran: Conditional on… on a shared unknown rate.
0:53 Sinha, Samiran: Okay, so two future loops have independent portion rate counts, conditional on a shared unknown rate, lambda. Sinha, Samiran: split Q lambda equal to probability Y greater than 40 given lambda. Sinha, Samiran: Denotes the probability That the number of breaks Sinha, Samiran: Is more than poverty in a randomly chosen doom. Sinha, Samiran: And suppose the posterior distribution of Q lambda has a positive variance. Sinha, Samiran: What is that Y? Y is the number of… Break. Break comes, okay? Sinha, Samiran: They count in a loom, and that is a random quantity. Sinha, Samiran: Why? Sinha, Samiran: And that probability, that number of break counts in a loom, Is greater than 4. Sinha, Samiran: Let us denote that probability by Q lambda.
1:48 Sinha, Samiran: And which of the following statements about the posterior predictive probability that both looms have more than 40 breaks? Sinha, Samiran: is correct. Sinha, Samiran: So, essentially, we are asked to calculate probability that both looms Sinha, Samiran: So, suppose Y1 is the number of bricks, from Loom 1, Sinha, Samiran: And Y2 is the number of breaks from Loom 2. Sinha, Samiran: And we are interested. Sinha, Samiran: in probability that Y1 greater than 40, and Y2 greater than 40, given the data. Sinha, Samiran: Now, we can write Y1 better than 14, given lambda, Sorry.
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.