Showing posts with label Lineup Optimization. Show all posts
Showing posts with label Lineup Optimization. Show all posts

04 May 2018

Who's Batting Second? Jace Peterson Or Craig Gentry

In any discussion about batting order, it should be noted that it matters a little, but not enough to make a significant difference. This current Orioles team would be bad regardless of who's batting in which lineup spot. 

Still, it's easy to get annoyed at recent Orioles batting lineups when Jace Peterson and Craig Gentry have been slotted second. Let's run through things quickly. In March, Buck Showalter said this about batting order:
“The game has evolved as far as what we used to think a one-hole hitter looked like, a two-hole hitter, three-hole, four-hole. It’s just evolved,” Showalter said. “You see how many people are hitting what they consider their best hitter second. And a lot of people will tell you just take your best hitter and get him up to the plate as many times as possible.

“It’s really hard to find what we used to look for in a leadoff hitter and I think the focus on not giving up outs takes away a lot of the conventional two-hole hitter. It’s more about handling the bat, advancing runners. It’s one of our things we talked about, having more productive outs if we do make an out. It could be a 10-pitch at-bat, it could be having somebody move up 90 feet even though you make an out. [Emphasis added.]
Some of this is antiquated strategy, like simply wanting speed at the top of the lineup or preferring a slap-hitter in the second slot. That's how you end up with some interesting names in the leadoff spot. And why wouldn't you want the hitter who isn't "giving up outs" to bat higher? Showalter has had a hard time letting this go. That bolded part? Yes, that's what the Orioles should be doing: getting as many trips to the plate as possible for Trey Mancini, Manny Machado, Jonathan Schoop (when healthy), etc.

Showalter deserves some credit, because he's used Machado, either the team's best hitter or among the top few for most of his seasons in Baltimore, in the second spot a good amount - more than twice as much as any other player. Here's the full list (from 2011-2018), from the Baseball-Reference Play Index:

Results
Rk I Player Split From To G PA R BA OBP SLG OPS
1Manny MachadoBatting 2nd201320183681663218.287.335.474.808
2J.J. HardyBatting 2nd20112016193868103.240.283.389.672
3Nick MarkakisBatting 2nd2011201411551452.296.358.428.786
4Adam JonesBatting 2nd201120177835335.269.308.414.722
5Steve PearceBatting 2nd201320167330542.240.331.472.803
6Hyun Soo KimBatting 2nd201620176526127.285.352.370.723
7Jimmy ParedesBatting 2nd201420155021529.309.344.471.815
8Gerardo ParraBatting 2nd201520153917926.250.284.399.683
9Jonathan SchoopBatting 2nd201420174117423.266.287.491.778
10Alejandro De AzaBatting 2nd2014201516719.281.343.500.843
11Delmon YoungBatting 2nd2014201518698.328.348.537.885
12David LoughBatting 2nd20142015386510.306.313.403.716
13Chris DavisBatting 2nd2012201715617.218.295.400.695
14Nelson CruzBatting 2nd20142014136012.264.350.585.935
15Travis SniderBatting 2nd2015201513564.275.339.412.751
16Pedro AlvarezBatting 2nd2016201813496.233.327.442.768
17Nolan ReimoldBatting 2nd2011201619425.237.310.579.888
18Joey RickardBatting 2nd2016201713416.359.375.538.913
19Robert AndinoBatting 2nd201120129352.241.371.310.682
20Chris ParmeleeBatting 2nd201520157254.292.320.542.862
21Jace PetersonBatting 2nd201820185231.105.261.158.419
22Trey ManciniBatting 2nd201720185171.133.235.200.435
23Craig GentryBatting 2nd201720185173.214.353.357.710
24Xavier AveryBatting 2nd201220124141.231.286.538.824
25Michael BournBatting 2nd201620163132.300.417.9001.317
Rk I Player Split From To G PA R BA OBP SLG OPS
26Ryan FlahertyBatting 2nd2012201713110.182.182.182.364
27Endy ChavezBatting 2nd201220125112.182.182.545.727
Provided by Baseball-Reference.com: View Play Index Tool Used
Generated 5/3/2018.

But then you see someone like J.J. Hardy batting second so many times when he really only had one pretty good offensive season in Baltimore. Showalter's lineups, in which he routinely puts emphasis on platoon splits, individual pitcher/batter match-ups, and player performance in certain ballparks (see: Ryan Flaherty in Boston), can be a mixed bag. Things look great when they work out, but a lot of the time, they don't.

To start the season, Showalter tried using Chris Davis as the leadoff hitter. There was some sense behind it, though it did seem like more of a motivational tactic than anything. It didn't work. But Showalter did slot Machado and Schoop after Davis. You can argue about whether Schoop should bat third or fourth, but Showalter did seem committed to putting those guys at the top and getting them to the plate more. The lineup looked better after Mancini replaced Davis at the top.

Then Schoop got hurt. Without Schoop's name in the lineup every day, Showalter went to a new strategy: keep Mancini at leadoff, drop Machado to third, and use a platoon of Pedro Alvarez (vs. RHP) and Craig Gentry (vs. LHP) in the second spot. I'm still not sure why Machado is no longer batting second, but at least using Alvarez (career wRC+ of 118 vs. RHP) in the top third of the lineup makes sense. He's also hitting extremely well right now, with a wRC+ of 141 in 75 plate appearances.

But Gentry? He is fast, but he only has a career wRC+ of 95 against southpaws. To make matters worse, the Orioles recently added utility player Jace Peterson, who has taken over for Alvarez in the second spot against right-handers. He has a career wRC+ of 85 against right-handed pitching, but again, he's fast.

The Orioles' problem, besides not having Schoop in the lineup every day, is that they simply don't have enough good hitters. With Mancini's recent slump, Machado and Alvarez are really the only two players who are mashing. Davis and Adam Jones have been bad at the plate, and Mark Trumbo only just returned (and is a wild card anyway). But even though Gentry and Peterson bring a speed element and are good baserunners, they shouldn't be batting in the top third of a major league lineup. (At the moment, Gentry has a wRC+ of 24!)

Maybe it seems unnecessary to sweat the small stuff when there are so many major issues. Maybe we didn't realize how good we had it until now.

29 March 2018

Yes, Chris Davis Should Lead Off


A year ago, I decided to experiment a bit with lineup optimization.  If you have toiled around baseball data science a bit, you know that lineup optimization tools come down to a few realizations:
1. No one uses what a tool would consider an optimized lineup.
2. Everyone is not far off that optimal lineup.
3. The difference between the best and worst conceivable lineup is about 30 runs usually.
4. These tools rarely include enough of the right information to make an informed lineup.
I recognized that state of the research and decided to take on a challenge that most tools do not consider: the linear relationship of a lineup.

What I mean when I talk about lineup linearity is that each member of a batting lineup exists in context of those who bat around him.  While much of baseball data science is about isolation, isolation, isolation; I tried to consider context, context, context.  Yes, true talent level is best measured in a vacuum, but talent effect might well be best measured by recognizing how a player's talent is impacted by the talent of others.

Let us consider an extreme example.  Let us say we have a singles hitter.  Let's say that this singles hitter is very fast.  Let's say that he walks a lot, too.  How about we given him a line of 350/450/400 and 80 steals out of 85 attempts.  The individual we created is a super Juan Pierre.  A player like that would be worth about 5-6 WAR.  Now, what if I told you that all of his teammates struck out.  They struck out every single time without exception.  While super Pierre has 5-6 WAR "talent," his "talent effect" is below replacement level.

Why?  The way WAR works is to assign a run value to every event.  That run value is determined by league averages.  What WAR considers is this, what is super Pierre's talent in the average lineup, in the average position in that lineup, in the average base-out condition, with as many other considerations averaged out.  You can see how that is a great way to determine Pierre's true talent, but not his effect.  Because his effect is linked into his context.

With that in mind, I created (part 1, part 2) a lineup optimization tool that considered how a player does in a particular position in a lineup in relationship to those who bat before him.  The model I put together worked well and correlated to actual run production.  The model weighs heavily on doubles, home runs, walks, and strikeouts.  Those were the primarily determinants in run scoring.  It should be noted that one is limited by who actually plays in each position in the lineup.  A big bruising hitter batting leadoff is highly uncommon, so the model may well be extrapolating beyond its data capabilities.  Weird things may well happen outside of the data set.  But what was remarkable about that work was that it suggested that perhaps it was a bad idea to group power hitters.  That maybe your best home run-centric power hitter who gets on base should bat lead off.

The model declared that Chris Davis was the best leadoff hitter for the Orioles.

Fast forward to this Spring Training and a major point of discussion was that Chris Davis was in fact leading off games.  It was noted as being done to get him more plate appearances, but also noted as testing out the idea that maybe he should well be batting leadoff.  It is a scenario that Davis tends to do well with.  Last year, when he was confronted with a situation where there were no outs and the bases empty (130 PA), he hit 259/338/534 (129 wRC+) and fared more poorly in other situations with a 184/308/308 (64 wRC+).  Now, all that is just gravy.  The model does not know those situational stats.  What it recognizes is Davis' overall statistics and what it means based on how leadoff hitters have hit in the past.

This post will only look at two different lineups.  Yes, the season will offer a myriad of sequences, but we will just play around with this iteration.
Traditional Optimized
Tim Beckham 3B Chris Davis 1B
Trey Mancini LF Trey Mancini LF
Manny Machado SS M. Machado SS
Jonathan Schoop 2B J. Schoop 2B
Chris Davis 1B Adam Jones CF
Adam Jones CF Tim Beckham 3B
Anthony Santander DH A. Santander DH
Caleb Joseph CF Caleb Joseph CF
Colby Rasmus RF Colby Rasmus RF
738 runs 790 runs
This is one of those stunning model results.  Optimizing the lineup to the model results in a prediction that major gains in run scoring would happen at the leadoff position (+12 runs), sixth position (+14 runs), and seventh position (+26 runs).  The leadoff difference can pretty much be explained by Davis' increase in power over Beckham.  Sixth has more to do with run opportunities than differences in hitter makeup.  Seventh has nothing to do with the hitter and all about the opportunities he now sees.  Still, I really want to reiterate, that it is astounding that the model predicts a difference of 52 runs between these lineups.  That would be worth five wins and would greatly improve upon the runs scored by last year's team (743).

These results, however, are not astounding to us because we came to this conclusion last year and that surprise wears off.  We also saw about a month or two after publishing our results that several teams began experimenting with our approach (i.e., Kyle Schwarber batting leadoff).  With a club like the Orioles, a club without an obvious leadoff hitter and a need to find value in something that few others are doing, this might well be a kind of advantage they can exploit if the model is actually correct.

Maybe the Orioles will venture and give this idea a chance.  Or, maybe they will do what everyone else is doing and hope to beat them by playing the same game.

14 March 2017

Step 1: Find a Box. Step 2: Is Chris Davis in that Box?

Over the past few weeks, Patrick Dougherty and I have been throwing lineup optimization regression models at you.  I introduced the decade old lineup model identifying run value on a positional basis and introduced a new model that identified runs batted in on a co-dependent positional basis.  Patrick then did a thoroughly best fitting of the new model and found that Chris Davis leading off was the best iteration of the starting nine we evaluated.  However, it is easy to note that Chris Davis is an atypical leadoff hitter, so how atypical is he?

A best fit line on a scatter plot is an easy visual to understand.  You can observe the range of data on the x-axis and on the y-axis.  You have a decent handle on whether a new data point is found within that range of data points or if it is an exceptional outlier.  Intuitively, the degree to which a data point is an outlier, the more and more your concern rises about whether this model can realistically handle your new data point.

David Freedman, an economist, is known is some circles for his cheeky Conservation of Rabbits Principle.  He states that in order "to pull a rabbit from a hat, a rabbit must first be placed into the hat."  In other words, a model outcome that is different from the model input should be highly questioned, so let us explore Chris Davis as a leadoff hitter.

We shall ignore the seven, eight, and nine hitters.  A quick glance over them shows us that they are reasonable bottom third lineup hitters.  Chris Davis at the top of the order feels a bit more peculiar.  The model considers walk rate, strikeout rate, doubles rate, and home run rate.  Those metrics were the most relevant based on significance testing.

Chris Davis is projected by ZIPS to walk 11.6% of the time he is up at the plate.  Of the 300 data points over the past ten years for a team's leadoff hitter, 15 are within 10% of Davis' projection.  In total, that rate would be the 17th best and on par with excellent walk rates put forth in  2007 and 2008 by the Orioles' own Brian Roberts.  Anyway, a top ten percent walk rate certainly stretches the model, but stays within the boundaries set by the data.  With doubles, Davis is well within the model variables with his 3.7% projected rate.  That, however, is certainly not very impressive among the data points in the data set.  He would be 248th out of 300 positions.

Davis also has a projected 33.6% strikeout rate.  That is off the model radar.  As noted, the model has 300 team entries and the highest rate is the 2016 Brewers with 26.5%.  Davis' rate would be a 30% increase over that.  Davis is also projected to have a very impressive 6.6% home run rate.  That is also about a 30% increase of the next closest number, which is the 2016 Twins.  With respect to these metrics, we are in an area that the model is not well supplied to use that information. 

What about the aforementioned Mark Trumbo?  For home runs, he is 10% over the extent of the data in the model.  His doubles are right smack dab in the middle.  His strikeout rate would be third worst in this dataset.  His walk rate would also be in the middle.  As a whole, we should feel more comfortable with Trumbo's projection as a leadoff man than Chris Davis', but both are so unconventional that a regression model like this might be extrapolating effects beyond where we should feel comfortable.

The lesson here really should extend beyond the exercise Patrick and I have been performing.  It is important to understand causality and the limitations placed upon us to be able to determine what exactly causes anything else.  Certainly, I would think that we all agree that induction is useful to determine a better grasp on causation, but that we must be quite transparent and acknowledge the uncertainty involved in our methods of induction.

When we put forward such unconventional answers to well trodden fields, we must note that we have certainly extended ourselves beyond practiced reality.  True, this extrapolation may one day be shown to be true, but this is more of a leap of faith than any sober trust put into our methods.  And, that is really the crux of it.  When our universe is limited to what we have experienced, our intellectual foundation beyond that scope is weak.  No, I do not think Trumbo or Davis are ideal lead off men, but I would suggest that it is a perfectly good hypothesis to offer that they might well be ideal lead off men.

I doubt when tens of millions of dollars are at play though that we will be able to fill in our data set.

08 March 2017

Mark Trumbo is Not the Ideal Orioles Leadoff Hitter - Chris Davis Is

This post runs as a follow-up to Jon Shepherd's lineup optimization proof of concept.

Buck Showalter tinkers with lineups, but he'll never be able to try out every combination. Lineups can be considered permutations of the roster - combinations in which order is relevant, such that the same nine players can be ordered differently for a new lineup. The total number of distinct permutations of nine players on a 25-man roster is given by the following equation:
9! / (25-9)! = 741,354,768,000
Given the possibility of trades and acquisitions, not to mention the Orioles' penchant for shuttling players between the Majors and the Minors, the true number of possible lineups over the course of a season is even higher. Given only 9 batters, as Jon Shepherd worked with in his proof of concept research, the number of lineup permutations drops to a much more manageable 362,880 distinct possibilities. No amount of lineup tinkering will allow Showalter to test each of these lineups; he would need 2,240 seasons of 162 games to see them all take the field, and I doubt Manny Machado will even be an Oriole after all that time.

As a fan enabled with myriad tools for lineup optimization (and Jon's algorithm that explains the variance run production quite nicely), I sought to find the best Orioles lineup given those same nine batters that we can reasonably expect to feature as starters at least very frequently in 2017. I sifted through all 362,880 possibilities thanks to the built-in permutation generator in Python, ran each through Jon's algorithm, and recorded the results.

Because I considered all possible lineups, I had no need to establish a set of assumptions that would guide me. I don't need to start with Chris Davis batting fourth because of his skillset. I expected to see a sort of cycle in the most productive lineups, resembling something like 3-batter groups that end with a power hitter. This follows Jon's suggestion that a batter's ability to produce runs is predicated largely on whether the batters before him can reach base. I did not expect to see a prototypical leadoff hitter batting first, because innings rarely end so tidily as to allow the following inning to start over at the top of the lineup. More often the man leading off an inning will not be the leadoff hitter, and in my eyes, this indicates that the importance of a "true leadoff hitter" is vastly overstated (the importance of a player with true on base skills is not).

The most productive lineup suggested by this exercise is the following:
1B Chris Davis
LF Hyun-soo Kim
2B Jonathan Schoop
DH Mark Trumbo
3B Manny Machado
RF Seth Smith
CF Adam Jones
C Welington Castillo
SS J.J. Hardy

This lineup is worth an estimated 885 runs over the course of 162 games, not accounting for handedness splits. That would be 141 runs more than the Orioles scored in 2016, and 50 runs more than the Mark Trumbo-led lineup that Jon suggested last week. In fact, Davis was the leadoff hitter in four of the 10 most productive lineup permutations. Perhaps Trumbo is not the ideal leadoff hitter after all, but Davis, his left-handed counterpart with a similar batter profile, is!

This lineup is worth 287 runs more than the worst lineup combination possible from these nine players, a Machado-led abomination that slotted Trumbo, Adam Jones, and Davis as the 6, 8, and 9 hitters, respectively. Such a batting order would fly in the face of traditional lineup construction as well as this new machine-led practice.

More importantly, if we assume that last year's run prevention is indicative of this year's run prevention, we can estimate how well the best and worst lineups would perform according to pythagorean win-loss. Again, assuming that the 715 runs scored against the Orioles in 2016 carries over and would be identical in 2017 (unlikely, and a tenuous assumption at best), the pythagorean win-loss record would estimate the following results for the best and worst lineup permutations:

Projected Runs Scored, 2017
Runs Against, 2016
Pythagorean Win %
Pythagorean W-L
885
715
59.6%
96-66
598
715
41.2%
68-94

By this estimate, the best possible lineup is worth 28 wins. This matches up with the rule of thumb that 10 runs is equivalent to one win. The best possible lineup, with a projected 885 runs, is expected to score 100 runs more, or 10 wins better, than the traditional lineup put forth in Jon's article.

If this exercise is to be considered accurate, then lineup optimization is critical to a team's success. It boggles the mind that the more analytical front office and managerial combinations haven't considered context-dependent lineup optimization if they are believed to be the difference between a team fighting for a playoff spot and one of the best teams in the league with minimal tinkering.

I end with the same question Jon posited: have teams neglected the importance of lineup optimization because of some normalized tools and broad rules of thumb?

I choose to believe that there are human factors pushing teams away from this sort of radical overhaul, specifically that players wouldn't like it. As antiquated as they are, RBIs and lineup position seem to be points of pride for many players, and it's not a stretch to think that a prototypical leadoff hitter can market himself as such and earn a higher payday than he would if the skillset asked of the first lineup spot was fungible. Making players uncomfortable likely has real effects, even if there's no technical reason why batting seventh should be any different than batting second. It may also drive free agents to consider other teams that won't torpedo their ability to market themselves, or toss their routine into a blender every time someone new joined the team.

Further, many fans and owners would likely be too quick to call an experimental lineup a failure. One bad game out of batters would be enough to lampoon the manager who organized it, and persistence in the face of a handful of failures would probably lead to the manger's and/or GM's ousting. In terms of self-preservation for a manager or GM, it makes far more sense to leave those wins on the table and use the standard, sub-optimal batting order formula that every other team uses. It's similar logic to why NFL coaches kick field goals and PATs more often than they should, when going for a first down or two-point conversion improves win expectancy: it's safer to lose doing what's accepted than to lose doing something radical, even if the radical idea made the loss less likely.

There may also be a technical limitations to this process that has prevented teams from truly optimizing lineups. It took nearly three days to run all 362,880 batting order permutations through Jon's algorithm, and that was only with 9 batters. All possible lineup permutations given the full 25-man roster caused a memory error on my computer. I can't imagine trying to expand this algorithm to consider the 40-man roster, which would hold over 99 trillion permutations. Doing this on a regular basis for each team would take more than just modeling and coding knowledge; it would require a deep understanding of how to efficiently manage physical storage, and likely a huge amount of it at that.

However, the benefits that can come from analyzing the order of just the nine batters the team expects to play most often seems to have some benefit that doesn't require a supercomputer or a superanalyst. I then return to the thought that maybe shaking up the lineup may be akin to shaking a hornet's nest, both in terms of upsetting players and risking careers.

28 February 2017

Mark Trumbo is the Ideal Orioles Leadoff Hitter

Mark Trumbo - Ideal Leadoff Hitter
In the early days of this current era of data science, one managerial choice that would cause ire was the batting order.  Modelers would use newly appreciated existing metrics, on base percentage and slugging, to regress lineup position against total team runs scored.  That was based on work by past luminaries in the field, such as Cyril Morong, Tom Tango, Ken Arneson, and Ryan Armbrust.  This enabled fans to figure out what was the best lineup.  You can use that tool for yourself here.

Here, we will use that approach to assess the Orioles.  On proof of concept, we shall do something simple.  Let's assume that Welington Castillo, Chris Davis, Jonathan Schoop, Manny Machado, J.J. Hardy, Hyun-soo Kim, Adam Jones, Seth Smith, and Mark Trumbo would play every game and that their performance would be in line with 2017 ZIPS projections.  We can plug in their projected OBP and SLG to find out what lineup would be best for the Orioles.  The tool finds two lineups producing equal value and above all other lineups:

LF Hyun-soo Kim
1B Chris Davis or 3B Manny Machado
C Welington Castillo
DH Mark Trumbo
3B Manny Machado or 1B Chris Davis
2B Jonathan Schoop
CF Adam Jones
SS J.J. Hardy
RF Seth Smith

In general, parts of the lineup make sense and other areas are rather curious.  Kim leading off makes sense because the tool values leadoff men who do not make outs and, according to ZIPS, he will have a .370 OBP.  That sets the table for the batters following.  Davis or Machado following him makes sense because you want to maximize your chances of being able to score this OBP-abled Kim.  Castillo as the third hitter seems questionable, but this model acknowledges that league data shows that the third hitter in the lineup faces remarkably fewer RBI situations than hitters in the second, fourth, or fifth slots.  The rest of the lineup makes some traditional sense.  You can read up more about this kind of lineup optimization here.

Perhaps what is more interesting about the above lineup tool is that the difference between the projected best lineup and worst is 59 runs.  That difference of six to seven wins is large, but less so when you consider the worst fathomable lineups are something no manager would ever do.  Meanwhile, the best lineups are quite close to what we traditionally envision.  For instance, the worst projected lineup is one with Davis, Machado, and Trumbo filling out the final three slots in the batting order.  It would never occur to Buck to arrange his hitters like that.  So, the major take home message for all has been, in effect, lineup order rarely matters because a manager's lineup is usually incredibly similar to what this tool projects to be the best lineup.

Now, I think there are obvious problems with this tool.  By using a league wide population as a data set and then applying regression, we are assuming that each batter in each lineup position exists separate from other batters.  What I mean is that Manny Machado in this tool does not have Kim in front of him and Castillo behind him.  Machado, instead, follows the league average leadoff hitter and is followed by a league average third slot hitter.  This lack of connectivity between players is an issue.  Yes, ideas like lineup protection are poorly evidenced, but I am more referring to how hitter ability improves run scoring chances.  This makes sense.  If you have an elite OBP generator in front of you, your lineup position is potentially more productive than the league average lineup position.  Overall, that may have great impact.

With that in mind, I decided to create a new tool and run a different regression model.  This model did not consider on OBP or SLG metrics.  Those metrics were strangely revolutionary over a decade ago, but have their limitations.  They encapsulate a great deal of information that include different skills that may be useful in different scenarios.  Instead, I focused on event rates of walks, strikeouts, and various batted ball results against Runs Batted In minus Home Runs (based on the assumption that home run RBIs of the batter were lineup independent).  Each lineup position took into consideration the performance of that player, but also the players who bat before that player.  The data set I used was league wide and by team from 2007 to 2016. 

Using this approach frees ourselves from only considering a player by a context-free lineup position.  Once I developed the formulas for each batting position, I then compared the expected runs to actual runs and resulted in a trendline fit with a R(2) of 0.84.  I wondered how well the model would work if each lineup position was normalized and wound up with a R(2) of 0.68.  In other words, consideration of lineup order was a major consideration in improving the fitness between the relationship of expected runs and actual runs.

At this point, we can go back to that original dataset of nine Orioles hitters.  Remember, this is a concept piece, so we should not take this exercise as how many runs the Orioles will score or even that this lineup is universal and invulnerable to handedness.  Instead, we should merely look at this as a simple exercise to see where the different kinds of production appear to fit best using this lineup position model.

In this post, my limited coding know how leaves me unable to create a computer program to figure out the best lineup.  Therefore, I decided to go about this using some knowledge about where certain players might fit best (until Patrick Dougherty finishes the build and runs the model, which will be a later post).  I began with the assumption that Chris Davis is ideally the cleanup hitter.  From there I took the other eight hitters to see who increased his value the most in the three spots ahead of him.  What I found is that Davis has the most expected RBIs if Seth Smith, Hyun-soo Kim, and Manny Machado batted in front of him.  He would stand to see 87 RBIs in addition to his 46 HR RBIs (over the course of 162 games played).

I then moved on to Manny Machado in the third slot, which goes against the rationale of lineup optimization perspective that began this article.  While, the Smith and Kim were a good one-two punch before Machado, a little shifting around of names found a far batter solution with minimal impact to Chris Davis' projected RBIs.  The result was fairly surprising in that the model appears to think that the best one through four for the Orioles is Trumbo, Smith, Machado, and Davis.  With great certainty, I can tell you that this model is the only thing on this Earth that has suggested that Trumbo should lead off.

Before revealing the rest of this "ideal" lineup, let me explain some things about run opportunities.  Trumbo leading off does make some sense in that each position in a lineup is greatly dependent on the abilities of those who come before the player.  For instance, if you are a cleanup hitter then you will not exactly want a great OBP player leading off.  Why?  A good OBP player leading off will let the inning go to the second and third hitters.  Past the first inning, that leadoff hitter stands a good chance of batter when the worst batters in the lineup have hit right in front of him and likely were turned into outs.  Those second and third hitters that follow the leadoff hitter will also become outs the majority of the time.  This means that there is a great chance of the inning ending and the clean up hitter coming up as the first or second batter without no one on base.

That makes sense, right?  You want to maximize the batters on base immediately before you best base clearing hitter, but also isolate them enough from inferior hitters who rack up outs and put the base clearing hitter in scenarios where there is nothing on base to clear.

Well, the next question comes to why then have such an extreme home run hitter batting first and not fifth to clean up what Davis cannot get to?  The reason against that is that Davis does two things really well: (1) knocking in base runner with a lot of homeruns and (2) getting a lot of strikeouts which ends innings.  This means Trumbo has to contend with a player who will often clean the table by homerun or striking out.  With a strikeout, the inning ends or players do not move up a base.  That decreases run opportunities.  There is a logic there that the model is expressing.  It is possible that putting a secondary base cleaning threat at leadoff, you give him more plate appearances to knock himself in as well as making most of a poor situation at the bottom of the order with poor hitters racking up outs.

After some more tinkering, the final model projection is:

DH Mark Trumbo
RF Seth Smith
3B Manny Machado
1B Chris Davis
CF Adam Jones
2B Jonathan Schoop
LF Hyun-soo Kim
C Welington Castillo
SS J.J. Hardy

In the end, this lineup looks like a wholly reasonable lineup if the only thing you did was flip Trumbo and Jones.  That flip will often be made due to the belief in speed needing to be in the leadoff position, which might be a questionable conviction.  The Trumbo leadoff model suggests a 162 game production of 834 runs, while a Jones leadoff model nets 827 runs.  Seven runs, so not that big of a deal.

What is interesting is if one flips Seth Smith with Mark Trumbo.  A simple flip of the first two batters while leaving everyone else the same.  Run production drops from 834 to 797.  Thirty seven runs.  That seems very drastic to me.  Very, very, very drastic.  In the traditional data model above, a flip of two players would result in a very minor change in run production.  Is that because it would literally result in a minor change of run production or is it because the flip assumes all positions are context neutral to that position.

One other lineup to test would be this one: Kim/Smith/Machado/Davis/Trumbo/Jones/Schoop/Castillo/Hardy.  This is a very generic, normal lineup.  How is it viewed? 782 runs.  Here we have an "ideal" lineup generating 834 runs and a perfectly normal lineup getting dropped to 782 runs.  That spread is nearly equal to what the traditional model thinks the difference is between the best and worst lineups possible.

It may well be that in order to have a useful lineup optimization tool that you need to consider chaining production, linking the players in the lineup into a greater entity than just assuming a player's talent is independent of others by the assumption that they are surrounded by league average talent and abilities.

I am unsure whether I truly believe this, but, after several days of hammering it, I am at a loss as to what I might not be considering.  Have we really neglected the importance of lineup construction because of a simple overly normalized lineup tool presented over a decade ago?