Practice · Baseball
Nineteen hitters after their first 45 at-bats of a season, with the rest of their season held out, so every answer you give can be checked against what actually happened.
One row per hitter: the name, the first 45 at-bats and the hits in them, then the remaining at-bats and hits for the season, and the team. The holdout columns are the point: a method that rates hitters on 45 at-bats can be scored on the other several hundred.
name | the hitter |
at_bats, hits | the first 45 at-bats and the hits in them |
remaining_at_bats, remaining_hits | the rest of the season, held out for scoring |
team | the club, by city |
19 rows. Season batting records, MLB, prepared as a teaching sample for the AthlyticZ Bayesian sessions. For practice; cite the original source in anything you publish.
Compute each hitter's average over the first 45 at-bats and rank them. Then compute the average over the remaining at-bats and rank again. How many of the top five stayed in the top five?
Shrink each hitter's 45-at-bat average toward the group with a Beta-Binomial: choose a prior from the group's spread, compute each posterior mean, and rank on that. Score both rankings against the holdout. Which one did better, and by how much?
Fit a hierarchical model in PyMC where every hitter's true rate is drawn from a league distribution whose spread is itself estimated. Report, for the hottest starter, the posterior probability that his true rate is above the league mean, and say how much of the hot start survived the pooling.
No answers are published here. Work the question, then watch the session and compare your route with the instructor's.
Hierarchical Modeling using PyMC in Baseball. The hot-start question is worked, with code, on the problems page. Every dataset in the practice library names its session the same way.
First name and email. One message when a session recording, a skill, a cheat sheet or a posting worth your time arrives here, and no other mail. Replies reach a person.