Wednesday, June 23, 2021

Rate Stat Series, pt. 6: Rate Stats for Linear Weights I

Last time, I attempted to demonstrate that linear weights producing a result in terms of runs above average properly account for the value of extra plate appearances created by a batter. From here on, I will talk about this contention in the same way as I would any scientifically-demonstrated fact, even though I admit that I have not provided a “proof” in the mathematical sense. The casual use of language is intended to prevent wasting space repeating myself rather than an attempt to claim a more robust result than is appropriate.

Since we have demonstrated that LW_RAA captures the player’s direct and indirect contributions to team offense (at least within the linear framework of metrics), I would contend that it follows that any linear weights-based rate stat we should propose must return the same RAA as we would get from eschewing a rate stat altogether and just applying our linear weights formula with the “-.3 type out value”.  One very simple way to do that is to simply use RAA, rather than a measure of absolute runs created, as the numerator for the rate stat. In this case, the obvious denominator is plate appearances.

Using outs in the denominator would be appropriate for a team metric, but for an individual would overstate the value of his PA generation. For a simple demonstration of this, recall from part three the equation:

PA/G = (O/G)/(1 – OBA)

and the equivalent PA = O*(1 – OBA), given our simple definitions which as a refresher are PA = AB + W, O = AB – H, and OBA = (H + W)/(AB + W)

This direct relationship between plate appearances, outs, and OBA means that if we were to use outs as the denominator rather than PA, we would be inflating the rates for players with higher OBAs, even though we’ve already demonstrated that the PA generation impact of higher OBAs is captured in the numerator (RAA).

Here were the top and bottom 5 performers in terms of RAA/PA, which for ease of use I have restated as RAA/650 PA (This works out to 152.5 full games for a player getting 1/9 of an average 1994 AL team’s PA; sadly, these teams didn’t get anywhere close to playing a 162 game season. There’s no special significance to 650 other than that it is a round number that is reasonably close to the number of PA a full-season batter might accumulate):


You may have noticed that the identity and order of these players did not change from when we used a fully dynamic approach that treated them as if they were their own teams (BsR/O). This recalls a simple truth that I am burying beneath thousands of words of minutia – any reasonable approach will reach similar conclusions for the majority of situations. Even a poorly designed, indefensible metric like OPS will get you 98% of the way there. This series is about the tiny differences that lie beyond that point and the larger differences that arise in values as opposed to rank order.

To wit, while the rank order remains the same, the RAA values are different using linear weights, and with the exception of Griffey, less extreme. All of the other players have moved closer to average, with Frank Thomas losing a whopping 7.7 RAA due to using a linear approach rather than imagining an entire lineup of Big Hurts.

At this point, we could stop, and simply use RAA/PA or RAA/650 PA as our final linear weights-grounded rate stat. However, it lacks the very useful trait of ratio comparability that would be desirable in the ideal rate stat. While linear differences in RAA/PA can be compared (e.g. Thomas contributed an additional .081 RAA/PA beyond what Chili Davis did), the ratios are not particularly useful. Consider two players who each had 600 PA, one contributing +1 RAA and the other -1 RAA. If you can explain the practical baseball interpretation of the resulting ratio of -1, be my guest.

This happens because we have applied the high baseline of average to the metric. However, we have another version of linear weights that is based on absolute runs from which we could build a rate stat. Remember that in order to qualify for consideration, the RAA that results from that rate stat must be equivalent to the RAA from simply applying the linear weights formula and not comparing a rate to the league average.

The obvious first choice is Runs/PA, using our formula for linear weights runs created. In this case, I am not showing the leaders, but rather the same ten players in the same order. RAA in this case is (LW_RC/PA – LgR/PA)*PA:

The results are not even close to what we need, and the reason is simple: we have not accounted in any way for each batter’s PA generation. There is an easy alternative that might correct this: using outs in the denominator. This just takes us to the correct team rate stat, although the numerator is linear rather than dynamic (either in the case of using Base Runs or using actual runs scored on the team level). As such it does implicitly consider PA generation; might it produce satisfactory results for individuals? Here RAA = (LW_RC/O – LgR/O)*O:

A perfect match. Absolute runs per out produces the same RAA as the direct application of LW_RAA. R/O also has the advantages of being meaningfully comparable as both a difference and a ratio and is the same as the correct team rate stat. Everything is great, except we haven’t answered the question: Does it actually work?

Remember, I said that matching LW_RAA was a necessary condition for our proposed alternative linear weight rate stat to meet – it is not a sufficient condition. We’ve already concluded that RAA/PA is a proper rate stat for a linear framework; in order for an alternative to be acceptable, it must produce results that are consistent with RAA/PA. How do we determine this consistency, other than matching the RAA result, when the numerators and the denominators each start from a different basis? 

One simple but obvious way to determine if they are consistent is to confirm that they result in the same rank order of players. They did for our most extreme hitters, but does that hold for all hitters? 

Apparently not. I didn’t have to go to far to find this little cluster of hitters as they rank 7-10 in RAA/PA. None of them rank in the same spot as Vaughn is first in RAA/650 but second in RC/O; Lofton is second/third; Mack is third/fourth; and Clark is fourth/first. 

I slipped OBA onto the chart because it helps to explain what is going on. Will Clark’s .433 OBA ranked fifth among AL hitters with 200 PA; using outs in the denominator helps him as it implicitly assumes that he represents an entire team with a .433 OBA. While all of these hitters had excellent OBAs relative to the league, R/O goes a bit too far in valuing this. Given that R/O still produces the right RAA, any distortions have to be somewhat limited for normal players.

One can come up with extreme thought experiments, like a player with a .999 OBA all from walks versus a player with a .600 OBA, all from home runs. A team made up of the former would score what would certainly feel to the opposing pitching coach like a nearly infinite number of runs; but as a single player in a lineup, his impact would be muted. It’s not necessary to answer the thought experiment as to which would be more productive to see that R/O applied to extreme individual players would break down. Incidentally, it is exactly this type of scenario that I got into trouble trying to “prove” in my last attempt at this series – while I do think that the theoretical team methods I’ll discuss later provide reasonable estimates for this situation, relying too heavily on them for proofs is begging the question. 

So, we have a rate stat (LW_RAA/PA) that works, but it lacks ratio comparability. There are (at least) two ways we could go about solving this problem:

1. We could adjust LW_RC/PA in some way to take into account the value of PA generation

2. We could manipulate LW_RAA/PA so that it’s no longer a measure of runs above average, but instead on an absolute runs basis

Next time I’ll explore these two parallel questions...if in fact they are parallel at all.

Wednesday, June 09, 2021

Rate Stat Series, pt. 5: Linear Weights Background

Linear methods sidestep the issues that arise from applying dynamic run estimators to players by simply ignoring any non-linearity in the run scoring process altogether. While this is clearly technically incorrect, it is closer to reality than pretending that a player’s performance interacts with itself. Since an individual makes up only 1/9 of a lineup, it is much closer to reality to pretend that his performance has no impact on the run environment of his team than to pretend that it defines the run environment of his team. Linear weights also have the advantage of being easy to work with, easy to adapt to different baselines, and easy to understand and build. Their major drawback is that the weights are subject to variation due to changes in the macro run environment (as distinguished from the marginal change to the run environment attributable to an individual player). 

Linear methods were pioneered by FC Lane and George Lindsey, but it was Pete Palmer who used them to develop an entire player evaluation system, publish historical results, and bring them into the position of the chief rival to Runs Created in the 1980s. Curiously (especially since Palmer is a prolific and brilliant sabermetrician whose pioneering work includes park factors, variable runs per win, using the negative binomial distribution to model team runs per game, and more), Palmer’s player evaluation system as laid out in The Hidden Game of Baseball and later Total Baseball and the ESPN Baseball Encyclopedia never bothered to convert its offensive centerpiece Linear Weights into a rate statistic.

This gap contributed to two developments that I personally consider unfortunate. First, confusion about how to convert linear weights to a rate may have hampered the adoption of the entire family of metrics, and this confusion generally persisted until the publication of The Book by Tom Tango, Mitchel Lichtman, and Andy Dolphin. Second, Palmer did offer up a rate stat, but he did not tie it to linear weights, or in its crudest form to any meaningful units at all. That’s because Normalized OPS (later called Production), which you may know as OPS+, was the rate stat coupled with linear weights batting runs.

To my knowledge, Palmer has never really explained why he didn’t derive a rate stat from linear weights to use; the explanations have instead focused on the ease and reasonable accuracy of OPS. In The Hidden Game, the discussion of linear weights transitions to OPS with “For those to whom calculation is anathema, or at least no pleasure, Batter Runs, or Linear Weights, has a ‘shadow stat’ which tracks its accuracy to a remarkable degree and is a breeze to calculate: OPS, or On Base Average Plus Slugging Percentage.”

Coincidentally, Palmer recently published an article in the Fall 2019 Baseball Research Journal titled “Why OPS Works”, which covers a lot of the history of his development of linear weights and OPS, but still doesn’t explain exactly why a linear weights rate wasn’t part of the presentation.

Without the brilliant mind of Palmer to guide us, where should we turn for a proper linear weights-based rate stat? To answer that question, I think it’s necessary to briefly examine how linear weights work. For this discussion, I am taking for granted that the empirical derivation of linear weights is representative of all linear weight formulas. This is not literally true, as belied by the fact that the linear weights I’m using in this series were derived from Base Runs, not from empirical data. If we were using an optimized Base Runs formula, the resulting weights would be very close to empirical weights derived for a similar offensive environment, but other approaches to calculating linear coefficients like multiple regression can deviate significantly from the empirical weights. Even so, the final results are similar enough that the principles hold for reasonable alternative linear weight approaches.

What follows will be elementary for those of you familiar with linear weights, but let’s walk through a sample inning featuring the star of our series, Frank Thomas. I want to use this example to illustrate two properties of linear weights when using the “-.3 type out value” (i.e. when the result is runs above average): the conservation of runs, and the constant negative value of outs. This example will simplify things slightly, as in reality not every event in the inning cleanly maps to a batting event that is included in a given linear weights formula (e.g. wild pitches, balks, extra bases on errors, etc.) It also will presume that the run expectancy table we use for the example corresponds perfectly to our linear weights, which it does not. Still, the principles are generally applicable to properly constructed linear weights methods, even if the weights were derived from other run expectancy tables or, as is the case for us in this series, by another means altogether (I’m using the intrinsic weights derived from Base Runs for the 1994 AL totals).

Baseball Prospectus has annual run expectancy tables; their table for the 1994 majors is:


On July 18, Chicago came to bat in the bottom of the seventh trailing Detroit 9-5. Their run expectancy for the inning was .5545 as Mike LaValliere stood in against Greg Cadaret. He drew a walk, which raised the Sox RE to .9543, and thus was worth .3998 runs. The rest of the inning played out as follows:


1. If we were going to develop empirical LW coefficients based on this inning, we would conclude that a home run was worth 2.658 runs on average, and thus our linear weight coefficient for a home run would be 2.658. The other events would be valued:


This is in fact how empirical LW are developed, but of course a much larger sample size (typically at least an entire league-season) is used.

2. The team’s runs above average for the inning is always conserved. We started the inning with the bases empty and nobody out for a RE of .5545. This is the same as saying that the average for an inning is .5545 runs scored. The White Sox actually scored 4 runs, and the total of the linear weight values of the plays was 3.4455 runs, which is 4 - .5545. They scored 3.4455 runs more than an average team would be expected to in an inning. The sum of the linear weight values will always match this.

Because of this, we can be assured that the run value of additional plate appearances created by the positive events of the batters has been taken into account in the linear weight values. If this were not the case, runs would not be conserved.

3. Since that is true, it is also true that the sum of the LW values of the positive events (which is 4.8128 runs) plus the sum of the LW values of the outs (-1.3673) must be equal to the runs above average for the inning (3.4455). The sum of the values of the outs will be higher in innings in which more potential runs were “undone” by outs, as was the case here. On the other hand, an inning in which three outs are recorded in order will result in -.5545 runs.

We can use this fact to isolate the run value of the out between the portion that is due to ending the inning (what Tom Tango has called the “inning killer” effect of the out; this is the -.5545 that is the minimum out value for an inning), and that which is due to wasting the run potential of the positive events (what’s left over, in this case, -.8128 runs). 

If we wish to convert our linear weights from an estimator of runs above average to an estimator of absolute runs, we need to back out the inning killer value of the out (since it will be present for every inning equally and serves to conserve total RAA) from the overall value of the out, leaving the remainder which we do not need to worry about as it would have to be debited from the value of the positive events in order to conserve runs.

So we can take -.5545/3 = .1848 and add it back to the linear weight RAA out value, which for our example was -.3150. This results in an absolute out run value of -.1302, In our example we’re using -.1076; these don’t reconcile because:

1. our linear weights don’t consider all events (we’re ignoring hit batters, sacrifices, all manner of baserunning outs, etc.)

2. our linear weights weren’t empirically derived from the 1994 RE table as the .1848 adjustment was

While the numbers don’t (and shouldn’t!) balance perfectly in this case, this is the theoretical bridge for converting empirical linear weights from a RAA basis to an absolute runs basis. I would also contend is serves as a demonstration by inductive reasoning that absolute linear weights do not capture the PA generation impact of avoiding outs, but RAA linear weights do.

Note that converting to the “-.1 type out value” does not eliminate the result of negative runs altogether. An offensive player who is bad enough will be credited with negative runs created (if it helps you to imagine what this level of production might look like, consider that the total offensive contributions of pitchers has hovered near zero absolute runs created in the last decade). For real major league position players, this will not happen except due to sample size. If you’d like an interpretation, I have found this helpful (I stole it from someone, probably Tom Tango, and have badly paraphrased): Since linear weights fix the values of each event for all members of the team, the level at which runs created are negative is the level at which in order to conserve team runs, the weights of positive events cannot be reduced – the poor batter essentially undoes some of the positive contributions of his teammates.

As an aside, the first paper I’m aware of that made the connection between the two linear weight approaches in this manner (rather than simply solving algebraically for the difference between the two without providing theoretical underpinning) was published by Gary Skoog in a guest article in the 1987 Baseball Abstract. This article, titled “Measuring Runs Created: The Value Added Approach” is available at Baseball Think Factory.

Wednesday, May 26, 2021

Rate Stat Series, pt. 4: Players as Teams

 A dynamic run estimator is a run estimator that allows offensive events to interact with each other, such that the value of a given event is not fixed as would be the case in a linear weights formula (e.g. a single is worth .50 runs), but rather is dependent upon all of the other components of the batting line. Dynamic run estimators are great in theory, since the run scoring process for a team is obviously dynamic and not linear. However, there are two issues:

1. They are harder to design than linear estimators. Any idiot with a spreadsheet and a dataset can run a linear regression on runs scored and have a linear estimator when they are done. It may not be a good one, but it will be functional and will probably have a low RMSE when estimating team runs scored. To develop a dynamic model, one must consider the run scoring process and produce a simplified model, but not so simplified as to not produce reasonably accurate estimates.

This is not a series about run estimators, but the most commonly used dynamic run estimator, Bill James’ Runs Created, suffers from flaws that make it unable to handle extreme offenses. A much better model, David Smyth’s Base Runs, is powerful and will be used here.

2. They are not appropriate to apply to individual offensive statistics. Dynamic estimators always involve multiplying base runners by some factor representing advancement of baserunners (in Runs Created that’s the end of the story, Base Runs accounts for the unique nature of home runs). This multiplication is inappropriate when applied to an individual player, as now Frank Thomas’ high OBA is multiplied directly with his high power which advances runners. In reality, there is some interaction, but Thomas’ impact is diluted by being just 1/9th of the lineup. Inputting his statistics into a dynamic run estimator produces an estimate of how many runs a team would score if each batter hit like Thomas.

Due to this issue, I do not advocate applying dynamic run estimators directly to individuals, but this post will still address the rate stat implications of such applications. Later we will discuss theoretical team methods that allow the use of a dynamic run estimator while still accounting for the fact that the player is just one of nine in the lineup.

This series will now discuss what I believe to the be the proper rate stats for a particular framework for evaluating individual offense. One of my objectives is that for each option of a framework for building a rate stat presented, there be at least one variation that is linearly comparable and one that is ratio comparable. I’ve defined those terms as I use them at length before, so here I will be brief:

* A statistic is linearly comparable if the difference between two figures is meaningful. A hitter with a .400 OBA would reach base 100 times more than a hitter with a .300 OBA over 1000 PA.

* A statistic is ratio comparable if the ratio between two figures is meaningful. Our .400 OBA player reached base 33.3% more frequently than the .300 OBA player

Ideally, our metric will facilitate both types of comparison, but if not, I will endeavor to present an alternative formulation that fills the gap. I will not propose any metrics that are neither linearly comparable or ratio comparable because they are the scourge of sabermetrics (hello OPS).

The underlying principle of the discussion that follows for the three frameworks (treating the player as a team, a full linear model, and a theoretical team model) is that the rate stat should be consistent with the run estimator used. If the run estimator treats the player as if he is a team, then the corresponding rate stat should treat the player as if he is a team.

In this case, that makes it very simple. The proper denominator for a team rate stat is outs. If you apply Runs Created, Base Runs, or some other run estimator directly to an individual player, the proper denominator is outs.

At this point in the discussion, this may ring as a somewhat hollow declaration, as I have only indirectly made the case for why we might want to use a denominator other than outs for an individual when it is so clearly the proper choice for a team. Since I’m suggesting that outs are the proper choice for this framework, I’ll defer that case for later.

In this case, I advocate for using outs when applying a dynamic run estimator to a team because it is the only consistent treatment. The only justification for going down this path (other than needing something quick and dirty) is a theoretical exercise – how many runs would a team that hit like Frank Thomas score? While I don’t think this theoretical result is appropriate for attempting to value Thomas’ contribution the 1994 White Sox, it at least does have an interpretation. If you start mixing frameworks, you really have a mess on your hands. There’s no good reason (other than crude estimation) to apply a dynamic run estimator directly to an individual; there’s no sense in deviating from the corresponding rate stat in order to try to make the results more comparable to a better approach to evaluating individual offensive contribution. Just use the better approach, and if you insist on misapplying a dynamic run estimator to individual players, make outs the denominator so that at least you have a theoretically coherent suite of metrics.

I should note that Bill James in the 1980s took this entire process to its logical conclusion. After applying Runs Created to individuals, dividing by outs, and multiplying by a constant that was close to the league outs/game for the definition of outs chosen, he went a step further and used the Pythagorean theorem to estimate the winning percentage that this team would have if it allowed an average number of runs. He then converted it to wins and losses by using the number of outs the player made to define games, which caused all kinds of problems, but at least he was committed.

This will be the first of several times that I’ll run a leaderboard for the 1994 AL using a particular framework. Here we have the top 5 and bottom 5 performers with at least 200 PA in Base Runs/Out. RAA is “Runs Above Average” and is calculated simply as (BsR/O – LgR/O) * Outs. Spoiler alert: No matter how we slice it, Frank Thomas is going to come out as the leading hitter in this league, as he raked .353/.492/.729 on his way to a second consecutive MVP award.


I am showing at least one more decimal place on each metric than I usually would just to allow for a little more precise calculation if you’re following along; it is no way a statement about the significance of the ten-thousandths of runs per out. 

Runs per out can of course be scaled; Bill James multiplied it by the league average outs/game appropriate given the categories be considered in the computation of outs. For instance, in this case, since we’re defining outs as AB – H, the average outs/game will be around 25.2 (for the 1994 AL it was 25.19). A more complete accounting of outs, like AB – H + CS + SH + SF + DP, would get close to 27 outs/game. While putting individual contribution on a team games basis is nonsensical on some level, since it is just a scalar multiplier it causes no real distortion and provides a scale that is easily understandable, in the same manner that ERA or K/9 are understood by everyone other than Matt Underwood and Harold Reynolds. 

Wednesday, May 12, 2021

Rate Stat Series, pt. 3: Teams

If I tell you that three teams in the same league-season played the same number of games (113), and that one of them scored 679 runs, another scored 670, and the third scored 633, how confident would you be in using this limited data to rank the productivity of their offenses? As usual in this series, we are ignoring park factors and other contextual factors (like quality of opposition/not having to face one’s own pitching staff); since they are from the same league-season, you don’t need to worry about whether the win value of each team’s runs was the same. Assume also that runs will be distributed across games by a known distribution like Enby, so the distribution is also not a differentiator. Assume that we don’t care about any “luck”; the actual total is what matters, not what a run estimator came up with. What else do you need to know?

I would contend that given the (admittedly restrictive) parameters I’ve placed on the exercise, you now know almost everything you need to know. In a small number of cases, and to a small extent, you are missing valuable information – but for most situations, you should need no additional information.

Now suppose I told you something similar about three players: same league season, same number of games played (111), and three runs created estimates: one player created 106 runs, one 92, and one 88. Do you feel like you need any additional information to put these players in the proper order of offensive productivity?

I hope that your answer here is yes, and a lot of it. I’ve told you how many games each have played, but that doesn’t tell you how many opportunities they’ve had at the plate. Sure enough, in this case one of the players had substantially fewer plate appearances than the others (489, 490, 451 respectively). Given that the player who created 90 runs had 39 more plate appearances than the player who created 86, it seems likely that the latter player was actually more productive on a rate basis.

I did not tell you how many plate appearances each of the three teams had in their 113 games; I don’t think it’s relevant to the question at hand, but the answer is 4493, 4611, and 4556 respectively. Why do we need to know plate appearances (or something) in the case of players, but not in the case of teams? Understanding this gets to the heart of the reason this series needs to exist at all, why applying the same rate stat to team offenses and player offense may not work as intended.

In the previous installment, I asked the question: “Where do plate appearances come from?” The answer is that every inning (excluding walkoff situations) starts with three PAs guaranteed, and only by avoiding outs (reaching base and not being subsequently retired on the bases) can a team generate additional plate appearances.

From a team perspective, then, plate appearances are not an appropriate denominator for a rate stat, because differences in team plate appearances are the result of differences in performance between the teams. To return to the three teams discussed above, they are the 1994 Indians, Yankees, and White Sox respectively. The Indians had the fewest PA of the three yet scored the most runs. Does this mean that their offense, which already scored more runs than the other two clubs, was even more superior than the raw numbers would suggest?

An offense does not set out to maximize its plate appearances, nor does it set out to score the maximum number of runs it can in the minimum number of plate appearances. An offense sets out to maximize its total runs scored. Plate appearances are a function of the rate at which a team makes outs. At this point it might be helpful to consider the three teams:



New York’s OBA was 22 points higher than Cleveland’s and thus they generated an extra plate appearance per game. When ranking team offenses, it wouldn’t make sense to penalize the Yankees for this, which would be the case if we used R/PA. The difference in plate appearances simply reflects the different manner in which New York and Cleveland went about creating runs. For a team, plate appearances are inextricably linked with their OBA. Each inning, a team attempts to score as many runs as it possibly can before making three outs. It’s possible to score one run in a complete inning with as few as four or as many as seven plate appearances. Whether a team uses four, five, six, or seven plate appearances to score a single run is irrelevant in terms of that run’s impact on them winning or losing the game (*). Thus outs or an equivalent like innings are the correct choice for the denominator of a team rate stat.

(*) I am speaking here simply about the direct impact of the runs scored and not any downstream effects or the predictive value of team performance. Perhaps the team that uses seven PA to score one run benefits by wearing down the opposing pitcher or is more likely to have success in the future because they had four of seven batters reach base compared to one in four for the team that only needed four PA. Here we’re just focused on the win value directly attributable to the run scored and not any secondary or predictive effects.

The fact that outs are fixed for each team each inning (ignoring walkoffs) means that outs are also fixed for each team each game (ignoring walkoffs, rainouts, extra innings, and foregone bottom of the ninths). Which means that outs are also fixed for each team each season (ignoring those factors and cases in which teams don’t play out their full schedules, or have to play tiebreakers), which means that R/G and raw seasonal runs scored total are essentially equivalent to looking at R/O for a team. So for the question I asked at the beginning of the article, just knowing that the three teams had played an equal number of games, we had a pretty good idea how they would “truly” rank using R/O.

For players, this is not at all the case, since even in an equal number of games, players will get different numbers of plate appearances for a variety of reason (batting order position, the team’s OBA (remember, higher OBA teams will generate more PA), whether or not they play the full game), a fact that is intuitive to most baseball fans. What is less intuitive, though, is that even in the same number of plate appearances, players can make very different numbers of outs. Since we’ve already accepted that team OBA defines how many plate appearances a team will generate, it isn’t much of a leap to conclude that if we have two players who create the same number of runs (using a formula that doesn’t explicitly account for their impact on the team’s OBA) in the same number of plate appearances, the player who makes fewer outs was more productive when we consider the totality of their offensive contribution. Even though the two players were equally productive in their plate appearances, the player who made fewer outs generated more plate appearances for his teammates, a second-order effect that needs to be considered when evaluating individual offensive contribution. For teams, the runs scored total already reflects this effect.

This would be an appropriate time to note that this series is focused on evaluating offenses, but of course every offensive metric can be reviewed in reverse as a defensive metric. However, since the obvious denominator for teams is outs, it is also the obvious denominator for individual pitchers. We don’t need to worry about a pitcher’s impact on his team’s plate appearances – when he is in the game, he is solely responsible (setting aside the question of how the team’s performance should be allocated between the pitcher and his fielders) for the number of plate appearances the opponent generates, and his goal is to record three outs while minimizing the number of runs he allows, regardless of how many opponents come to the plate. Outs are clearly the correct denominator for the rate stat, and innings pitched are nothing more than outs/3 (and even better, IP account for all outs, including many that don’t show up in the standard statistical categories).

In thinking about the development of early baseball statistics and the legacy of those standard statistics on how the overwhelming majority of fans thought about baseball before the sabermetric revolution took hold, it is striking that the early statisticians understood these concepts as they applied to pitchers. When pitchers were completing almost all their starts, simple averages of earned runs allowed sufficed, for the same reason that team R/G tells you most everything you need to do. As complete games became rarer, ERA took hold, properly using innings in the denominator. For most of the twentieth century, and even post-sabermetric revolution, baseball fans are conditioned to think about innings pitched as the denominator for all manner of pitching metrics – even those like strikeout and walk frequency for which plate appearances would make a much more logical denominator. (Of course, present day sabermetrics has embraced metrics like K% and W% for pitchers, but the per inning versions remain in use as well).

The parallel development of offensive statistics resulted in the opposite phenomenon. While early box scores tracked “hands out” (essentially outs made) for individual batters, batting average eventually became the dominant statistic. Setting aside the issues with “at bats” and how they distort people’s thinking and saddled us with the mouthful of “plate appearances” to describe the more fundamental quantity of the two, the standard batting statistics have conditioned fans to think about batting rates (walk rate, home run rate, etc.) in the correct manner (or one adjacent to being correct, depending on whether at bats or plate appearances are the denominator), but leave people struggling with how to properly express a batter’s overall productivity. Again, this is the opposite problem of how pitching statistics were traditionally constructed. One can imagine that it all might be very different had the Batting Average taken the form of a hit/out ratio rather than hits/at bats.

Wednesday, April 28, 2021

Rate Stat Series, pt. 2: PA Generation

This is a little bit of a detour and certainly nothing new (I don’t know who originally laid out this logic/math – the earliest use I’m aware of was in 1960 by D’Esopo & Lefkowitz as part of their Scoring Index model), but I think a discussion of it is appropriate in the context of this series, and I will later make use of these formulas.  It’s also ground I covered in the original series, but I think my explanation this time is slightly more coherent.

Each batting team starts each inning (excluding scenarios where a walkoff is possible) with three plate appearances guaranteed. Thus each team starts each game with twenty-seven plate appearances guaranteed (excluding scenarios where the home team forgoes batting the bottom of the ninth, rainouts, post-2020 doubleheaders, etc.). Any plate appearances beyond that must be earned by batters avoiding outs. Since it’s more natural to think of a positive outcome rather than the avoidance of a negative outcome, I will simplify and say that each extra plate appearance must be earned by a batter reaching base (and not being subsequently retired on the basepaths).

For the sake of discussion (and keeping with the simple set of statistics being used in the metrics in this series), I’m going to ignore the existence of baserunning outs, including caught stealing, pickoffs, outs stretching, outs advancing, and runners retired on double/triple plays (although not on fielder’s choices, since the batter is charged with an out in that case). I’m going to assume that the out rate is the complement of on base average, which in this series will be defined simply as (H + W)/(AB + W). In reality, considering all the ways in which outs can be made, it would be a more involved equation (I’ve used the acronym NOA for Not Out Average and OA for the complement, Out Average) which would look something like this, although it still doesn’t think I’ve accounted for every possible event (you try incorporating fielders’ choices without complicating the equation significantly):

NOA = (H + W + HB + CI + ROE – CS – DP – Outs Stretching – Outs Advancing – Pickoffs – 2*TP)/(AB + W + HB + SF + SH + CI)

Alternatively, for a team when LOB data is available (and ignoring the walkoff situation), you could have OA = (Plate Appearances – Runs Scored – Left On Base)/Plate Appearances. All of this is just an attempt to calculate, as best we can from the available statistics we have restricted ourselves to, Outs/Plate Appearances. NOA or OA as appropriate could be substituted for OBA in the equations that follow as long as the appropriate corresponding adjustments are made to the numerator.

Let’s assume for the purpose of developing an equation for team plate appearances that the OBA is constant across each of the nine batters in the lineup and doesn’t vary for any other reason (this is obviously never true, but it is a fine simplifying assumption for modeling PA generation). Then a team will start an inning with three plate appearances. For each of those three guaranteed PAs, there is a probability (equal to OBA, given our assumption) that the batter avoids an out (reaches base, given that there are no baserunning outs). This increases the expected number of plate appearances by OBA.

It doesn’t stop there, though. Each additional PA that is generated also has an OBA chance of creating an additional PA, which itself has an OBA chance of creating an additional PA. Thus, for each of the guaranteed PA, the expected final number of team PA is:

OBA + OBA*OBA + OBA*OBA*OBA + … = OBA + OBA^2 + OBA^3 + … OBA^n

which when n is infinity and OBA is between 0 and 1 (which it must be by definition) resolves to:

OBA/(1 – OBA)

The 1994 AL had an OBA of .343. Thus, each guaranteed plate appearance should have generated .343/(1 - .343) = .522 additional plate appearances. In an average inning, starting with three guaranteed PA, we would expect 3 + 3*.522 = 3*(1 + .522) = 4.566 PA, and thus in a game we would expect 9*4.566 = 41.09 PA. Note that instead of calculating the .522 additional PA, we can simplify this to 3/(1 – OBA) for an inning or 27/(1 – OBA) for a game. In reality there were 39.24 PA, so we have an unacceptable 4.7% error. What went wrong?

I’m mixing definitions of plate appearances and definitions of OBA incorrectly, and also ignored that the three guaranteed PA are equal to the number of outs permitted in the inning. In order to estimate the number of plate appearances per inning or game consistently, we need to divide the average number of outs/game by 1 – OBA:

PA/G = (O/G)/(1 – OBA)

The definition of outs that corresponds to our simple (H + W)/(AB + W) complement of out average is AB – H. In the 1994 AL there were 25.19 outs/game using this definition, so our expected PA/G is:

25.19/(1 - .353) = 38.34

The actual average was 38.35; we’re off due to rounding as this is now just a mathematical truism since by our simplified definitions plate appearances = outs + times on base. Using this equation to estimate team PA/G from their OBA for the 1994 AL, the RMSE is .259, which is about .7% of the average PA/G. We shouldn’t expect perfect accuracy at the team level since team PA will be affected by different quantities of all the statistical categories we’re ignoring that have an impact on the actual number of PA a team generates, as well as differences in number of extra inning games, foregone bottom of the ninths, and walkoff-shortened innings.

The key points to keep in mind as we move forward in discussing rate stats are:

1.      The number of plate appearances a team will get is a function of their out rate, and simplifying terms we can very accurately estimate team PA as a function of on base average

2.      Since players have an impact on the number of plate appearances their team gets, and thus the number of plate appearances they get, a proper rate stat for measuring overall offensive productivity must account for that impact

Thursday, April 15, 2021

Almost Perfect

In my earlier days as a baseball fan, I was really interested in no-hitters, and outside of the Indians winning the World Series, my most fervent desire as a fan was to witness one even if only on the radio. Eventually this faded, due to some combination of growing jaded about the extent to which baseball fans sometimes elevate trivial events above game outcomes, the pernicious influence of Voros McCracken on how I thought about the hits column for pitchers, and after fifteen years of intense baseball-watching finally witnessing one (I'm now up to five).

Perfect games retain a bit more of their mystique for me, due to being much more rare (someone who has watched as many games over the years as I have is bound to have seen a no-hitter, but one can't really expect to see a perfect game) and not relying on any arbitrary distinction between hits and errors (which of course doesn't affect all no-hitters). The three closest games I have taken in to being perfect games prior to last night were Mike Mussina against the Indians in 1997 and Armando Galarraga's should-have been perfect game against the Indians in 2010. The latter game is case in point of what I meant about fans sometimes being more interested in trivial events than game outcomes - there was more outcry in favor of replay as a result of that game then there was cumulatively from many calls that much more directly influenced which team won a given game.

Last night's effort by Carlos Rodon combined elements of both of the ninth innings of these games in the way that people who believe in hocus pocus should embrace. From Galarraga's, we took the extremely close play at first base, with Josh Naylor playing the role of Jason Donald, desperately trying to reach first after making weak contract towards first base. In this case, the play was actually much closer, but no replay was required as the call on the field was that Jose Abreu beat him to the bag by a narrow margin. 

From the Mussina game, we borrowed the man, lineup slot, and fielding position to break it up. With one out in the ninth, the Indians catcher. Sandy Alomar singled off Mussina, while Roberto Perez was only hit in the back foot with a slider, but history repeated itself in who ended it. Of course, if Rodon had to lose the perfect game, he got the better outcome than the other two, as he at least got to keep the no-hitter.

Naturally, all of the near perfect games I've seen have been pitched against the Indians. In addition to the infinitely more important distinction of now having the longest World Series drought, after Joe Musgrove's no-hitter for the Padres, the Indians now have the longest drought between no-hitters, it having been nearly forty years since Len Barker's perfect game.

I was keeping score of the Mussina game and Rodon's effort last night, but not the Galarraga game, which I listened to on the radio while I watched some other game on TV. 



Wednesday, April 14, 2021

Rate Stat Series, pt. 1: Introduction

This blog has existed for sixteen years now, and yet with the exception of some (relatively) recent stuff I’ve written about the Enby distribution for team runs per game and the Cigol approach to estimating team winning percentage from Enby, almost all of the interesting sabermetric work appeared in the blog’s first five years, and most in the first year or two.

There are a number of reasons for that - one is that when I started, I was a college student with a lot more free time on his hands than I have with a 9-5. Related, I was also more eager to spend a lot of time staring at numbers on my free time when I didn’t spend a good portion of my day staring at numbers. Remember the Bill James line about how a column of numbers that would put an actuary to sleep can be made to dance if you put Bombo Rivera’s picture on the flip side of the card? Sometimes the numbers do indeed dance, but the actuary in question would rather watch a ballgame or read about the Battle of Gravelines than manipulate them in the evening, dancing or no.

More generally, there has been much less to investigate in the area of sabermetrics that I primarily practice, which I will call for the lack of a better term “classical sabermetrics”. I would define classical sabermetrics as sabermetric study which is primarily focused on game-level (or higher, e.g. season, player career, etc.) data that relates to baseball outcomes on the field (e.g. hits, walks, runs scored, wins). Classical sabermetrics is/was the primary field of inquiry of those I have previously called first or second-generation sabermetricians.

Classical sabermetrics is not dead, but to date the last great achievement of the field was turned in by Voros McCracken when he developed DIPS. I’m not arrogant enough to declare that nothing more will ever be found in the classical field, and there is still much work to be done, but at least as far as I can see, it is highly likely that it will consist of tinkering and incrementally improving work that has already been done, and probably with little impact on the practical implementation of sabermetric ideas. For example, I still would love to find a modification to Pythagenpat that works better for 2 RPG environments, or a different run estimator construct that would preserve the good properties of Base Runs while better handling teams that hit tons of triples. All of this is quite theoretical, and of no practical value to someone who is attempting to run the Pirates.

Which increasingly is what sabermetric practitioners are attempting to do, whether directly through employment by major league teams, or indirectly through publishing post-classical sabermetric research in the public sphere. Let me be very clear: this is not in any way a lament for a simpler, purer time in the past. I think it’s wonderful that sabermetric analysis has transcended the constraints of the data used in its classical practice and is exerting an influence on the game on the field.

Notwithstanding, I am still a classical sabermetrician, not because I don’t value the insight provided by post-classical sabermetrics but because I don’t have some combination of the skillset or the way of thinking or the resources or the drive to become proficient enough in newer techniques to offer anything of value in that space. Thus it is natural that I have less to share here.

The topic that I am embarking on discussing is squarely in the realm of “quite theoretical and of no practical to someone who is attempting to run the Pirates”. About fifteen years ago, I started writing a “Rate Stat Series”, and aborted it somewhere in the middle. I have stated several times that I intend to revisit it, but until now have not. The Rate Stat Series was and now is intended to be a discussion of how best to express a batter’s overall productivity in a single rate stat. I should note three things that it is not:

1. The discussion is strictly limited to the construction of a rate stat measuring overall offensive productivity, not a subset thereof. I am not suggesting that if you are measuring a batter’s walk rate, strikeout rate, ground-rule double rate, or any other component rate you can dream up, that you should follow the conclusions here. For most general applications, plate appearances makes perfect sense as the denominator for a rate for any of those quantities. There may be reasons to follow a sort of decision tree approach that results in different denominators for some applications (McCracken was an innovator in this approach, in DIPS and park factors). All of that is well and good and completely outside the scope of this series.

2. The premise presupposes that the unit of measurement of a batter’s productivity has already been converted to a run-basis. Thus it is not a question of OPS v. OTS v. OPS+ v. 1.8*OBA + SLG v. wOBA v. EqA v. TAv v. whatever, but rather what the denominator for a batter’s estimated run contribution should be. The obvious choices are outs and plate appearances, but there are other possibilities. Spoiler alert: My answer is “it depends”.

3. Revolutionary, groundbreaking, or any other similar adjective. I’m attempting to describe my thoughts on methods that already exist and were created by other people in a coherent, unified format.

In sitting down to write this, I realized I made two fundamental mistakes in my first attempt:

1. I was attempting to “prove” my preferences mathematically, which is not a bad thing in theory, but some of what I was doing begged the question and some of this discussion is of a theoretical nature that lends itself more to logical reasoning/“proofs” than to mathematical “proofs”. I’ve tried to anchor my conclusions in math, logic, and reason where possible, but have also embraced that some of it is subjective and must be so.

2. I posted pieces before I finished writing the whole thing, or even knowing exactly where it was going.

These are rectified in this attempt – all of my assertions are wildly unsupported and as I hit post, all planned installments exist in at least a detailed outline form. While I have attempted to avoid the two mistakes I identified in the previous series, as I look at this series in full I can see I have may have just replaced them with two characteristics that will make reading this a real chore:

1. I’m overly wordy; repeating myself a lot and trying to be way too precise in my language (although I fear not as precise as the topic demands). There’s a lot of jargon in an attempt to delineate between the various concepts and methodological choices.

2. There’s way too much algebra; where possible, I didn’t want to just assert that mathematical operations resolved in a certain way and give an empirical example that backs me up, so there’s a lot of “proofs” that will be of no general interest.

Allow me to close by laying some groundwork for future posts. I am going to use the 1994 AL as a reference point, and when I use examples they will generally be drawn from this league-season. Why have I chosen the 1994 AL?

1. 1994 was the year I became a baseball fan, and I was primarily focused on the AL at that time, so it is nostalgic. I have not turned into a get off my lawn type who thinks that baseball reached its zenith in 1994 and it’s all been downhill since, but I do think that about 1994 Topps, the greatest baseball card set of all-time.

2. As the year in which the “silly ball era” really broke out, and due to the strike shortening the season, there are some fairly extreme performances that are useful when talking about the differences between rate stat approaches.

As discussed, this series starts from the premise that a batter’s contribution is measured in terms of runs, and work from there. This approach does not require the use of any particular run estimator, although one of my assertions is that the choice of run estimator and the choice of rate/denominator for the rate are logically linked. There are three types of run estimators that I will use in the series: a dynamic model, a linear model, and a hybrid theoretical team model.

In order to avoid differences in the run estimator(s) used unduly influencing differences in the resulting rate stats, I am going to anchor a set of internally consistent run estimators in the reference period of the 1994 AL. It will come as no surprise if you’ve read anything I’ve written about run estimators in the past that I am using Base Runs for this job. The point of this series is not to tell you which particular run estimator to use or how to construct it. It really doesn’t matter which version of Base Runs I use (if you are still stuck on Runs Created, there’s no judgment from this corner, at least for the duration of this discussion), or which categories I include in the formula – this is about the conceptual issues regarding the rate that you calculate after estimating the batter’s run contribution, so I am keeping it very simple, looking just at hits, walks, and at bats (thus defining outs as at bats minus hits) and ignoring steals/caught stealing, hit batters, intentional walks, sacrifices, etc..  Since I’m doing this with the run estimator, I will also do it with most other statistics I cite – for example, throughout this series OBA will be (H + W)/(AB + W), and PA will just be AB + W.

A version of Base Runs I have used is below. It’s not perfect by any means; it overvalues extra base hits as we’ll see below, but again, the specific estimator is for example only in this series – the thinking behind constructing the resulting rates is what we’re after:

A = H + W – HR

B = (2TB - H – 4HR + .05W)*.78

C = AB – H

D = HR

BsR = (A*B)/(B + C) + D

Typically, any reconciliation of Base Runs to a desired estimate number of runs scored for an entity like a league is done using the B factor, since it is already something of a balancing factor in the formula, representing the somewhat nebulous concept of “advancement” while the other components (A = baserunners, C = outs, D = automatic runs) represent much more tightly defined quantities. In order to force the Base Runs estimate for the 1994 AL to equal the actual number of runs scored, you need to replace the .78 multiplier with .79776, which can be determined by first calculating the needed B value (where R is the actual runs scored total):

Needed B = (R – D)*C/(A – R + D)

Divide this by (2TB – H – 4HR + .05W) and you get a .79776 multiplier. I usually don’t force the estimated runs equal to the actual runs, but for this series, I want to be internally consistent between all of the estimators and also be able to write formulas using league runs rather than having to worry about any discrepancies between league runs and estimated runs.

So our dynamic run estimator (BsR) used throughout this series will be:

A = H + W – HR = S + D + T + W

B = (2TB - H – 4HR + .05W)*.79776 = .7978S + 2.3933D + 3.9888T + 2.3933HR + .0399W

C = AB – H = Outs

D = HR

BsR = (A*B)/(B + C) + D

To be consistent, I will also use the intrinsic linear weights for the 1994 AL that are derived from this BsR equation as the linear weights run estimator. The intrinsic linear weights are derived through partial differentiation of BsR with respect to each component. If we define A, B, C, and D to be the league totals of those, and a, b, c, and d to be the coefficient for a given event in each of the A, B, C, and D factors respectively, than the linear weight of a given event is calculated as:

LW = ((B + C)*(A*b + B*a) – A*B*(b + c))/(B + C)^2 + d

For the 1994 AL, this results in the equation, where RC is to denote absolute runs created:

LW_RC = .5069S + .8382D + 1.1695T + 1.4970HR + .3495W - .1076(outs)

We will also need a version of LW expressed in the classic Pete Palmer style to produce runs above average rather than absolute runs. That’s just a simple algebra problem to solve for the out value needed to bring the league total to zero, which results in:

LW_RAA = .5069S + .8382D + 1.1695T + 1.4970HR + .3495W - .3150(outs)

I am ignoring any questions about what the appropriate baseline for valuing individual offensive performance is. Regardless of where you side between replacement level, average, and other less common approaches, I hope you will agree that average is a good starting point which can usually be converted to an alternative baseline much more easily than if you start with an alternative baseline. Average is also the natural starting point for linear weights analysis since the empirical technique of calculating linear weights based on average changes in average run expectancy is by definition going to produce an estimate of runs above average.

Later we will also have some “theoretical team” run estimators built off this same foundation, but discussion of them will fit better when discussing that concept in greater detail.

I will also be ignoring park factors and the question of context in this series (at least until the very end, where I will circle back to context). Since I am narrowly focused on the construction of the final rate stat, rather than a full-blown implementation of a rating system for players, park factors can be ignored. Since I am anchoring everything in the 1994 AL, the context of the league run environment can also be ignored since it will be equal for all players once we ignore park factors.

Thursday, April 01, 2021

Give Us This Day Our Daily Ball

Rob Manfred, who art Commissioner

Halloweth be our game

Thy rule changes be undone, thy no longer assault fun

In 2022 as it was in 2002

Give us this day our daily ball

And reconcile with Tony Clark as we reconcile to runners on in extra innings

And lead us not into strike or lockout

And deliver us from pitchers hitting

For thine is the office and the power and the responsibility until 2024

Play ball