Stats 401 - Week 9 - Part 3
Overview
Miles Chen introduces a Bayesian hierarchical model for baseball batting averages: an unknown population parameter, omega, defines each player’s Beta prior, and player-specific hit counts update that prior through the Beta-binomial relationship. He explains how the shared hyperprior lets players’ data inform the population distribution, then demonstrates estimating omega with Metropolis sampling for eight players, using 12,000 iterations and discarding the first 500.
Key takeaways
- A hierarchical Beta-binomial model lets a shared population parameter omega shape each player’s batting-average prior while preserving conditional independence between players given omega.
- For a known player prior Beta(alpha, beta), observing x hits in n at-bats produces a posterior Beta(alpha + x, beta + n - x).
- Player posterior means combine individual hit data with the population mean, and the balance depends on the prior concentration relative to the player’s number of at-bats.
- When omega is unknown, individual players’ estimates become dependent marginally because their results all provide evidence about the same hyperparameter.
- The eight-player demonstration uses Metropolis sampling for 12,000 iterations, removes 500 initial draws, and estimates the population mean near 0.257 when the simulated omega is 0.25.
Chapters
- The earlier baseball example used a fixed Beta prior with shape parameters 81 and 219.
- A hierarchical model treats prior parameters as random, allowing information from multiple players to help estimate the population prior.
- The example holds prior concentration at 300 and varies omega, the population-level parameter that determines the Beta distribution’s shape.
- Omega is drawn from a hyperprior, illustrated first as Beta(2, 5) and later in the code illustration as Beta(3, 7).
- Given omega and concentration 300, the model determines the Beta shape parameters alpha and beta for player batting averages.
- Each player gets an individual batting probability theta, then hits are generated from a binomial distribution using that player’s at-bats.
- The observed data contain hits and at-bats, not the hidden omega or each player’s theta.
- For player s, n_s denotes at-bats and x_s denotes hits; conditional on omega, players’ batting averages are independent.
- When omega is unknown, player batting averages are linked through the shared population distribution, so one player’s results can inform estimates for others.
- The model combines the hyperprior on omega, each player’s Beta prior on theta, and the binomial likelihood of that player’s observed hits.
- If omega is known, a player’s posterior Beta parameters are the prior alpha plus hits and prior beta plus misses.
- The posterior mean balances the observed batting average against the population mean, with weights determined by prior concentration and the number of at-bats.
- Uncertainty about omega requires averaging over its posterior, while integrating out player batting averages yields a Beta-binomial contribution for each player.
- A simulation uses eight players and a true population value omega of 0.25, then generates each player’s batting average and hit data.
- Metropolis sampling proposes omega values, rejects proposals outside 0 to 1, and evaluates the hyperprior together with the players’ marginal data likelihoods.
- The example runs 12,000 iterations and discards the first 500 before using retained omega draws to estimate player-level posteriors.
- Players with unusually high or low observed averages are pulled toward the inferred population mean, which is estimated near 0.257 in the example.
Transcript excerpt
0:02 All right. Um, so for our last bit, I want to introduce the the concept of a hierarchical model. And in a hierarchical model uh for basian statistics, we allow the parameters of our prior distribution to be random values themselves. So, we're going to go back to our baseball example. And with our baseball example, we had uh one player and we had a fixed prior. And um we said the prior distribution had shape parameters 81 and 219. we observed one player and you know if the player has
0:51 more successes okay that uh that's going to affect their posterior distribution and we'll say okay they they have a um a higher um batting average and and so you know and as we increase the amount of data there we can you know influence the uh the posterior distribution. Okay. Um but very validly we might wonder what if I wanted a different prior distribution and you know what if I don't want to use this number of 81 and 219 or if I want something else you know what what should I put in and so we might want to um have a
1:44 uh leave that as unknown or random values. And we might try to infer the prior distribution for a bunch of baseball players, okay, by having some common information. We might say like, okay, if I look at a whole bunch of baseball players, their batting averages fall in this range. So maybe the population batting average prior distribution should look like this. Okay. And um and that allows um you know depending on how much information you have on each player, you can kind of fill in the gaps by using information from the other players. So just um just to kind of keep
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
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, Miles Chen.