xWHIP 2.0: The Next Generation

The following article is from my most recent article for The Hardball Times.

A few months ago, I debuted the first version of the expected WHIP (xWHIP) calculator, which took a pitcher's batted ball distribution and, in determining an expected number of hits, calculated that pitcher's expected WHIP. The tool was tinkered with and refined until version 1.4.3 was released and that, until now, has been the primary xWHIP tool available. xWHIP 1.4.3 overexpected WHIP a bit, but was otherwise pretty solid. Especially for relative comparison purposes, xWHIP 1.4.3 was a useful fantasy tool.

Not long ago, I was introduced to a fellow stathead by the name of Martin Alex Hambrick. He had done some number tinkering similar to what I had done independently with the xWHIP calculator, and he had an idea. He brought that idea to my attention, and from it a new formula for expected xWHIP was born.

Alex's idea was that a pitcher's actual innings pitched (aIP) are as much the by product of luck as expected hits (xHits). The theory is that a medley of defense, umpires, errors, random luck and the like skew the length of innings. The pitcher, for example, does not particularly control dropped third strikes by his catcher.

This idea is somewhat captured in the K% (K/TBF) and BB% (BB/TBF) movement of sabermetrics that rejects K/9 and BB/9 because the length of innings is largely out of the control of the pitcher, thereby skewing both K/9 and BB/9. Accordingly, we began work on a new denominator for xWHIP that incorporated an expected innings (xIP) total based on a pitcher's outs-creating events.

With this idea in mind, we began work on a new xWHIP calculation. Law school delayed my work on a final formula until this week, but with "way too much time on my hands" (i.e., any lawyers out there need a law clerk for the summer?), I finally got around to hammering out a reliable formula and user-friendly interface, calibrated to Baseball Info Solutions (BIS) data.

The current formulation for expected innings is as follows:

xIP = ((K*1.000075)+((BB-IBB+HBP)*0.00016)+((0.808)*GB)+((0.278)*LD)+((0.992)*IFFB)+((0.745)*OFFB)+(0.020099*(BB+HBP+xH)))/3

The coefficients in the above formula represent the expected outs by event rate. You might notice the two percent adjustment applied to both modified walks (BB-IBB+HBP) and expected hits (xH). That figure represents a ten-year average outs-per-runners-put-on-base rate (ORB). ORB encapsulates the ten-year league average pickoff and caught stealing rates.

Because catcher defense and a pitcher's pickoff talents are difficult to measure, and also not widely available, using a league average rate helps make the calculator more accessible. The final xWHIP figure should be mentally modified based on one's own perception of a catcher's pickoff ability or a pitcher's pickoff ability. If Jason Varitek is the catcher, you might want to raise the pitcher's calculated xWHIP, while the opposite would be true for those pitchers handled by Yadier Molina.

Alex is working on a simplified "Quick xWHIP" formula that simplifies the xWHIP calculation even further, to the point that you could do it on a calculator. He'll tell you more about that (and the accuracies of both xWHIP 2.0 and Quick xWHIP) in a (near-) future post. All I can say for now regarding the calculator's accuracy, at least to some degree of certainty, is two things. First, xWHIP works best—that is to say, it is most predictive—when you use multi-year data rather than year N-1 data. Second, the R^2 of the data seems to be solid for a predictive state.

Someone once told me (or maybe I just read it somewhere) that an R^2 of .30-.35 is strong for a predictive stat, while a .60 or greater R^2 is what is required of an evaluative stat. Using 2007 xWHIP 2.0 to predict 2008 actual WHIP resulted in an R^2 of .34 amongst the 78 pitchers who faced a minimum of 500 batters, compared to an R^2 of .26 for 2007 actual WHIP. Likewise, using 2008 xWHIP to predict 2009 actual WHIP resulted in an R^2 of .36 amongst the 80 pitchers who faced a minimum of 500 batters, compared to an R^2 of .30 for 2008 actual WHIP.

Strangely, however, using 2009 xWHIP to predict 2010 xWHIP amongst the 82 pitchers who accrued 500+ total batters faced merely resulted in an R^2 of .15 (compared to a .14 R^2 for 2009 actual WHIP). Maybe I crunched the 2009-2010 data incorrectly. Maybe this is a sample size issue. Maybe not. As I mentioned above, Alex will supply more details on the accuracy of xWHIP 2.0 shortly.

I also tinkered some with the expected hits formula, but the changes are relatively minor and hardly warrant discussion. The important thing to note about the new xWHIP tool is that it is now calibrated per the past five years of BIS data rather than Game Day. I have done this because I believe that Fangraphs utilizes BIS, not Game Day, as their source for ball in play (BIP) data. Accordingly, this should make the tool more accurate for the average user. Most of the data stood relatively stable, but here are the new expected hits by batted ball types:
  • Popups: .004
  • Groundballs: 0.236
  • Outfield Flyballs: 0.250
  • Line Drives: 0.716
These data points include home runs, which is why the Outfield Flyball expected hits rate is so high. If you take home runs out of the equation and account for them separately (as the xWHIP calculator does), the expected hits rate, per BIS, for Outfield Flyballs and Line Drives falls to .158 and .714, respectively.

You can download the new xWHIP tool, version 2.0, by clicking here. The password to utilize the xWHIP tool is still "soto 18" and the batted ball data you will need to plug in can be found at Fangraphs.com.

Picture below is a screenshot of the xWHIP 2.0 tool, which was used in my Zack Greinke forecast article. For explanatory purposes, this screenshot has the 2010 numbers of Roy Halladay plugged in.


As the instructions on the tool indicate, the gray cells are for data you should manually input. The magenta park factor cell is also a manual data cell, though the number should be left at "1.00000" unless you have the relevant park factor HR/FB index figure. You should not enter any data into any of the blue, green or yellow-orange cells.

The green cells feature the line drive-regressed expected-ball-in-play data. The yellow-orange cells display the expected innings, expected hits and expected WHIP for the pitcher, irrespective of defense. If you enter data into the Team Innings Pitched and Team UZR gray cells, then the blue cells will display a crude defensive adjustment to the expected hits total, assuming uniform defense and that all saved hits would be of the singles variety. All of the data cells are pre-formatted to visually round all numbers to keep the sheet clean, though cells will retain the full value of any number entered.

I also included a cell for xWHIP 1.4.3, calibrated from Game Day to BIS, in case people wanted to know a player's expected WHIP using expected hits and actual innings, rather than expected innings.

I hope everyone enjoys this. If you have any questions/concerns/comments/criticisms, please post them in the comments below or email them to gameofinchesblog@gmail.com, with the subject line "xWHIP 2.0 Calculator."

On a final note, I would like to give a special thank you to several of my THT colleagues who have been invaluable in the creation of the xWHIP 2.0 tool. Without the assistance of Derek Carty, Dave Studemund, and Harry Pavlidis, none of this would have been possible. I apologize to each of you for my incessant e-mailing in attempt to work out the mathematical kinks in the formula.

0 comments: