Archive for Research

Learning a Lesson From Basketball Analytics

I read an interesting article here by Brian Woolley which attempted to adjust batter performance for the quality of pitching they face. It’s interesting because we tend to assume when we look at a player’s performance that they faced more or less the same quality of competition as everyone else, despite the fact we know, especially in small samples, that may not be the case. This is even more evident when we look at minor league performance, where the quality of competition can vary wildly from one prospect to another. How can we discard the assumption of equal quality of competition and try to get a more accurate picture of a player’s performance? In basketball analytics, this quality of competition piece is an even more pronounced issue because of the fact that players are selected to play in specific situations by a coach, unlike the lineup card which dictates when everyone bats.

There is a metric in basketball called Regularized Adjusted Plus-Minus (RAPM) which attempts to value individual players based on their contribution to the outcome of a game while accounting for the quality of the teammates and opponents when on the court. The initial idea in the public sphere came from Dan T. Rosenbaum in a 2004 article detailing Adjusted Plus-Minus (APM). You can read more about the basketball variant in the linked article, but I’ll describe how I adapted it to a baseball context.

To setup the system, I created a linear regression model which takes each player as an independent variable, every plate appearance as an observation, and the outcome of the plate appearance as the dependent variable we’re trying to predict. Specifically, if a player is not part of a plate appearance, the value for their independent variable is a 0, if they are the pitcher, they are a -1, and if they are the batter, they are a 1. Note that for players who appear as both a pitcher and hitter, they are given two independent variables so we can measure their impact on both sides of the ball separately. The outcome of the plate appearance is defined in terms of weighted On-Base Average (wOBA). Read the rest of this entry »


A Ground Ball Revolution?

It has been an odd year for the Chicago White Sox thus far. The club is leading baseball in pitching WAR behind the dominating trio of… Carlos Rodon, Dylan Cease, and Michael Kopech. Major injuries have and will keep Luis Robert and Eloy Jimenez out of the lineup for much of the season, and their most productive bat to date is a 28-year-old who did not have a major league hit entering the season. But potentially weirder than all that is the way in which Chicago has amassed one of the best offenses in the early portion of the season: the ground ball!

Entering May 28, the White Sox were second in MLB with a 114 wRC+, fourth at 5 runs per game, and second in wOBA at .330. This offensive success is not unprecedented, as last year’s Sox featured a high-power offense as well.

White Sox Offense: 2020 vs. 2021
Category 2020 2021
wRC+ 113 114
wOBA .334 .330
Runs/Game 5.10 5
OBP .326 .343
ISO .192 .149
GB% 45.4% 48.9%
BABIP .314 .317
2021 data as of May 27

What does stand out is the lack of power from this year’s team. Chicago has the sixth-fewest homers and a league-leading 48.9% ground ball rate (league average is 43.5%). If that rate were to stand for the remainder of the season, it would be the seventh-highest ground ball rate since FanGraphs batted ball data started being collected in 2002. The White Sox also have a 8.9% average launch angle that would be the sixth lowest in the Statcast era. Chicago’s grounder-centric offensive success stands in stark contrast to the other nine clubs that round out the 10 teams with the highest grounder rates since 2002. Read the rest of this entry »


The MVP Batter Through the First Month

In one of the later chapters of The MVP Machine, the authors describe a working relationship between an unnamed position player and a writer at an “analytically inclined” baseball website. The player felt that his club’s advanced scouting data wasn’t granular enough and asked the writer to supplement the information he was given by the club with additional detail. The writer was eventually performing scouting reports on the player himself, opposing pitchers, as well as the home plate umpires’ strike zones. In terms of evaluating his own performance, the writer summarized that the player was basically looking at three things: “Am I squaring up the ball? Am I swinging and missing? Am I swinging at strikes?”

With the first month of the season in the books, who would be some of the best performing hitters in the league according to this particular player’s criteria? Thanks to Statcast, we have the tools at our disposal to try and figure out just that. Note that the dataset I used for this exercise was all qualified batters as of the morning of April 30th, 2021.

First, we need to decide which parameters to use to represent each of the three questions posed by the player. Two of the three are pretty easy. “Am I swinging and missing?” We can look up a player’s whiff percentage on Statcast. “Am I swinging at strikes?” That information is represented in a player’s chase percentage. “Am I squaring up the ball?” The natural candidates here would be, if we’re using just one number, the average exit velocity, hard hit percentage, and barrel percentage. I decided to go with the average exit velocity because it takes into account every batted ball put in play by the batter. Let me explain. Read the rest of this entry »


Expected Pitch Value

There is an index called pitch value that calculates the increase or decrease in runs scored depending on the pitch type. In this article I will look to create an environment-neutral version of pitch value.

Shortcomings of Existing Pitch Value

Pitch Value (hereafter PV) and RV use the average or sum of the variable values of RE288. This method has the advantage of being able to measure how much a pitch actually increased or decreased the number of runs scored on that pitch. However, the metric is not consistent enough to be used in a single year given that it depends on a relatively small number of batted balls and plate appearances.

The following is the average delta_run_exp (RV/100) of sliders for pitchers who threw 500 or more of them in each year from 2017-20, with the data obtained from Statcast.

The correlation coefficient is 0.14, which means that there is almost no correlation. Even if a pitcher records an excellent RV/100 in one year, there is no way to know what kind of value he will record the following year. It seems that it is difficult to measure the stable value of a pitch type with the existing PV and RV.

Using xwOBAvalue for Situation-Neutral Run Value and Batted Ball Evaluation

We can try to make improvements in measuring the value of pitches with a small number of at-bats or pitches in a single year.

First, we use a situation-neutral scoring value for events that occur rather than a change in scoring value. For example, a home run with no runners on base and a home run with runners on base have different values in the existing RV, but the situation-neutral scoring value is calculated using the average scoring value of home runs in all situations combined. The reason for this is that it is not appropriate to evaluate the ability of a single pitch to prevent runs from being scored if it depends on the circumstances in which it is thrown.

Another correction is to use the xwOBAvalue (estimated_woba_using_speedangle in Statcast) instead of the actual batting result when a pitch is hit. The pitcher has little control over whether a batted ball becomes a hit or an out, and it is known that the number tends to be unstable in a single year. If we consider that it is difficult for a pitcher to control the number of batted balls in a season, the batted ball number of pitch type in a season is even smaller, so the index becomes less stable. Therefore, for batted balls, we use the value of runs (xwOBA_value), which is estimated from the speed and angle of the batted ball. The purpose of this is to remove the influence of defense and chance as much as possible.

In this way, we try to calculate the pitch value as situationally neutral as possible.

Calculate wOBA by count

I will call this situation-neutral pitch value xPV (expected pitch value) for now.

The first step is to find the wOBA by count. Here, the wOBA by count is calculated based on “all final batting results that have passed that count.” Note that this is not the same as the batting results recorded at the time of that count.

For example, if a batter misses a strike in an 0-1 count and the count goes to 0-2, and then strikes out on three pitches, one strikeout is recorded in the 0-1 record. But if a batter hits a single in that 0-2 count, a single hit is recorded in the 0-1 record1. Also note, 0-0 is the count that has elapsed in all counts, so 0-0 = wOBA for all at-bats in that period.

Calculating the Run Value by Count

Using this wOBA by count, we can calculate the value of points scored by count.

(count wOBA after pitching – count wOBA before pitching) / wOBAscale (≈1.15 in Statcast csv data)

First, when the count changes, the actual RAA is calculated as:

(wOBA of the count after the pitch – wOBA of the count before the pitch) / 1.15

If a batted ball occurs, then this is used to calculate RAA:

(xwOBAvalue – wOBA of the count before the pitch) / wOBAscale

Total the value, Take the Average

The xPV is calculated by summing and averaging the RAAs calculated in this way.

The advantage of this xPV is that it reduces the influence of chance as much as possible and increases the consistency of the index by giving it a situation-neutral value. The following is the year-to-year correlation of the xPV/100 (xPV per 100 pitches) of sliders for pitchers who threw at least 500 sliders from 2017-20.

The correlation coefficient was 0.49, which is a moderate correlation and much improved over the 0.14 of RV/100.

For xPV, I referred to this article.

1The reason why we use hitting stats through a count instead of hitting stats at that count is that we can take into account the effects of events that occur only in a particular count, and we can also evaluate pitches that are not directly related to the batting results. For a detailed explanation, snin’s article is very helpful.

I have also put the R code here.


Your Team’s Prospects Are Probably Not Going To Work Out

Serious prospect hounds know that only about 10% of minor leaguers ever participate in a major league game. However, even the most discerning fans can be deluded into believing that their team’s farm system can overcome the odds and build a perennial contender based on their prospects alone.

I decided to investigate how much average WAR a prospect generates based on their ranking in Baseball America’s Prospect Handbook. I used a similar process in a previous article in which I calculated the amount of WAR based on the next six seasons of a player’s career since being listed (instead of when a player makes their major league debut). This means that players closer to the majors get a boost to their value, since they will have more opportunities to accumulate WAR than players in the lower minors.

Next, I grouped the players by their ordinal ranking in their organization from the 2001-2015 seasons and calculated each group’s average WAR to create the visualization below. Read the rest of this entry »


Introducing pWAR: A Predictive Wins Measurement for Pitchers

When WAR was first introduced, it attempted to answer a baseball question that has existed as long as teams have played professionally: how much can one player contribute to a team’s record? It is an ongoing debate to this day, but WAR is widely recognized as an excellent measure of overall performance. WAR numbers for major league players are regularly cited and recognized by both Major League Baseball and the Elias Sports Bureau. However, there is another question behind WAR, also long predating the existence of the statistic, and it’s a question that has yet to be answered by it. When a front office is deciding whether or not (or how aggressively) to pursue a player, they’re ultimately searching for the answer to one question — how many more games will we win if we get this guy?

Enter pWAR.

Read the rest of this entry »


Introducing xxxFIP

ERA, FIP, xFIP, and beyond…

There are a wide range of pitching stats available to the discerning baseball fan. From Wins and ERA to DRA- and xBACON, there’s something for all tastes. In this post I’ll introduce a new stat, xxxFIP, which is definitely NSFW (Not Safe For Wise decision-making).

Before diving into the details of xxxFIP, let’s discuss its predecessors and what they are trying to measure. Read the rest of this entry »


Enhancing Prospect Outlooks Using Scouting Report Text

Wander Franco is the latest prospect to be discussed as a top player in the game before stepping on a major league field field. Vladimir Guerrero Jr. was likely the recipient of even more hype in 2018, though he has reminded us at times that there are no automatic superstars in baseball. Franco and Guerrero Jr. have the unique distinction as the only two players to be given the maximum “hit tool” score of 80 on MLB.com’s prospect rankings. Guerrero Jr. (in 2018) scored higher on “power” while Franco has the edge in running and fielding. They were both rated 70 overall and were the respective No. 1 prospects in baseball at the time.

When comparing the two players’ ratings, we might stop at this point and declare a virtual tie. The same could be said for any number of lower level prospects with similar ratings. However, there is still a significant amount of data available describing the players: the words used in the scouting reports. On MLB.com, below the numeric ratings, there is a blurb detailing the prospects’ exploits. At first glance, we might not think the text provides information that can separate players, as many of the writeups are similar in both style and substance. Yet there is a possibility that there are indicators in the text that are not obvious to a human reader (or at least a human reader with my minimal experience analyzing text).

To examine the importance of the scouting report text, I developed two models — one with the text data and one without — to predict whether a prospect has made his major league debut as of the end of the 2020 season. Both models use variables such as year, position, numerical skill ratings, etc. to account for all of the non-text information available on MLB.com. Thus, if there is a difference in model effectiveness, it will be a result of the text data adding information that is not captured by the other features. Read the rest of this entry »


Rethinking How We Look at Team Defense

They say that a run prevented is as important as a run scored, and this checks out. In fact, based on the coefficient of determination (r^2) for the two variables, a run prevented has actually been more correlated with team success than a run scored. This has indeed been labeled as the “run prevention era,” and just by that measure, this would appear to be the case.

As we’ve discovered in the past, offense and pitching wins championships, especially compared to defense. However, that certainly does not mean that defense does not matter. Rather, it is a small advantage that teams can leverage to continue to win between the margins. Small-market organizations such as Cleveland, the Rays, and the D-backs have all benefitted from strong defense in the past, while the Mets have been a clear example of what poor defense can do to you.

How can teams gain an edge defensively, and how much does it matter? What are the most important defensive positions, and how does it vary from the defensive spectrum? Should teams tailor their defense specifically to their pitching? Let us change the way we look at team defense by crunching through the numbers! Read the rest of this entry »


Pulling a Rockies Pitching Solution Out of Thin Air

The success of the Colorado Rockies franchise has historically been impeded by air: the thin air of Coors Field and the hot air blown by higher-ups in the front office.

Due in large part to playing their home games in a comically extreme hitters’ park, the Rockies have finished 14th or worse in the National League in runs allowed per game in 21 of their 28 seasons in franchise history. Colorado has finished with a winning record five times in the past 20 seasons, and in four of those they ranked in the top 10 in the NL in RA/G. No, their run prevention as a whole has never been what you would call “good” or even “well above average,” but their only brushes with success have come at times when their pitching ventured beyond putrid.

The adverse effect of the thin atmosphere on pitching is twofold. The more apparent aspect is that it imparts less drag on a batted ball, allowing for fly balls to carry further, resulting in increased slugging at Coors. Perhaps less obviously, movement of pitches due to the Magnus effect is diminished. At the risk of triggering memories of my undergraduate fluid dynamics course, the lift on a baseball (or any spinning sphere) is proportional to the density of the fluid it moves through. Thus, when a fastball is thrown at Coors Field, it has less “rise” (or more accurately, is less affected by gravity) than it would at other major league parks.

Does this mean that every pitcher will perform demonstrably worse if he takes up in-season residence in Denver? Well, yes, but actually no. Read the rest of this entry »