## Wednesday, March 14, 2012

### BA/OBA/SLG Calculus, pt. 1

I wrote a series of posts about OPS four years ago entitled "Beating a Dead Horse". Among serious sabermetricians, there is a consensus that OPS is flawed, and the only disagreement is whether the consequence of its flaws should be banishment to the dustbin of history or mere consignment to back of the envelope computations. In writing about the odd construction of OPS again, it may look as if I'm trying to rebuke someone. That is not the case--while it's more math than baseball, I find what follows interesting and perhaps some of you will too.

The easiest way to examine how a non-linear metric values each event is to take the partial derivative of the metric with respect to each event. I have gone through this exercise for OPS in the past, but in doing so have focused on looking at OPS from the perspective of a complete counting stat line. This time, I am looking at it from a rate perspective while holding the ratio of at bats to plate appearances constant.

If you look at the totals and attempt to differentiate, you have to account for the fact that every change in an offensive event also changes the PA total and (unless it is a walk) the AB total. By treating AB/PA (which I'll call AB%) as a constant, we can focus solely on how the change in rates of positive events effect OPS. In doing so, we'll be able to restate OPS for a given AB% as a mathematically equivalent PA-weighted metric.

Let me define s, d, t, hr, and w as the respective rates of singles, doubles, triples, homers, and walks per PA. For the purpose of this post PA = AB + W. One could easily include hit batters and sacrifice flies if they were so inclined.

Given these new definitions, we can write:

OBA = (H + W)/(AB + W) = s + d + t + hr + w
SLG = TB/AB = (s + 2d + 3t + 4hr)/AB%

Then we can differentiate each of these equations with respect to s, d, t, hr, and w. In the case of OBA, the derivative is 1 for each event. For SLG, the derivative is equal to AB% (remember, AB% is being treated as a constant) times the total base weight of the event (1 for a single, 2 for a double, etc.). Let me call the total base weight of an event TBw:

dOBA (s, d, t, hr, w) = 1
dSLG (s, d, t, hr, w) = TBw/AB%

So it follows that dOPS = 1 + TBw/AB%, and using this formula we can write OPS in the form of (coeff*S + coeff*D + coeff*T + coeff*HR + coeff*W)/PA where coeff is each event's respective dOPS.

The practical implication of this is that the sole variable factor in determining the OPS weight of an event is the player's AB%. Or, put another way, his walk rate (since 1 = AB% + w). To put this in practice, let's consider the OPS weights for three AB%s--the player with the highest AB% in the 2010 AL (AJ Pierzynski, 96.93%), the player with the lowest (Jim Thome, 82.14%), and the major league average for 2010 (88.59%).

First, the OPS weights for the major league average:
W coeff = 1 + 0/.8859 = 1
S coeff = 1 + 1/.8859 = 2.129
D coeff = 1 + 2/.8859 = 3.258
T coeff = 1 + 3/.8859 = 4.387
HR coeff = 1 + 4/.8859 = 5.515

As mentioned above, this means that a precise alternate formula for OPS given a fixed AB% of 88.59% is:

OPS = (W + 2.129S + 3.258D + 4.387T + 5.515HR)/(AB + W)

This table gives the coefficients for the AB% level represented by Thome and Pierzynski. It also includes calculations of what each player's OPS would be if the weights from the other AB% level were applicable: The calculation of OPS using weights for a different AB% is a misleading exercise, since AB% is not actually a constant. I include it to illustrate that each possible AB% results in a different set of intrinsic event weights.

There is nothing inherently wrong with different weights for a different set of inputs. It can be a very useful property of a metric, as is the case with Base Runs, or with a Markov model of run scoring, or other dynamic estimators. However, I believe that it is crucial that if there is dynamism at work in a metric, it must serve some purpose. What could be called a "false dynamism" adds nothing and requires metrics to be employed with additional caveats.

An example of false dynamism was the old Clay Davenport Equivalent Runs methodology. EqR is fully linear if a player attempts no steals, but stolen base attempts alter the intrinsic weights of all events.

The false dynamism of EqR was of a much lesser magnitude than the OPS case, and thus was more of an annoyance than a damning flaw. In the case of OPS, the damning flaw of the metric is a failure to properly weight OBA, but the false dynamism caused by the different denominators is another serious black mark against it.

Given the intrinsic weights of OPS, we can compare OPS' relative weighting of each event to the weighting used by a good linear weights-based metric. This is a tricky subject because one must first determine what purpose OPS will be used for. If you plan to convert OPS into an estimate of runs scored, then you should perform this type of analysis after the conversion has been made, and the comparison should be to standard linear weight values (this is the type of OPS analysis I have published previously). However, if you plan to use straight OPS as a measure of overall batter productivity, it makes more sense to contrast it to a metric that similarly attempts to measure overall batter productivity with a denominator of plate appearances.

Tangotiger's wOBA is such a metric. The relative weights of events look a little different than those procured from standard linear weights, but that is a result of re-casting the value of each event as the standard linear weight value plus the absolute value of an out. As such, it uses a R+/PA perspective on the ultimate batter rate stat rather than the more common R/O approach. The differences between the two schools of thought is a series of posts unto itself, but suffice it to say that this is the necessary approach if you'd like to express overall productivity with a denominator of PA and without making any debits for outs in the numerator. Since that is the construction of the alternate OPS derivation here, wOBA is the proper comparison.

A basic wOBA formula (without the 15% boost to match the OBA scale) is:

(.62W + .77S + 1.08D + 1.37T + 1.70HR)/PA

The chart below recasts those weights as relative to that of a walk (.62) and compares it to the three different 2010 OPS results discussed above (average, Pierzynski high AB% extreme, Thome low AB% extreme): This chart makes what we've observed already stick out like a sore thumb--OPS severely undervalues walks. Unfortunately, that makes the relationships between the hit types harder to see at a glance, so allow me to recast the chart as each event's weight relative to that of a single: This chart suggests that while the most egregious weighting centers around walks, OPS still overvalues extra base hits, and thus slugging average. This is of course a common criticism of the metric and one that is addressed by a number of fixes. Also note that while a lower AB% results in even higher weighting for power, it results in lower relative weighting for walks. In this manner, the pro-power and anti-walk biases of OPS offset each other to some extent for players with high secondary averages. The players that really have the potential to lose out are those that draw walks without hitting for power. The players that stand to benefit the most are those that hit for power but do not draw walks (I'm going to refrain from naming names, but there is a certain, much-debated, recent inductee to the Hall of Fame that fits this description nicely).

In re-reading this a year after I originally wrote it, I think I need to repeat myself a little bit to emphasize something. The formulas in this post are not estimates of OPS. They are precise, equivalent formulas to calculate OPS given that AB% is held constant. In the past, the work I’ve done with OPS derivatives has always attempted to capture the dynamic nature of AB%. Every plate appearance (excluding sacrifices) moves AB% one way or the other--down with a walk/hit batter/interference, up with anything else, and thus the equivalent formula for OPS is never constant for any entity. But at any moment in time, the equations in this post are mathematically equivalent formulas for OPS.

Frankly, I’m amazed I never thought of differentiating OPS this way before. It results in a much more easily explained and useful in practice result, and the math is actually easier (although none of the calculus I’ve ever posted on this blog is hard if you know what you’re doing).

So keep in mind that the intrinsic weight OPS places on each event changes every plate appearance. Unlike a dynamic run estimator that changes intrinsic weights continuously in an attempt to model the dynamics of the run scoring process, OPS changes weights just because someone draws a walk or doesn’t.

In the next installment, I will apply this differentiation approach to a couple of the OPS variants (such as OPS+ and GPA) which attempt to address these issues by weighting OBA more heavily.

1. 2. 