Practice · Baseball
Five hundred well-elevated batted balls from a Statcast sample: exit velocity, launch angle and how far the ball went.
One row per batted ball, restricted to launch angles between 20 and 35 degrees, so exit velocity should be the dominant driver of distance. It is the baseline regression in the MCMC session: simple enough to see every part of the sampler's output, real enough that the model is not quite right.
launch_speed | exit velocity, mph |
launch_angle | degrees above horizontal |
hit_distance | feet |
500 rows. Statcast, via Baseball Savant and pybaseball; a sample from one two-week window of a season, prepared for the MCMC in Practice session. For practice; cite the original source in anything you publish.
Plot distance against exit velocity and fit a straight line by least squares. What does one extra mile per hour buy in feet, and how spread out are the points around the line?
Fit the same line as a Bayesian regression in PyMC with weakly informative priors. Read everything pm.sample returns: the posterior group, the summary table, R-hat and effective sample size. Report the slope as an interval, not a point.
Run a posterior predictive check. Where does the simulated data look unlike the real data, and which of the two extra ingredients, launch angle or a non-constant spread, fixes more of it? Fit both and compare them honestly.
No answers are published here. Work the question, then watch the session and compare your route with the instructor's.
MCMC in Practice. 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.