Bases Loaded, 2 Outs, Full Count, What Should the Pitcher Do? (Exploring Baseball and Game Theory)
There's going to be a decent helping of math later in this article. You've been forewarned.
Edit: MattS with an excellent comment on why most of what I did was wrong. That said I still believe the concept itself is interesting (others do too apparently) and the math is all correct, so I still think it's worth a read. Just don't treat the final results as anything applicable to real baseball.
The full count has always been my favorite count, mostly because the next pitch (if not fouled off) has to determine the outcome of the PA. My favorite base state is when the bases are loaded since there's no open base for the pitcher to just walk the batter. What happens when you combine those two and then toss up two outs on the board to boot? Besides a boatload of insanity, I'm not really sure, but I think we can try using some game theory to tell us what should be happening.
What's Game Theory?
One of the things that has always interested me in life is game theory and its applications. Wikipedia defines everything much better than I can, but basically game theory boils down to making the best choice given the decisions other players have made. Military, business, poker, even relationship (what girl doesn't like a date's plans being broken down into a normal form game?) decision makers use (or they should) game theory to derive at the optimal decision. Baseball shouldn't be much different.
Is this Even Practical?
Well, it depends on what your definition of "is" is. Naturally, we're going to run into some problems. This game I'm conducting assumes pitchers have total control over where they are placing the ball, when they probably do not. In fact, there's likely a good amount of selection bias towards pitchers with less control since we're looking at a 3 ball count to begin with. I also assume the batter doesn't know if the ball is in or out of the strike zone when he decides to swing at the pitch. This is probably most of the time really, but there are certainly times where the batter does know that the incoming pitch is out of the zone, like the one hit by pitch that occurred in this situation last year. But in practice a lot of game theory games don't play out like they should anyway, yet it's still useful to look at the theoretical outcomes.
(Aside: I'm not sure if any pitchers consciously do anything like this, but I wouldn't be surprised if they did. Most have probably heard of Brian Bannister's sabermetric tilt, but I would love to have an interview with Greg Maddux to see if he did anything like this. Greg, if you're reading this, my email is in the link on my name.)
Alright, I'll play your game. How do we set it up?
Remember, we're only dealing with the 2 out, bases loaded case in this article. The run expectancy of this state per BP's 2008 RE Chart is .799, which I'm gonna call .8 for easier calculations. I feel like this is an even "simpler" game than the full count in general, since if the pitcher throws a ball in this case he's going to allow a run, which he almost certainly doesn't want to do. But that doesn't necessarily mean he shouldn't ever throw the ball outside the strike zone either.
Huh? you may be thinking after that last sentence. Why would a pitcher ever want to intentionally throw the ball out of the strike zone in that situation? The answer is because the batter thinks the pitcher would never throw a ball out of the zone in that situation, so he's more likely to swing at any pitch, in which case he's a lot less likely to be able to do damage on a pitch out of the zone (I assume, haven't actually seen some in zone/out of zone slugging charts yet). This is the essence of game theory, using what your opponent thinks you're going to do to your advantage. Hopefully this chart will make things a bit more clear:
Explanation
I think the extended game is pretty easy to follow for the most part. The dotted line connecting the batter nodes represents the fact that he does not know whether the ball will be in or out of the zone when he decides to swing. The numbers at the end of each line represents the payout, or the value to the pitcher of each outcome. Since .8 runs are expected to score given this state, I set the value of a strikeout at +.8 for the pitcher. If the pitcher walks the batter its worth -.2, which is the .8 expected runs minus the 1 run that scores from a walk, .8 - 1 = -.2. I think those are fairly straightforward, but if people have a problem with that setup let me know in the comments.
The one issue which is definitely up for debate is how to value a ball in play, both on pitches in and out of the zone. I'm counting a HR as a ball in play for this scenario rather than draw a separate node, but I think we can all agree a HR is worth -3.2. Since the runners are almost always running on a 3-2, 2 out pich, for simplicity I think we can say a single is worth -1.2 (2 runners score on a single) while doubles and triples are worth -2.2. And like a strikeout, an out on a ball in play should be worth +.8. The problem arises in assigning probability to each of these outcomes, since the contact node is really just a summation of these 5 possible outcomes. Thinking about it more, I guess there's 6 possible outcomes if you count foul balls. I'm just going to value them at 0 for this exercise since they don't directly decide the outcome of the event, though I wouldn't be surprised if they're worth some tiny negative amount since they might be more likely to lead to a negative event in the future (negative to the pitcher).
But back to the issue at hand, assigning a probability to each ball in play event. The best way to do this would be a historic look at all 3-2, 2 out, full counts to see the probability of each event happening. I unfortunately don't know how to do that, if the data is even out there. I only have last year's data to work with regarding pitch fx, and there were only about 300 pitches of so thrown in this scenario, which is way too small a sample to try and extrapolate from. The easiest way would be to use the averages from last year overall, but I think that detracts from the whole purpose of looking at the special event, as I'm pretty sure pitchers react much different in this situation than in general. So as the compromise I'm just going to use the outcomes from last year when the bases were loaded, regardless of outs. It's easily available on B-Ref, a cursory glance at tOPS+ says it correlates heavily year to year, and I think the 2 out distinction isn't so huge to set it apart from the bases loaded situation in general. If anything I think the lack of the full count stipulation is the biggest effect, but whatever I've droned on long enough on this let's move on.
So using last year's percentages, we conclude that a ball in play is worth -0.07 runs ([776*-1.2]+[300*-2.2]+[124*-3.2]+[2180*0.8]) / 3380 = -0.07219. Now there's the other issue of how much to change that value for a ball in or out of the zone. I guess first it should be asked whether the location of the ball even has an effect on the outcome. Intuitively I think it does, in that a ball in the zone is more likely to turn into a hit since it's easier to make solid contact on a ball in the zone than out of it. How much so though, I have no idea, and thus I'm not sure how to adjust the runs for in and out of the zone. So for this example I'm going to leave them the same, though I'm not thrilled about it. If anyone has seen any studies on in/out of zone hit effect let me know, it's something I'll probably look at more later.
Solving the Game
Alright, now we're moving on to the fun part; figuring out the optimal strategy for the game. In reality, the percentages you apply to each outcome should vary by batter, I think Jack Cust and Pablo Sandoval would treat 3-2 counts (assuming Sandoval ever sees one) very differently. Really, the same should be done for each possible hit outcome, so the "contact" node should be like 5 different branches coming from it, but I'm too lazy to bother with it right now. So we're just going to be using averages, since that's what we've been using up to this point anyway.
The medians for batters that qualified for the batting title last year per Fangraphs is about 89% contact in the zone and 62% on pitches out of the zone. Plugging these percentages into our chart, we can calculate the value of swings for the batter in and out of the zone. It turns out a swing in the zone is worth .0257 runs, and a swing out of zone is worth .2606 runs. That's not a typo, if my calculations were correct (which I think they were, we can argue about the basis of them, which I still have problems with, later) then a swing on a pitch out of the zone is worth ten times as much to a pitcher than a swing in it. Granted we're working with fractions of a run here, but that's still pretty interesting.
But the game isn't through yet, far from it. Next we need to figure out how often the batter needs to swing to make the pitcher indifferent between throwing a pitch in or out of the zone. Again, this is assuming the batter doesn't know if the ball is going to be in the zone or not when he has to decide to swing. This is probably the case some of the time, and probably more often in a 3-2 count than a lot of other counts (a batter knows a 3-0 pitch is going to be in the zone the vast majority of the time for example). This is a simple multivariable linear equation, where:
.0257x + .8y = .2606x -.2y
x + y = 1
where x = % of the time swinging and y = % of the time taking.
Solving we get y = .2349x and y = 1-x
1-x = .2349x
x = 1/1.2349 ~ .8098. Thus the batter should be swinging about 81% of the time and taking the pitch 19% of the time, in the Nash equilibrium of our game.
Meanwhile, the pitcher should know all this, and it should affect how often he throws in the zone. This multivariable linear equation looks like:
.0257a + .2606b = .8a - .2b
a+b = 1
where a = % of pitches in the zone, and b = % of pitches out of zone
Solving again we get y = 1.682x and y = 1-x
1-x = 1.681x
x = 1/2.681 ~.373. Thus the pitcher should be throwing the pitch in the zone about 37.3% of the time, and out of the zone 63.7%.
Putting all this together, the Nash Equilibrium of our game results in the value of .173. It's been about a year since my last game theory course but I think I did it all right, someone please correct me if the math seems off. Here's a picture of what a solved game looks like:
That's the proper strategy? I would have never thought so.
That's one of the most surprising things about game theory; the results can often be quite counter-intuitive. You'd be surprised what solving a game shows, the Prisoner's Dilemma being the most common case of "Hey why don't you do it the other way it's better for both of you?"
While those are the results of the game, and they should be correct, the basis is still up for plenty of debate. I'm definitely not completely satisfied with either the run values for contact for each branch, or the percentages derived for each. And it doesn't take into account things like pitch type, which I think is pretty important in this situation. You can sub in whatever numbers you feel are correct, but the basic construction of the game should still stand.
What's it like in the real world?
I was quite interested to see what pitchers did in 2008 in this situation, so I consulted the handy pitch fx database. It's only a small sample of a couple hundred pitches (446 to be exact) in the 2 out, bases loaded, full count situation, but the results were quite interesting:
Pitches in zone: 278, or 63.3% Pitches out of zone: 168, or 37.7%.
Almost the exact same numbers in our game, except the zones are reversed.
Pitches swung at: 324, or 72.6% Pitches taken: 122, or 27.3%.
These number are much closer to the ones in our game than the pitchers are.
And to shed some light on the fact that batters can tell pitch location probably a lot better then I accounted for:
Pitches swung at in zone: 86.7% Pitches swung at out of zone: 49.4%
And here's the discipline chart:
Well I mean look at some of those balls out of the zone, pretty sure even I wouldn't have swung at those. To be fair, it would only because I'd already be in the fetal position in the batters box by the time the ball got to the plate.
4 recs |
11 comments
|
Comments
Why not eliminate the information set?
You saw the stats yourself. The batter has some knowledge if the pitch is in or outside the zone, with some error. I think the results would be much more accurate if you changed it.
by enoscountry on Mar 30, 2009 8:56 AM EDT reply actions 0 recs
Game Theory
I have taken more Game Theory courses than most people care to dream of— I’m an economics PhD student in a department that focuses on it strongly, and my dissertation incorporates a lot of game theory in it. So while I like the idea behind this article, you do not have the right information set or decision set for this game to properly model reality. That’s not to shoot down the effort or the fact that this is clearly a useful application of game theory, just that you need to model things correctly.
First of all, you messed up the run values. It is exactly 1 for a walk, because that puts the pitcher in the same situation that he was in beforehand but with the scoreboard changed by one. It would only be -0.2 if the inning subsequently ended after the walk- generally not the case unless it’s the bottom of the 9th. I cannot tell if you moved the bottom of the ninth from your data set, but clearly that’s relevant and necessary (obviously there are other issues with assuming run values are the same, but you can set that aside for tractability). Also, you did the same thing for balls in play— a single is not -1.2. It is the difference in between -2 and the run value decrease from having runners on 1st & 3rd with 2 outs, versus bases loaded and 2 out. That is approximately -1.8. This is similar for other hits as well.
There is a lot of heterogeneity in baseball— the run value for throwing a strike to a pitcher or even utility infielder is very different than grooving a meatball to a power hitter. That changes the run values significantly, and makes this data set not really possible to analyze in this sense. I know you slightly allude to this, but it renders any results useless given the strong differences in batting eye and average on contact for different players.
The batter also has some sense as to whether the pitch is a strike— naturally batting eye is largely heterogeneous across the population of hitters as well. The real game being played is pretty much fastball vs. breaking ball or offspeed pitch. The pitcher is also not selecting whether to throw a pitch inside the strike zone. He is selecting a certain probability distribution over locations in the strike zone and out of the strike zone, and the type of pitch he is throwing. The batter is not choosing to swing randomly— he is choosing a reaction function to a noisy signal of location and pitch type.
The results you get there clearly need to be corrected for run values. You are severely underestimating the run value of making contact, but the reason that you get the counter-intuitive result you get is that you assume that the probability of swinging is unrelated to pitch’s location— something clearly false demonstrated by the difference between o-swing and z-swing percentages. After all, the main assumption driving your result is that pitches out of the zone will be swung at 81% of the time. You basically have modeled the batter as a large paddle that is less likely to hit a ball in and out of the zone but equally likely to swing at it. Of course the best choice is to throw it out of the zone.
Solving the game this way is not going to get you anything. If you want to at least be thorough in analyzing it this way, you should try to look at subsets of comparable hitters. An improvement might come from actually modeling the signal that the pitcher initially sends— presumably batters swing at balls out of the zone only when they think they are strikes and take pitches that are in the zone only when they think they are balls. That should give you a starting point to measure the noisiness of the signal the pitcher sends. Even ignoring the more obvious tradeoff between fastball/curveball, this could be somewhat useful.
The value of contact for pitches out of the zone is much lower than in the zone. Check Bill James for data on this. The best batting averages on pitches out of the zone are in his annual frequently, meaning someone has data on the value of swings and out of the zone.
To model reality, your best shot may be to assume that batters and pitchers are playing the game correctly, and back out parameters that make the most sense to generate the equilibrium for subsets of similar hitters (such as probability that a strike looks like a strike, and a ball looks like a ball). Then you check if those parameters make sense given other information. If not, you have a qualitative result that is useful— whether pitchers should throw more or fewer pitches in the zone, and whether hitters should swing more or less, given the pitchers choices. In real life, behavioral economists have shown this type of game is clearly not played perfectly in real life.
Don’t take this as negative— this is a good idea, and with the exception of messing up the run values, you did a great job at solving for the equilibrium given those values. You would not believe how few of my students do this, and I think you clearly have the capability of analyzing a complex mixed strategy nash equilibrium model— which is a rare skill and probably a skill most front offices don’t have. Let me know if you want to discuss this more over email, and I’ll contact you at the above address.
by Matt Swartz on Mar 30, 2009 9:54 AM EDT reply actions 5 recs
accidental crossout
no idea how i crossed that out— that was supposed to be regular text.
by Matt Swartz on Mar 30, 2009 9:55 AM EDT up reply actions 0 recs
This is an excellent response Matt
I’m pretty busy with work the next couple of days but I’ll definitely be in touch with you later.
Can't get enough of the Oakland A's? Visit Oaktown Awesomer's. For further statistical analysis, Beyond the Box Score.
by iamawesomer on Mar 30, 2009 1:14 PM EDT up reply actions 0 recs
"a swing on a pitch out of the zone is worth ten times as much to a pitcher than a swing in it"
The magnitude is surprising, but whiffs and weak contact abound out of the zone – although I’d suspect the value of the OOZ swing varies by inside/down vs. outside/up …. maybe ….
by Harry Pavlidis on Mar 30, 2009 10:16 AM EDT reply actions 0 recs
Great stuff
I love this article, and I appreciate Matt’s detailed input, too. This has piqued my interest, and I am clearly going to have to read up more on game theory.
by Mike Fast on Mar 30, 2009 11:04 AM EDT reply actions 0 recs
Great Idea
I’d love to see a revision of this scenario, and more in the future. This could be a great way to analyze baseball situations in a smarter than normal way. Perfect for this site.
by yankee13man on Mar 30, 2009 6:00 PM EDT reply actions 0 recs
This is a great article and a great response. I need to refresh my game theory knowledge but either way this is a great approach to such a common baseball situation
by njmetfan12 on Mar 30, 2009 7:30 PM EDT reply actions 0 recs
The general idea is this—
There is no “pure strategy Nash Equilibrium” here. That would be a situation where they both pick one option and neither one regrets the decision, given the other’s choice. For instance, if the pitcher chooses to throw a ball, the batter won’t swing. But given the batter won’t swing, the pitcher would choose to throw a strike. But given the pitcher will throw a strike, the batter will swing. But given the batter will swing, the pitcher would choose to throw a ball. You follow that circle forever, with no answer.
As a result, we need another way of defining “Equilibrium” which pretty much entails no one regretting their strategy given the other person regretting their strategy. In Rock/paper/scissors, this is easy. Everyone goes with a 1/3 chance of doing each, and no one wishes they made a different decision. But there’s a hidden key to this equilibrium— the reason that both people are picking the a third/a third/a third strategy is that the payoff to each is the same. If someone went with a 40% chance of doing rock, 30% paper, and 30% scissor, then the best response is to pick paper 100% of the time— and naturally the best response to that is no longer 40/30/30. So the equilibrium comes from making your partner indifferent.
Where things get harder is when the payoff is not the same each way. Then you need to pick the strategy that makes your opponent indifferent, which requires the math Iamawesomer uses above. The mistake that most of my students make is that they try to pick a strategy the person picking the strategy indifferent, causing everything to unravel. Iamawesomer did it dead right, but the key was to pick a strategy that makes your partner indifferent, since that is the only way no one regrets their strategy after observing the other player’s.
by Matt Swartz on Mar 30, 2009 8:46 PM EDT up reply actions 0 recs

by 



















BtB on Facebook















