Where to Bat Your Best Hitter: A Computational Analysis (Part 1)

Prior to the August, 2015, non-waiver trade deadline, the Toronto Blue Jays sent their leadoff hitter Jose Reyes to the Colorado Rockies for Troy Tulowitzki, a classic middle-of-the-order bat. Everyone assumed from his career power numbers that Tulowitzki would slot in the heart of the Jays order, but with Josh Donaldson, Jose Bautista, and Edward Encarnacion already comfortably set at 2-4 (over 200 RBIs between them at the time) they instead used him in the vacated leadoff spot. The move seemed to work as Tulo went 3 for 5 in his first game, and the Jays proceeded to rattle off a tidy 11-0 streak with their new top-of-the-order guy.

Troy Tulowitzki
Shortstop B/T: R/R
.297 / .370 / .510
29 HR 100 RBI 8 SB
TT José Reyes
Shortstop B/T: B/R
.290 / .339 / .432
12 HR 65 RBI 50 SB
JR

One doesn’t mess with success, but everyone knows Tulowitzki is not an ideal leadoff hitter, never having batted there before in his 10-year MLB career, and with all of 3 stolen bases in the last 3 seasons. His above-average pop suggests a traditional run-producing spot: 29 HR and 100 RBI career numbers over an averaged 162-game season (Baseball-Reference.com), but with the Jays on a 22-5 tear, Tulo, touch wood, wasn’t moving anywhere.

A leadoff hitter naturally gets more at bats per season, one reason Jays manager John Gibbons gave for putting Tulowitzki at the top of the order, given his career .297 BA and .370 OBP. But tradition and common sense dictate that top RBI men are more valuable with men on base, impossible for a leadoff man in the first inning, and presumably sub-optimal afterwards. As Tulowitzki’s new teammate 3B Josh Donaldson noted in the midst of an August run that saw the Jays go from 6 back of the Yankees to 1 1/2 up in the AL East, “I feel like every time I’m coming up I have someone in scoring position or someone on base.” Exactly.

Fine-tuning a lineup is an argument for the ages, but can we determine where a power hitter should bat, where his numbers best fit 1 to 9? Should high-average batters hit before the sluggers, or should we just bat 1-9 in order of descending batting average (or OBP)? Can we calculate how to arrange a team’s lineup to maximize the optimum theoretical run production?

Enter Monte Carlo simulations, used to model the motion of nuclei in a DNA sequence, temperatures in a climate-change projection, even determine the best shape and size of a potato chip. In Do The Math!, Monte Carlo simulations were used to calculate where a Monopoly player will most likely land (Jail and Community Chest, followed by the three orange properties: St James, Tennessee, and New York), and whether to hit or stick in Black Jack against any dealer’s up card.

In some cases, algebraic probabilities are difficult (using Markov chains, a continuously iterative system with a finite countable sample space), whereas brute force computation does the trick over a large number of trials. If a picture is worth a thousand words, a simulation is worth a thousand pictures.

BOO V1 (Batting Order Optimization Version 1) is a Monte Carlo program written in Matlab that randomly selects a hit/out event over a 9-inning, 27-out game, averaged over a large number of games, e.g., 1 million. It uses a flat lineup where all hitters have a .333 OBP (roughly the Jays average), but doesn’t include errors, hit batsmen, sacrifices, double plays, stolen bases, etc., or opposing pitchers’ numbers. (In Part II, I will include the hitting stats of a real lineup: 1B, 2B, 3B, HR, BB, K, GO/AO.)

The mathematical guts are fairly simple, essentially a random number generator and some modulo math (think of leap-frogging 3 or more chairs at a time in a circle of 9), and elegantly captures some interesting trends, in particular, the distribution of end-game batters 1-9 and thus the most likely batter to end a game. From such a simulation, we can calculate where best to slot a team’s best hitter to maximize his chances of coming to the plate with the game on the line, another stated reason for putting Tulo in the Blue Jays number 1 spot.

Figure 1a shows the distribution of batters faced (BF) over 1,000,000 simulated BOO games, where the most likely end was 40 batters faced followed by 39 and 41 (the 3-5 hitters), as might be expected with a hard-wired OBP = .333 (binomial p = .33). It seems the custom of having your clutch hitters in the 3-5 slots matches the computational results.

BOOFigure1a BOOFigure1b

Figure 1a: Distribution of # of batters faced   Figure 1b: Distribution of end-game batters

Interestingly, however, the leadoff hitter doesn’t end a game more often than a middle-order batter. Figure 1b shows the distribution of end-game batters (EGB) for a 1-9 lineup, and is perhaps counter-intuitive. In fact, the number 2 and 3 hitters are more likely to end a game than the leadoff hitter, while there is an obvious dip 3-7. Table 1 shows the frequency of end-game batters 1-9 (number and percentage).

1 2 3 4 5 6 7 8 9
# of games ended 18.4 18.6 18.6 18.2 17.8 17.5 17.3 17.6 18.1
% games ended 11.4 11.5 11.5 11.2 11.0 10.8 10.7 10.9 11.2

Table 1: Number of games ended and percentage versus lineup position (OBP = .333)

Initially, I expected a constant drop-off from 1 to 9, or perhaps following some form of a Benford’s Law distribution, for example, in the wear pattern on a ATM pad or the leading digit in a collection of financial data (1 appears about 30%, 2 about 18%, 3 about 12%, 4 about 10%, . . . , and 9 about 5%). Note, if the data were randomly distributed, each number would appear 11.1% or 1/9. But the modulo aspect of a repeated baseball lineup creates another distribution, one that has a clear maximum after the leadoff spot and a mid-lineup dip at batter number 7.

Of course, the leadoff hitter will always have more plate appearances over an entire season, but somewhat surprisingly does not end a game more often. Table 2 shows the number of at bats 1-9 averaged over a 162-game season (I have assumed 8.5% of plate appearances are walks). As can be seen, the leadoff hitter gets about 130 more ABs than the number 9 hitter, or 21% more per season, reason enough to put your best hitter at the top of the order. From one batter to the next, however, the difference is only about 17 ABs (monotonically decreasing), about an extra AB every 10 games. Not that much difference one spot to the next.

1 2 3 4 5 6 7 8 9
# of ABs 757 740 723 706 689 673 657 641 625
% ABs 12.2 11.9 11.6 11.4 11.1 10.8 10.6 10.3 10.1

Table 2: Number of ABs and percentage ABs over 162 games (OBP = .333)

Using BOO, we can also analyse how the EGB distribution changes for a good and a bad team, modelled using an OBP of .250 and .400. The results are shown in Figure 2 including our .333 OBP team. Here, it seems that the lineup order matters more on a bad team than a good team (a practically flat EGB). Indeed, it is often said that you can run any lineup out with a good team. Conversely, losing teams are always juggling their lineups to find the right mix.

BOOFigure2a BOOFigure2b

Figure 2a: Distribution of # of batters faced   Figure 2b: Distribution of end-game batters (OBP = .250, .333. .400)

Of course, baseball is not just statistics over a large number of sample-sizes (or simulations). Baseball is played in bunches and hunches. It would take a little over 400 years to play 1,000,000 games in a 30-team, 162-game schedule. Matchups, streaks, situational hitting, and team chemistry may be more important than any theoretical trends. And, of course, a real, non-flat, batting lineup (which I’ll look at in Part II).

In an actual BF and EGB distribution for the 2014 Toronto Blue Jays and their opponents over a 162-game season, we see the small-sample versions of our super-sized theoretical distributions (Figure 3). The actual BF distribution is comparable to the theoretical binomial/Gaussian BF, though positively skewed, showing the effect of blowouts, not adequately covered in the hit/out simulation. The EGB distribution seems quite random, but late peaks may indicate the use of pinch hitters in the closing parts of a game. It is also interesting to note that BOO “throws” a perfect game about once every 10 seasons, a bit less than the official 23 over the last 135 years.

BOOFigure3a BOOFigure3b

Figure 3a: Distribution of # of batters faced   Figure 3b: Distribution of end-game batters (2014 Toronto Blue Jays and opposition)

So do the calculations mean anything? According to the numbers, your best hitter should bat 2 or 3, that is, if you want him coming up more often with the game on the line. In “The Batting Order Evolution,” Sam Miller noted that “the anecdotal evidence is strong” to put your best hitter in the number 2 spot. The worst spot for heroics is number 7.

Furthermore, a classic run producer such as Troy Tulowitzki shouldn’t bat leadoff, something the Jays found out after he struck out 4 times, almost a month to the day after acquiring him. Dropping him to the number 5 spot, the manager John Gibbons stated, “Maybe this’ll jump-start him a little bit.” Or maybe, he saw the wisdom of inserting the 2014 NL hit leader and speedster Ben Revere in the leadoff spot and using Tulowitzki’s power in a proven RBI position.

Mind you, with a scorching hot lineup that has scored 100 more runs than the next-best hitting team, it may not matter who bats where. That is, if the game is on the line.

Do The Math! is available in paperback and Kindle versions from the publisher Sage Publications, on-line at Amazon.com, and on order at local book stores. Do The Math! (in 100 seconds) videos are on You Tube.





JOHN K. WHITE, an adjunct lecturer in the School of Physics, University College Dublin, and author of Do The Math!: On Growth, Greed, and Strategic Thinking (Sage, 2013).

12 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
foxinsoxmember
8 years ago

Really cool article, can’t wait for part two!

My guess is that the end of game batter doesn’t matter and that descending OBP produces the most runs. I love being wrong though 🙂

Quick programmer note: you can make your tables look nicer by using custom html tags

Lanidrac
8 years ago

This part is practically meaningless for two reasons:

First, the game is on the line a lot more often than just at the end of the game and often not even then. Give us some numbers on how likely a batter is to come up with runners on base and runners in scoring position. The best overall hitter should then bat closest to the upwards inflection point on the bell curve with the high OBP guys ahead of him and the high SLG guys behind him.

Even this stat itself is flawed, as it only counts when the batter actually makese the last out (with the rare exception of walk-off wins) when the previous batter could’ve been in the same situation but managed to reach base.

Second, you can’t fully trust any numbers created by such an unrealistic flat lineup. For example, in a real National League lineup, the ninth place hitter will be ending the game a large percentage of the time simply because a bench player will usually be batting there through either pinch-hitting for the pitcher or having been pinch-hit or double-switched into the game earlier. Bring on Part 2 to provide some real answers…

OB
8 years ago

Thanks foxinsox. Yes it will be very interesting to see how descending OBP looks. Lots of permutations though so I will be taking it in steps. And getting the language of Monte Carlo baseball. And thanks for the table tip – next time.

Cheers Lanidrac. Keep in mind that this was written in response to the Jays manager commenting about how important it is to have your best hitter batting first to avail of more ABs and more end-game ABs. This simplish analysis has shown that doesn’t follow. And thanks for commenting on “the upwards inflection point on the bell curve” — not so meaningless it would seem. Furthermore, flat lineups are perfect as a benchmark to analyse how a real lineup works. Watch this space.

Andy
8 years ago

Some minor points:

I think in Table 2 you mean PA, not AB. I never heard of any player getting 750+ AB in a season (e.g., last year, Ian Kinsler led MLB with 726 PA, and also with 684 PA).

If the most common number of PA in a flat 0.333 OBP lineup is 40, why doesn’t the number 4 hitter end the game most frequently? In the 0.250 lineup, the peak is apparently 35 PA, which corresponds with the number 8 hitter ending the game most often.

P.S. – Model nuclei movement in a DNA helix? I think you mean model the conformation or topology of nucleotide bases, or probably not even at that resolution, but of units consisting of several base pairs.

OB
8 years ago
Reply to  Andy

Thanks Andy, good comments. True, the numbers will be a bit high since they don’t yet include errors, sacs, DPs. But note that it’s ABs per batting order POSITION not player. The record number of ABs for a player is 716 (778 PA) by Philly’s Jimmy Rollins in 2007, who may not have had every leadoff PA/AB that year. Average ABs last year per lineup position for the Tigers were 625, which at leadoff gets you to 693 (+ 4 x 17). But yes the numbers will go down when I include all events.

As to why the number 4 hitter doesn’t end the game most frequently if the max BF is 40, look at figure 1b not figure 1a. It’s a good comment and gets to the cool math behind the bell curve (a.k.a. binomial or Gaussian). You have to add in all the BFs: BF = 31, BF = 40, BF = 49, … to get total #4 ABs.

And sorry, my biology is a bit rusty. I meant in a general way. There are lots of good examples without getting too much into the nitty gritty: satellite navigation rendering, Internet fraud checking, portfolio risk analysis, hurricane touchdown locations, the diffusion of information, climate-change predictions, …

Andy
8 years ago
Reply to  OB

OK, I see your point about the no. 4 hitter, though I think you might have explained that in the article. Basically, if there are more than 40 PA, the no. 1-3 hitters are more likely to end the game than the no. 4 hitter, because we’re on the descending side of the curve, where each additional PA is less likely than the one before it (a game with 49 PA < likely than 48 PA < 47, etc.).

The reverse is true for games with < 40 PA, so 31 PA, ending with the no. 4 hitter, is more likely than 30 or < PA. But the relative advantage to the no. 4 is less, because we're further away from the mean. Also, this is the only point where the no. 4 does have an advantage, as there is a floor of 27 PA, whereas there is no theoretical ceiling to PA on the other side of the curve.

OB
8 years ago
Reply to  Andy

Hey Andy. Even after a million sims, the curve isn’t exactly a Gaussian which makes the curve slightly off symmetry. It will also skew to the right a bit with more sims (technically possible for a game with no outs though odds of about infinity). And it’s the modulo (BF,9) behaviour that gives the right figures from the left figures.

Most importantly, Ben Revere is now the permanent Blue Jay leadoff hitter, and is tearing it up!

Andy
8 years ago

Sorry, I mean 684 AB for Kinsler.

evo34
8 years ago

You may want to check out http://www.sabersim.com. (Not my site).

OB
8 years ago
Reply to  evo34

Cheers evo, looks interesting. Lots of percentages. The problem with all sims is that they tend to wash out the extreme events. By definition, mean reverting. Cool, nonetheless.

Ryan
8 years ago

I like the premise of this article, but I feel like part one hasn’t really argued anything about how a manager should construct their lineup. You have convinced me that the lead-off hitter doesn’t usually make the last out of the game. But making an educated guess from figure 1b, I would guess that the leadoff hitter still might bat more often in the 9th inning than any other lineup position.

But even then, this article hasn’t made any connection between batting near the end of the game and “coming up with the game on the line” aside from “anecdotal evidence”.

Hopefully this connection would be made in part 2. Also, just a suggestion, you might be interested in using Leverage Index (on either baseball reference or fangraphs). Although it may be difficult to incorporate this into your simulation, this is a stat that actually measures how much the game is “on the line” instead of needing to arbitrarily decide that yourself.

OB
8 years ago
Reply to  Ryan

Thanks Ryan. I’ll add more in the next part about real line-up construction, but I wanted to limit this to where to bat your best hitter (and get an idea of how many sims are needed to see basic trends). The Jays manager made comments that your best hitter should bat number one because he will end the game more often, which interestingly turns out not to be true. Of course, the leadoff will always have the most (or as many) ABs as any other player, but is not as likely to be the clutch finisher. Thanks as well for the tip on Leverage Index. I’ll see how that can fit in.