# Tagged: prediction

# Predicting HR/FB rates for hitters using weighted pitch values

(If you care only about results and not about the process, scroll down to the section aptly titled **HERE YA GO**.)

**Victor Martinez** indirectly and semi-strangely inspired this post. I was browsing FanGraphs’ weighted pitch values for hitters — something I hadn’t done before, as I’ve really only used the metric for pitchers — for 2014 and my thought process went something like that:

*Jose Abreu feasted on fastballs; V-Mart feasted on sliders… Wow, V-Mart actually fared better against sliders and curveballs than fastballs and cutters. I wonder if that has any correlation with his plate discipline.*

In short: no. A hitter’s success versus pitches according to weighted pitch values (per 100 of that pitch) determines about 40 percent of his walk rate and barely 4 percent of his strikeout rate. (I’m ballparking it on the K% figure.)

But I got to thinking a little more: these weighted pitch values have to be good for *something* other than scouting hitters (which, moving forward, maybe we starting throwing Abreu some more offspeed stuff? I don’t know).

Alas, I took a crack at it: I tested the correlation between weighted pitch values and home runs per fly ball (HR/FB) rates. And I was very pleasantly surprised.

Let’s start with context. Each player, very obviously, records his own HR/FB rate each year. Players with more power will record higher HR/FB rates, and players with less power will record lower rates. Therefore, each player, in a sense, creates his own benchmark (which, arguably, is his career HR/FB rate: he hits this many home runs as a percentage of fly balls *on average*). However, we know that HR/FB fluctuates annually: a player with a 15% career-HR/FB does not hit exactly 15 of every 100 fly balls over outfield walls every season like clockwork. Still, there is an *expectation* that he will hit a certain number of them out — hence, the benchmark.

Using regression analysis, the idea of the benchmark can be captured by seeing how, say, 2014’s HR/FB rates correlate with 2013’s rate, as well as 2012’s, 2011’s and so on. I downloaded all available ball-in-play data for seasons by “qualified” hitter as separate seasons dating back to 2002, thereby representing an exhaustive list. The line of best fit looks as follows, where L1 represents the year prior, L2 two years prior, L3 three years prior:

**x(HR/FB) = .018 + .321*L1.(HR/FB) + .252*L2.(HR/FB) + .228*L3.(HR/FB)
Between R-squared: .74**

One might astutely observe that a player who hit exactly zero home runs the three previous years can still be expected to hit about 1.8 percent of his fly balls over the wall, and one might call to arms to force the intercept term to zero. It seems absurd, nay, impossible that a player who never hits home runs could be expected to suddenly hit one, but let us not forget we witnessed the impossible happen just last year. That’s what makes baseball a beautiful sport: anything can happen.

Anyway, the equation above is actually really helpful in predicting expected HR/FB; its R-squared indicates the line explains almost three-quarters of the model’s fit. It also bestows the greatest significance to the most recent year as measured by its coefficient, with declining significance associated as years become further removed, which makes sense. But… BUT.

It’s not helpful in predicting HR/FB for hitters who have only been in the league fewer than three years. Moreover, it seems especially difficult to predict future HR/FB rates for hitters with only one year of data, such as the monstrous Abreu. (Maybe Abreu *did* inspire this post after all.) Observe:

**x(HR/FB) = .032 + .694*L1(HR/FB)**

After a little bit of algebra, we can intuit that the equilibrium HR/FB rate is roughly 10.4 percent. I use the term “equilibrium” because it appears that no matter what HR/FB a hitter posted in his first career season, his next-year HR/FB will be expected to converge (aka regress) toward the magical number of 10.4 percent. Again, observe:

.032 + .694*(12%) = 11.5%

.032 + .694*(8%) = 8.7%

You can perform this exercise with any value, and the results will be the same: a 2014 HR/FB rate lower than ~10.4 percent will be expected to increase in 2015, and a rate higher than ~10.4 percent will be expected to decrease in 2015. Now this, *this*, is actually absurd. Granted, the equation is communicating what would happen *on average*, but hitters are not homogeneous.

This is all a very long-winded way of saying two things:

1) When the sample is incredibly small — namely, one observation — using history as a guide fails us.

2) I think I may have found an alternative that relies not on a single year’s worth of HR/FB data but on a single year’s worth of weighted pitch value data.

## HERE YA GO

Let me be clear, up front: I know there will be a lot of multicollinearity inherent in this analysis — that is, HR/FB and weighted pitch values are dependent on each other in some fashion. I don’t know how weighted pitch values are calculated exactly — it would behoove me to look it up, but I am lazy, a current self-descriptor of which I am not proud — but, intuitively, a hitter who hits home runs more frequently off of particular pitch types will likely record higher weighted values for those pitches. Essentially, the weighted values are calculated *using* home run frequency, and I am now trying to reverse-engineer it.

But I don’t see that as a bad thing. There is a profound correlative capability in the data, and using that information to glean whether or not a hitter was, perhaps, a bit lucky when it came to his HR/FB frequency is, I hope, less preposterous than pulling a number out of your rear-end.

## HERE YA GO, FOR REALSIES

I will use strictly weighted pitch values per 100 pitches (denoted wXX/C, where XX represents the pitch abbreviation). I omit knuckleballs because not all players saw them, and I omit splitfingers because they are statistically insignificant, probably because they aren’t thrown very often, rendering the weighted pitch values more volatile. I also add K% and BABIP presuming the following: strikeout rates are positively correlated with HR/FB rates, and BABIP, which positively correlates with hard-hit balls such as line drives, is likely to also positively correlate with similarly-hard-hit balls such as home runs. (A regression that includes only weighted pitch values and excludes K% and BABIP produces an adjusted R-squared of .45.) The line of best fit equation is as follows:

**x(HR/FB) = .2049 + .0352*(wFB/C) + .0081*(wSL/C) + .0014*(wCT/C) + .0041*(wCB/C) + .0063*(wCH/C) + .5244*K% — .6706*BABIP
Adjusted R-squared: .75**

Again, the model produces a great line of best fit per its R-squared — almost identical to its lagged-variable counterpart. As it should; if there’s multicollinearity, it should. (And there is.) But reverse-engineering the process should create accurate predictions of what should have been a hitter’s HR/FB rate in a given season *because* of the multicollinearity; in this instance, it’s not a bad thing.

Some trends emerge instantly, trends similar to those I saw in the xK% and xBB% studies I performed earlier: regardless of a player’s power potential, he will over-perform or under-perform his expected HR/FB rate, and he will do so with consistency. For example, Adam LaRoche, despite his apparent power stroke, consistently under-performs his xHR/FB:

HR/FB: actual minus expected

2010: -1.89%

2012: -1.87%

2013: -1.77%

2014: -0.75%

Meanwhile, **Albert Pujols** consistently out-performs his xHR/FB:

2010: +2.02%

2011: +5.67%

2012: +1.80%

2014: +2.13%

Each data set has its noise, but you can see based on these limited samples where each hitter experienced a bit of luck: LaRoche, in 2014, saw a minor spike, and Pujols saw a major spike in 2011.

Rather than going through each player individually, I will highlight a few extreme, fantasy-relevant outliers from 2014 and reflect accordingly. Without further adieu (and in alphabetical order by first name):

** Adam Eaton, -8.03%
**This is the largest negative differential in the 2014 data. Without another full season of data to compare, this huge difference is likely a sign of bad luck, although there

*is*a chance that he is a severe under-performer in the same vein as

**Matt Carpenter**(who has under-performed his xHR/FB by about 7 percent the past two years). I already liked the guy for his speed and control of the strike zone, and the prospect of a pending power spike is enticing.

** Coco Crisp, -5.78%
**Crisp is a great case study: he notched a career-high 12.4-percent HR/FB in 2013, then promptly slid back down to single digits in 2014. His 2014 xHR/FB, however, indicates his HR/FB should have been closer to 11.5 percent, almost 6 percent higher than his actual mark and only 1.2 percent less than 2013. Meanwhile, his 2012 and 2013 expected and actual HR/FB rates are almost identical. His power-speed combination was pretty valuable two years ago — when he wasn’t on the disabled list, at least.

** Curtis Granderson, -5.92%
**Granderson bottomed out in woeful aplomb last year, but his xHR/FB offers a glimmer of hope. I’ll be honest, though, I can’t remember the last time this guy was fantasy relevant. But if you’re looking for sneaky power at the expense of everything ever, he could be your guy.

** Giancarlo Stanton, +5.33%
**The Artist Formerly Known as Mike posted positive differentials in 2011 and 2013, but each was one-half and one-third the magnitude of last year’s differential. His 2013 and 2014 xHR/FBs are practically identical — 20.16% and 20.17% — so it looks like Stanton chose a good year to get a little bit lucky.

** Jason Heyward, -5.56%
**Speaking of bottoming out, Heyward’s power all but evaporated last year. Fear not, however, as his 2014 xHR/FB is only 4 percentage points less than 2013’s — which still sucks, but at least it’s not as bad as a whopping 10 percentage points. It’s probably too obvious to count on a comeback, but no matter.

** Jason Kipnis, -4.39%
**His year-by-year differentials: -0.01%, -2.61%, -4.39%. His year-by-year xHR/FB: 9.71%, 15.01%, 9.19%. I don’t know what to believe, really, because it’s hard to tell what’s real here and what’s not. But, again, here ye beholdeth another bounceback candidate.

** Jonathan Lucroy, -3.77%
**His 2014 xHR/FB was a percentage point better than 2013’s. The dude is too good.

** Jose Abreu, +8.52%
**Now this man, THIS MAN, is the real reason why we’re all here. What can we make of that? We know that prodigious power hitters such as Pujols and Stanton can exceed expectations. But this expectation is set pretty high. I think we’re all expecting regression, but it’s everyone’s best guess as to how much. I’m thinking a drop from 27-ish percent closer to a

**Chris Davis**-esque 22 percent.

** Lucas Duda, -3.38%
**I don’t have any other reliable full-season data for Duda to compare, but at least it wasn’t a positive differential. The negative implies that last year’s breakout was probably legit — and maybe there’s still room for improvement.

** Matt Adams, -3.49%
**Similarly to Duda, Adams’ only full season came last year. But the mammoth power we saw in 2013 didn’t disappear as much as it did suffer some bad luck. His 2014 xHR/FB of 12.19 percent still isn’t where any of us would like it to be, but again, maybe there’s still room for improvement.

** Matt Holliday, -3.09%
**Holliday, who perennially

*out-*performs his xHR/FB, appears to have gotten pretty unlucky last year. Of the last five years (dating back to 2010), 2014’s xHR/FB was right in the middle. I know he’s getting old, but man, he’s a monster, and I think there’s juice still in the tank.

** Nick Castellanos, -5.20%
**Might be a little more pop in that bat than we know.

** Nori Aoki, -6.08%
**His power simply vanished, but the xHR/FB is in line with past years. He could return to his 10-HR, 25-SB ways in short order.

** Robinson Cano, +2.33%
**This is my absolutely favorite result in the entire 2014 data set. Cano always out-performs his xHR/FB; that part does not concern me. It’s the xHR/FB itself: it dropped off almost 7 percent from 2013 to 2014. Seven percent! Say what you will about Safeco Field sapping power, but methinks a larger share of that 7 percent is a 32-year-old man in decline.

** Xander Bogaerts, -3.88%
**See Castellanos, Nick.

** Yasiel Puig, -4.58%
**Remember how Puig hit way fewer home runs last year and all that stuff? Hey, I traded him midseason (he will cost only $13 next year, but I won my league so it all works out) for

**Carlos Gomez**and a closer. In the moment, I think I made the right move: Puig’s home run rate never really improved. But his 2013 differential was +5.24%. Cutting the crap, his 2013 and 2014 xHR/FB rates were 16.56% and 15.68%, respectively — smack-dab in the middle of both years. Thus, taking the average of the two may not be such a bad method for projection after all.

OK, that’s everything. The players listed above were merely a sample and are by no means exhaustive when it comes to the peculiar splits I saw. More importantly, the implications are most interesting where they are hardest to draw: players such as Abreu and Eaton very clearly seem to have benefited (and suffered) at the hands of luck, and we can surely expect regression. But… how much? ‘Tis the question of the day, my friends.

*Edit (1/8/15, 11:42 am): FanGraphs’ Mike Podhorzer, who coincidentally posted a xHR/FB metric for pitchers today, developed a similar metric for hitters a while back, to the tune of a .65 adjusted R-squared. I feel pretty good about my work now.*

# Predicting pitchers’ strikeouts using xK%

Expected strikeout rate, or what I will henceforth refer to as “xK%,” is exactly what it sounds like. I want to see if a pitcher’s strikeout rate actually reflects how he has pitched in terms of how often he’s in the zone, how often he causes batters to swing and miss, and so on. Ideally, it will help explain random fluctuations in a pitcher’s strikeout rate, because even strikeouts have some luck built into them, too.

An xK% metric is not a revolutionary idea. Mike Podhorzer over at FanGraphs created one last year, but he catered it to hitters. Still, it’s nothing too wild and crazy like WAR or SIERA or any other wacky acronym. (A *wackronym*, if you will.)

Courtesy of Baseball Reference, I constructed a set of pitching data spanning 2010 through 2014. I focused primarily on what I thought would correlate highly with strikeout rates: looking strikes, swinging strikes and foul-ball strikes, all as a percentage of total strikes thrown. I didn’t want the model specification to be too close to a definition, so it’s beneficial that these rates are on a per-strike, rather than per-pitch, basis.

The graph plots actual strikeout rates versus expected strikeout rates with the line of best fit running through it. I ran my regression using the specification above and produced the following equation:

**xK% = -.6284293 + 1.195018*lookstr + 1.517088*swingstr + .9505775*foulstr
R-squared = .9026**

The R-squared term can, for easy of understanding, be interpreted as how well the model fits the data, from 0 to 1. An R-squared, then, of .9026 represents approximately a 90-percent fit. In other words, these three variables are able to explain 90 percent of a strikeout rate. (The remaining 10 percent is, for now, a mystery!)

In order for the reader to use this equation to his or her own benefit, one would insert a pitcher’s looking strike, swinging strike and foul-ball strike percentages into the appropriate variables. Fortunately, I already took the initiative. I applied the results to the same data I used: all individual qualified seasons by starting pitchers from 2010 through 2014.

The results have interesting implications. Firstly, one can see how lucky or unlucky a pitcher was in a particular season. Secondly, and perhaps most importantly, one can easily identify which pitchers habitually over- and under-perform relative to their xK%. Lastly, you can see how each pitcher is trending over time. Every pitcher is different; although the formula will fit most ordinary pitchers, it goes without saying that the aces of your fantasy squad are far from ordinary, and they should be treated on an individual basis.

(Keep in mind that a lot of these players only have one or two years’ worth of data (as indicated by “# Years”), so the average difference between their xK% and K% as a representation of a pitcher’s true skill will be largely unreliable.)

It is immediately evident: the game’s best pitchers outperform their xK% by the largest margins. **Cliff Lee**, **Stephen Strasburg**, **Clayton Kershaw**, **Felix Hernandez** and **Adam Wainwright** are all top-10 (or at least top-15) fantasy starters. But let’s look at their numbers over the years, along with a few others at the top of the list.

Kershaw and King Felix have not only been consistent but also look like like they’re getting better with age. Wainwright’s difference between 2013 and 2014 is a bit of a concern; he’s getting older, and this could be a concrete indicator that perhaps the decline has officially begun. Darvish’s line is interesting, too: you may or may not remember that he had a massive spike in strikeouts in 2013 compared to his already-elite strikeout rate the prior year. As you can see, it was totally legit, at least according to xK%. But for some reason, even xK% can fluctuate wildly from year to year. I see it in the data, anecdotally: **Anibal Sanchez**‘s huge 6.7-percent spike in xK% from 2012 to 2013 was followed by a 5.5-percent drop from 2013 to 2014. Conversely, **David Price**‘s 5-percent decrease in xK% from 2012 to 2013 was followed by an almost perfectly-equal 5-percent increase from 2013 to 2014. So the phenomenon seems to work both ways. Thus, perhaps it shouldn’t have come as a surprise when Darvish couldn’t repeat his 2013 success. To the baseball world’s collective dismay, we simply didn’t have enough data yet to determine which Yu was the true Yu. I plan to do some research to see how often these severe spikes in xK% are mere aberrations versus how often they are sustained over time, indicating a legitimate skills improvement.

I have also done my best to compile a list of players with only one or two years’ worth of data who saw sizable spikes and drops in their K% minus xK% (“diff%”). The idea is to find players for whom we can’t really tell how much better (or worse) their actual K% is compared to their xK% because of conflicting data points. For example, will **Corey Kluber** be a guy who massively outperforms his xK% as he did in 2014, or does he only slightly outperform as he did in 2013? I present the list not to provide an answer but to posit: Which version of each of these players is more truthful? I guess we will know sometime in October.

**Name: [2013 diff%, 2014 diff%]**

**Andrew Cashner**: -0.45%, +0.71%**Chris Archer**: -1.60%, -0.43%- Corey Kluber: +0.62%, +3.30%
**Garrett Richards**: -0.80%, +0.35%**Hector Santiago**: -3.44%, -1.70%- Hyun-Jin Ryu: -0.10%, +1.11%
**Tyson Ross**: -0.17%, -1.46%

And here some fantasy-relevant guys with only data from 2014:

**Alex Wood**: +1.25%**Drew Hutchison**: +1.25%**Drew Smyly**: -2.32%**Jarred Cosart**: -1.84%**Marcus Stroman**: +0.95%**Masahiro Tanaka**: +1.81%**Matt Shoemaker**: +1.14%**Sonny Gray**: +1.23%**Zack Wheeler**: -1.45%