### Carnegie-Mellon Workshop on April 7

I am excited about participating in the first CMU Baseball Analytics Workshop next Saturday. This workshop will provide an opportunity for students to learn about baseball analytics and do some R programming on baseball data. The participants will be visiting PNC park early and meeting with Dan Fox, director of Baseball Informatics for the Pirates. (If you are in the area, check out this workshop.) My talk will give an introduction to Statcast and describe the R coding to implement this exploration of exit velocities and launch angles.

### Launch Angles

It seems that everyone is talking about launch angles nowadays. For example, there is a recent Sports Illustrated article stating that we are currently in the “era of launch angles, exit velocities, and home runs.” This SI article focuses on the current MLB hitting emphasis on putting the ball in the air which is accompanied by the record number of home runs.

Let’s consider a related launch angle issue. We focus on the balls put in play (that is, with home runs removed). **What is the optimal launch angle for getting a base hit?** We’ll use this post to demonstrate an empirical approach for determining the launch angle maximizing the probability of a hit on a ball in-play.

### Getting the Data in Shape and An Initial Plot

To get started …

- I load in the Statcast batting data for the 2017 season.
- I am only interested in the balls in play, so I filter on type = “X”.
- I remove home runs (events == “home_run”) and sacrifice hits from the data frame, and define two new variables: hit (1 or 0) and out (1 or 0).
- I focus only on the balls put in the air where the launch_angle is positive.

Here I construct a scatterplot of the launch angles and launch speeds for all balls put in play (remember I am looking only at balls hit in the air) and color the plotting point by the outcome (hit or out). We see a blue “hit band” which has a negative trend — softer balls falling as hits tend to have larger launch angles. Harder hit balls (say over 100 mpg) tend to be hits for a wide range of launch angle. We’re going to focus below on launch angles between 0 and 30 degrees that appear to correspond to most of the hits.

### Optimal Launch Angle for a Fixed Exit Velocity

Since the best launch angle appears to depend on the exit velocity, we focus on several representative launch speeds, and for each launch speed, find the launch angle that maximizes the probability of a hit.

Here’s what we do:

- Suppose we look at launch speed of 75 mpg. We look at all balls in play where the launch speed is in a neighborhood of 75 mpg (precisely between 74.5 and 75.5 mpg).
- Next, we bin the launch angles using the 30 bins: 0-1 degrees, 1-2 degrees, …, 29-30 degrees.
- For each bin, we collect the number of balls in play (BIP) and the number of hits (H) — from that we compute the BABIP = H / BIP that is the approximate probability of a hit.
- We graph the midpoints of the bins against the hit probabilities and add a loess smooth — from the smooth we can approximate the optimal launch angle.

There are clear patterns from the smooths and one can visually pick up the optimal launch angles — for the launch speeds of 75, 90, 85, and 90 mph, the optimal launch angle is 20, 17, 15, and 13 degrees. The hit probability decreases sharply once one exceeds this optimal launch angle.

Here are three more plots corresponding to the launch speeds of 95, 100, and 105 mph. It is interesting that for hard hit balls (100 or 105 mph) the hit probability is less dependent on the launch angle.

### Summing Up

To summarize what we learned, I graph the optimal launch angle as a function of the exit velocity and we see a clear decreasing pattern.

### Takeaways

- This demonstrates a pretty clear relationship between launch angle and hit probability. One does not need to use a fancy regression model to detect this relationship.
- Given a player’s launch speed distribution, it would seem that a “stats coach” could provide advice on the proper launch angle to maximize his hit probability.
- We’ve ignored several variables involved in hitting success such as running speed to first base and spray angle. In a recent post, I used a model to predict a player’s hit production based on launch speed and exit velocity and explore the players who hit more than what is expected from the model.
- As usual, here is the R code — I’ll talk more about the R material in my CMU talk.

### Last Minute Post – Change in Launch Angles?

Right before I posted this, I was wondering how the launch angles have changed in the 2018 season. First I collected the mean launch angles for all weeks of the 2017 season. I’ve graphed a histogram of these 2017 means and show the 2018 mean as a vertical line. The current mean launch angle (through games of April 1) is 13.4 degrees which is high relative to the values from last season. So maybe hitters are changing their batting form this season.