Friday, August 5, 2016

Estrada, Wright and the ERA/FIP Gap

One of the stats most often used to describe a pitcher's skill level is Fielding Independent Pitching (FIP), since it is a good predictor of future ERA (a better predictor than current ERA).  FIP only takes into account events that are ostensibly controlled by the pitcher himself-- walks, strikeouts, and home runs.  The theory is that balls in play are largely a function of factors beyond the pitcher's control: defense, ballpark, weather, shifts, etc.  Therefore, FIP attempts to isolate a pitcher's true talent from other variables that have more to do with his teammates, luck, or other circumstances.  When a pitcher manages to have, for example, an ERA of 3.50 but a FIP of 4.50, analysts will often say that he is due for regression and that his ERA will probably rise.  Often this is true (since we know that FIP is a better predictor of ERA), but what if a pitcher can consistently outperform his FIP?  This would suggest that some of a pitcher's skill is not taken into account by FIP-- namely, the ability to mitigate the damage from balls put into play.

In most cases, the gap between ERA and FIP can be explained by a pitcher's BABIP (Batting Average on Balls In Play).  A pitcher with a low BABIP tends to have a lower ERA than FIP and vice versa.  However, BABIP does not tell us whether the pitcher is actually good at limiting the damage of balls in play or if he has a good defense or is just plain lucky.  Therefore, any skill that a pitcher might have in generating weak contact is at least partially obscured by other factors having nothing do do with his own abilities.  Recently, analysts have used stats like hard-hit rate to explain why a pitcher's BABIP is either low or high.  After all, a ball hit at 100 mph is more likely to be a hit than one hit at 80 mph.  This is definitely a move in the right direction, but we can do better.

Now that we have complete hit trajectories (thanks to StatCast), we can quantify exactly how well a pitcher performs based on his batted-ball profile.  As an example, consider a batted ball that is hit right up the middle at a launch angle of 14 degrees and a velocity of 95 miles per hour.  Thankfully, you have Lorenzo Cain in center field and it's an easy out.  However, consider that similar balls in play (batted ball direction between -3 and 3 degrees, launch angle between 12 and 14 degrees, and velocity between 90 and 100 mph) are a hit 61.6% of the time.  Instead of just crediting the pitcher for what actually happened based on his defense, we can assess him on what (on average) should have happened.  Instead of calling it 0 hits or 1 hit, we can call it 0.616 hits!

I wrote a program to analyze every batted ball in the StatCast database since beginning of 2015.  The program takes the batted ball direction (BBD), launch angle (LA), and velocity (V) and determines (based on similar batted balls) how often that ball would be a hit and (on average) how many bases the hit was worth.  In this way, it is possible to generate a pseudo batting average and slugging percentage for every pitcher (or hitter) based on StatCast hit trajectories.  The batting average metric will be called StatCast Batting Average (scBA) and the slugging percentage metric will be called StatCast Slugging (scSLG).  Since it is difficult to visually display the data in 4 dimensions (BBD, LA, V, and batting average), I have broken it up into 2 graphs.  The first plot shows a contour plot of batting average (scBA) for combinations of velocity and launch angle:


The second plot is a contour plot of batting average (scBA) for combinations of launch angle and batted ball direction (-45 degrees is the left field line and 45 degrees is the right field line):


These plots are somewhat different from other "ball in play" data such as BABIP for a few reasons.  BABIP considers all balls in play (in fair territory and foul territory) except home runs.  Conversely, I have decided to include home runs and only balls hit in fair territory (since foul balls can only become outs and not hits).  This means that the league-wide average for scBA is not ~0.300 like BABIP, but rather about 0.354 over the last 2 years.  The average for StatCast slugging percentage (scSLG) is 0.576

For pitchers with at least 200 IP (106 total pitchers) since the beginning of 2015, here are the StatCast Batting Average Leaders:


As one might expect, there are a lot of elite starting pitchers on this list:  Kershaw, Arrieta, Harvey, Syndergaard, Greinke, Scherzer, and Verlander.  However, there are also some names that may surprise some people, including Marco Estrada and Steven Wright, two pitchers that often get mentioned as regression candidates.  After all, they are both on the list of pitchers who have outperformed their FIP by at least 0.50 runs since the beginning of last year:


Out of the 10 pitchers who outperformed their FIP the most, 5 of them are in the top 15 in the league in scBA, including the top 2 (Estrada and Wright).  This suggests that these pitchers have some skill in limiting hard contact and may not regress at all and certainly not as much as their underlying numbers would have you believe.  Contrast that with a guy like Ian Kennedy, who ranks 102 out of 106 pitchers in scBA, yet has managed to outperform his FIP by 0.53.  He is almost certainly getting lucky since his scBA is 21 points higher than the league average and his scSLG is 107 points higher than the league average!

Armed with this new information from StatCast, it is now possible to evaluate pitchers based on their batted ball profiles.  Instead of seeing a low BABIP and immediately assuming that it's entirely luck or defense, we can finally see if there is some skill involved.  Perhaps the next wave of sabermetric stats will include StatCast data to determine a pitcher's value.  Maybe there is a more refined version of FIP (which FanGraphs uses for pitcher WAR) that includes a pitcher's batted-ball skill.  After all, do we think that Michael Pineda (5.5 WAR on FanGraphs since 2015) is actually more valuable than Marco Estrada (4.5 WAR)?

Wednesday, June 15, 2016

Odubel Herrera's Sudden Plate Discipline

Yesterday on the Fantasy Focus Baseball Podcast, Eric wondered whether any player has ever tripled his walk rate in consecutive (qualified) seasons.  This question was inspired by Odubel Herrera's astounding improvement in plate discipline this year.  He has increased his walk rate from 5.21% in 2015 to 14.55% in 2016 (a raw increase of 9.35%, or 2.79 times last year's rate).  I did some research using all qualified seasons since 1980 to find walk rate improvements.

In terms of raw increase in consecutive years, here are the leaders:

Rank Player Year 1 Year 2 Y1 BB% Y2 BB% Increase Multiplier
1 Barry Bonds 2003 2004 26.91% 37.60% 10.69% 1.40
2 Odubel Herrera 2015 2016 5.21% 14.55% 9.34% 2.79
3 Mark McGwire 1997 1998 15.37% 23.79% 8.42% 1.55
4 Paul O'Neill 1993 1994 8.04% 16.25% 8.21% 2.02
5 Danny Tartabull 1991 1992 11.67% 19.58% 7.91% 1.68
6 Brian Giles 2001 2002 13.35% 20.96% 7.61% 1.57
7 Barry Bonds 2000 2001 19.28% 26.66% 7.38% 1.38
8 Von Hayes 1986 1987 10.72% 17.77% 7.04% 1.66
9 Gary Matthews 1980 1981 6.79% 13.79% 7.00% 2.03
10 Eric Chavez 2003 2004 9.48% 16.46% 6.98% 1.74

In terms of percentage increase (multiplier from year 1 to year 2), here are the leaders:

Rank Player Year 1 Year 2 Y1 BB% Y2 BB% Increase Multiplier
1 Brian Hunter 1996 1997 3.07% 8.94% 5.87% 2.91
2 Alex Gonzalez 1999 2000 2.54% 7.28% 4.74% 2.87
3 Odubel Herrera 2015 2016 5.21% 14.55% 9.34% 2.79
4 Carlos Baerga 1994 1995 2.13% 5.83% 3.70% 2.74
5 Carlos Lee 1999 2000 2.51% 6.14% 3.63% 2.45
6 Ben Revere 2014 2015 2.08% 5.05% 2.97% 2.43
7 Adam Kennedy 2002 2003 3.73% 8.82% 5.09% 2.36
8 Ichiro Suzuki 2001 2002 4.07% 9.34% 5.28% 2.30
9 Alexei Ramirez 2008 2009 3.54% 8.09% 4.55% 2.29
10 Ozzie Guillen 1996 1997 1.89% 4.17% 2.28% 2.20
Hererra ranks 2nd in overall increase in walk rate (thanks to Barry Bonds, king of the intentional walk) and 3rd in percentage increase.  No player has tripled his walk rate in consecutive qualified seasons (since 1980), but the closest was Brian Hunter, who increased his rate from 3.07% in 1996 to 8.94% in 1997, a multiplier of 2.91.

Tuesday, May 17, 2016

NBA Draft Lottery Proposal, Part 1

One of the biggest problems in the NBA is tanking.  While most analysts agree that teams do not necessarily try to lose specific games by missing shots or intentionally turning the ball over, it is evident that not all rosters are constructed to maximize winning percentage in the current season.  The incentive, of course, is to land a high lottery pick in the NBA draft and possibly turn around the fortunes of a team.  While not all lottery picks turn out to be huge assets (see Milicic, Darko), the majority of NBA All-Stars were once taken in the lottery.  In fact, many of the league's transcendent superstars (LeBron, Duncan, Durant, Howard, Rose, Davis) were taken either 1st or 2nd overall.  The draft is typically so top-heavy in the NBA that lottery picks are seen as huge assets while 2nd round picks are just trade throw-ins.  Since a team's odds of winning the lottery increases exponentially with each move downward in the standings, it is logical that some teams (presumably those with little or no shot to make the playoffs) would instead focus on securing the top draft pick.

Currently, the NBA uses a lottery system in which 1000 different number combinations are distributed among the 14 teams that did not make the playoffs.  The team with the worst record owns 250 of the 1000 combinations, and therefore has a 25.0% chance of getting the first pick.  The second worst team gets 199 combinations (19.9%), the third worst team gets 156 combinations (15.6%), and so on, down to the 14th team (which owns only 5 combinations).  At the lottery, a set of 4 ping pong balls is drawn to represent one of the 1000 combinations.  This system, however, is only used to select the top 3 teams in the draft.  After the third pick, the remaining teams chose in the order of worst record to best record, meaning that a team can only move down in the draft by at most 3 spots based on record.

Why doesn't this system work?  Obviously, the franchise-altering stars are rare commodities that every team would covet.  However, being a mediocre team almost guarantees that you will never be able to draft one.  Since 1984 (when the playoffs expanded to 16 teams), only 2 teams lower than a 4th seed have even made it to the NBA Finals (1999 Knicks and 1995 Rockets).  So if lower seeds have a minimal chance of winning a title, what incentive do they have?  Well, simply making the playoffs is good for revenue in the short term, but it doesn't necessarily allow your team to get better.  This is especially true for smaller market teams that have trouble luring free agents to sign with them.  In order to acquire an NBA star through the draft you almost certainly need to be in the lottery.  However, being one of the best teams in the lottery (record-wise) is also no guarantee.  The probabilities are weighted heavily toward the very worst teams such that teams 10 through 14 in the lottery only have a combined 3.7% chance of winning.  In fact, one of the three worst teams should win the lottery 60.5% of the time.  So if you need superstars in the NBA and the easiest way to find one is through the draft (and picking very high in the draft), then it makes sense that teams would employ a strategy of tanking.

What if I told you that there a a relatively easy way to curb the tanking problem with only minor modifications to the current system?  All we have to do is juggle some ping-pong balls and re-assign the probability that each team wins the lottery.  Check out the chart below that shows the current system (red bars) and the proposed one (blue bars): 

Probability of winning lottery based on place in standings for NBA (red) and proposed plan (blue)

As you might notice, there are 3 major changes.
  1. Every team has a chance of winning (including playoff teams).  Playoff teams each have a 1% chance of winning the lottery.
  2. Losing helps you... unless you finish in last.  The team with the worst record has a 3.6% chance of winning the lottery, which ranks as the 9th best probability.  Finishing with the 2nd worst record gives you a 14.4% chance of winning.
  3. Only the teams with the 4 worst records have reduced odds compared to the current NBA system.  Since the distribution is flatter, a lot of the probability that the 4 worst teams would normally receive gets re-distributed to better teams.
Why will this plan work?  First of all, it would definitely reduce the level of tanking in the NBA.  The problem with tanking is that teams construct a roster that is designed to lose games.  Do you want to play with fire?  If your team is worse than every other team, you will severely diminish your lottery odds.  Therefore, if you know you are the worst team, you have the incentive to get better, not worse.  This leads to a cascade effect.  If the worst team starts winning more, it puts pressure on all of the other "bad" teams to avoid the same penalty.  In fact, due to the uncertainty of your own team's true talent level and especially other teams' talent levels, you cannot simply employ a tanking strategy and guarantee that it will actually improve your odds.  Why did I chose the 14.4% and 3.6% for the last 2 teams?  I did several simulations of NBA seasons using these values and found that this ratio (14.4 to 3.6, which is equivalent to 4 to 1) was necessary to prevent any of the bad teams from employing a "losing" strategy.  The second reason this proposal would work is that it still contains many of the same features as the current system.  It still rewards teams that do poorly to establish parity in the league.  It still gives teams a chance to win that do not finish last.  In fact, since 26 of the 30 teams actually see improved chances under the new system, it should be easy to convince owners that it is beneficial.

In Part 2, I will discuss my simulations and possible extensions of this proposal.

Wednesday, October 7, 2015

Settling the NL Cy Young Debate

Let me start by saying that I don't think there is a bad choice this year among the top three candidates: Clayton Kershaw, Zack Greinke, and Jake Arrieta.  I have seen good arguments made for all three, but most of the "all-encompassing" stats have some major flaws.  Jonah Keri nicely summarizes these in his piece on Grantland.  His choice in using the Baseball Prospectus stat called DRA (Deserved Run Average) is a fine one, as it doesn't attempt to quantify how good a pitcher actually is (like FanGraphs WAR tends to do), but rather how good a pitcher has actually done based on results.  I have been working on a similar (albeit much less complicated) stat for a while now that accomplishes a similar goal.  My statistic (which for now I will simply call Adjusted ERA) uses HRs, hits, walks, and a 4th category called EBA (extra bases added) to quantify pitcher performance on an ERA scale.  Similar to Bill James' Component ERA, this stat attempts to remove "cluster luck" (the sequencing of hits and other events) from ERA and give a better indication of how the pitcher performed.  In my version, the EBA component consists of several events (excluding hits and walks) that allow runners to take an extra base (stolen bases and wild pitches, for example) or remove runners that are already on base (pickoffs and double plays, for example).

The top 15 qualified starters in Adjusted ERA for 2015 are:


Based on this, I would have to give a very slight edge to Greinke.  Greinke's ability to suppress extra bases (especially in the running game) gave him the slight edge over Arrieta.


Monday, September 14, 2015

80 Game Score Droughts

As Tristan mentioned in his Geeky Stat of the Day, Rich Hill just posted a Game Score of 84 and hadn't posted another game score of at least 80 since June 7, 2007, a span of 3020 days.  This drought seems pretty long (over 7 years!), but is it the longest?

So far, I have found 2 that are longer since 1914:

Si Johnson had a Game Score of 84 (9 IP, 1 H, 2 BB, 1 K) on May 18, 1933 against the Boston Braves as a member of the Cincinnati Reds.  His next Game Score of more than 80 came 3302 days later (9.05 years) against his previous team (the Reds) as a member of the Philadelphia Phillies.  In this game, he pitched a 10 inning shutout, giving up 5 hits and finishing with a Game Score of 82.

Rip Collins had the second longest span at 3259 days (8.93 years).  The first game was on July 11, 1921 when he shut out the White Sox (9 IP, 5 H, 3 BB, 6 K) as a member of the New York Yankees and the second game came on June 13, 1930 when he shut out the Red Sox (11 IP, 4 H, 0 BB, 2 K) as a member of the St. Louis Browns.

If we change the search to most starts between 80 Game Score games instead of most days, we get the following top 5:
  1. Steve Trout -- 190 starts (1979-1987)
  2. Bump Hadley -- 185 starts (1933-1941)
  3. Livan Hernandez -- 177 starts (2004-2010)
  4. Greg Maddux -- 176 starts (2001-2006)
  5. Tim Wakefield -- 168 starts (1998-2005)
Yes, Greg Maddux was at the end of his career and his game on August 13th, 2006 was his last game with a game score of at least 80.  Interestingly enough, Tim Wakefield's drought came in the middle of his career.  He had 5 games from '95-'98 and 5 games from '05-'08 with a Game Score of 80 or more, but none in between.

If we cheat a little bit and change the criteria to a Game Score of 79 or more, then we have a runaway winner.  Socks Siebold had a Game Score of 79 in one of his only 3 appearances in 1916 (September 24th) and then had a Game Score of 81 on June 11, 1931, a whopping 5373 days (14.72 years!) later.  His streak was aided by his absence in the league from 1920-1928, but that's still an incredible number (and a great name as well).

Thursday, September 3, 2015

Will there ever be a 5 homer game?

As many people probably know, the 4 home run game is one of the rarest feats in baseball.  There have been 16 4-homer games in baseball history, the last of which was Josh Hamilton's monster performance in 2012.  Here are the last 14 instances (since 1914) using the Baseball-Reference Play Index.  In all but one of these games, the player at least had a chance to hit a 5th homer.  Only Carlos Delgado's  4 HR game in 2003 came in exactly 4 plate appearances.  Will we ever see a player hit 5 homers in a game?  I crunched the numbers to find out our chances.

In order to spare people from all of the gory math details, I will try to simplify the explanation.  Let's start with a single player in a single game.  The important numbers we need to know are a player's average home run rate (HR per Plate Appearance) and how many plate appearances he received in the game.  For simplicity, we will assume that each plate appearance is an independent event, i.e. that the likelihood of a home run in one trip to the plate does not affect the next trip to the plate.  With these two numbers, we can determine the probability that he hits any given number of home runs in those plate appearances using the binomial distribution.  For example, let's assume that a player hits a homer in 3% of his plate appearances (the average for the league is currently about 2.8%).  If he gets exactly 4 plate appearances in a single game, his chances are approximately 1 in 1.23 million to homer in all 4 trips to the plate.  However, even giving him just one more chance (4 homers in 5 plate appearances) drastically improves his odds.  This somewhat average power hitter now has a 1 in 253 thousand chance to hit 4 homers in that single game.  If we give him 6 chances, the probability again improves to 1 in 86,400.  

If you thought those odds were bad, now consider the same player hitting 5 homers in 5 plate appearances.  The chances of that happening are 1 in 41.2 million.  But what about a hitter with more power?  A player with a 6% home run rate (for example, a guy like Mike Trout this season) has a 1 in 1.29 million chance to hit 5 homers in 5 chances, which is nearly the same chance that our "average" player has to hit 4 in 4 chances.  The two main conclusions we can make are:
  1. A higher home run rate exponentially increases a player's chances of hitting 5 homers in a a game.  A great power hitter (6% home run rate) is 32 times as likely than an average power hitter (3% home run rate) to hit 5 HR in a game.
  2. An extra plate appearance exponentially increases a player's chances of hitting 5 homers in a a game.  Hitting 5 homers in a game with 6 PAs is 5.85 times as likely as hitting 5 homers in a game with only 5 PAs.
In order to find our chances of any player hitting 5 home runs, we need to consider the league as a whole.  We cannot simply use the average home run rate and assume that every game played in a season features 9 "average" players on each team.  This would actually underestimate our true chances of seeing a 5 HR game.  Likewise, we cannot assume that the average player gets exactly 5 plate appearances in a game.  In both cases, we must consider a distribution of different numbers.  I used the top 250 hitters in terms of total plate appearances to find the distribution of home run rates throughout baseball, ranging from Giancarlo Stanton and Nelson Cruz to Michael Bourn and Eric Sogard.  In addition, I found the distribution of number of plate appearances per game.  It turns out that this eliminates almost 75% of all plate appearances since players are most likely to only have 4 plate appearances in a game (58% of all PAs come in 4 PA games, 16.6% of all PAs come in games with 3 PA or less).

Using all of this data, I created a formula to compute several different estimates given the current offensive environment in baseball:
  • On average, we should see 9.63 3-homer games per year
  • A 4 HR game should happen on average every 5.1 years (19.7% probability)
  • A 5 HR game should happen on average every 405 years (0.247% probability)
So you're saying there's a chance?  Yes, every 405 years seems like a longshot but not everything happens at regular intervals.  We could get lucky.  Using these numbers, there is about a 10% chance that it happens in the next 40 years.  I just hope I am alive when it finally does.

Tuesday, September 1, 2015

Fantasy Focus Podcast Question

Inspired by the Phillies winningest pitcher only having 6 victories this year (Cole Hamels, now a member of the Rangers), the following question was asked:

Which team's winningest pitcher had the lowest season win total, and how many wins did he have?

If we restrict the search to only starting pitchers (who started in 60% of the games they played), the answer for the lowest win total is 6, which has happened 3 times:

  • The 1957 Kansas City Athletics had 2 starters with 6 wins, Ned Garver (6-13) and Alex Kellner (6-5).  This result, however, is dubious for several reasons.  Based on the search criteria, 5 pitchers are eliminated that started at least 7 games because they also appeared frequently as relievers.  In fact, 4 of these 5 relievers had at least 7 wins [Tom Morgan (9-7), Jack Urban (7-4), Virgil Trucks (9-7), and Wally Burnette (7-12)].  Also, the Athletics only played in 153 games that year, giving them less chances to get wins than the current 162 game schedule.
  • The 1997 Oakland Athletics (featuring the Bash Brothers) had one starter with 6 wins, and that was Ariel Prieto (6-8).  That A's team was pretty bad (69 wins as a team), but the biggest contributing factor was probably that they had 9 starters make at least 10 starts and no starter with more than 24 starts.  I'm sure their 5.48 team ERA didn't exactly help either.  The team leader in wins was actually reliever Aaron Small, who had 9 wins and 5 losses.
  • The 2012 Colorado Rockies had only one starter with 6 wins as well, and that was Jeff Francis (6-7).  Just like the '97 A's, the Rockies were a bad team (64 wins) with a terrible staff ERA (5.22).  Coincidentally, they also had exactly 9 pitchers with 10 or more starts (including a 49 year old Jamie Moyer) and no starter with more than 24 starts.  The leader on the team in wins was actually Rex Brothers, who finished with an 8-2 record from the bullpen.
If we change the search to all pitchers (starters and relievers), the answer is 7, which has happened 4 times (although the 2015 Phillies have a decent shot at taking this record):
  • The 1981 New York Mets had two pitchers with 7 wins-- starter Pat Zachry (7-14) and closer Neil Allen (7-6).  However, this was a strike-shortened season so it really should not count.
  • The 1987 Cleveland Indians had three pitchers with 7 wins-- the Candy Man Tom Candiotti (7-18),  48 year old knuckleballer Phil Niekro (7-11), and reliever Scott Bailes (7-8)
  • The 1996 Detroit Tigers had one pitcher (Omar Olivares) with 7 wins.  I'd say that's not too bad considering the team only won 53 games all season.
  • The 2013 Houston Astros, also historically bad with 51 total wins, had one pitcher (starter Jordan Lyles) with 7 wins.