Beyond the Box Score: An SB Nation Community

Navigation: Jump to content areas:


Sports blogs for fans, by fans.
Around SBN: Fedor vs Rogers Results and Live Coverage

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:

Game_theory_chart_3-2-2out_bases_loaded_medium

Star-divide

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:

Game_theory_chart_3-2-2out_bases_loaded_solved_medium

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:

Full_count_chart_medium

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  |  Comment 11 comments |

Story-email Email Printer Print

More from Beyond the Box Score

Speed Check - AFL vs. MLB

Nov 2009 by Harry Pavlidis - 4 comments

Comments

Display:

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

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

Comments For This Post Are Closed


User Tools

We use numbers and stuff.
Community Guidelines
Why be a member?
Start posting on Beyond the Box Score »

Join SB Nation and dive into communities focused on all your favorite teams.

FanPosts

Community blog posts and discussion.

Recommended FanPosts

Small
PZR-based Win Values 2001-2006

Recent FanPosts

Small
The "30 parks on a budget" challenge
Sunflower_small
World Series Simulation, Game #6
Small
JT20 Dynasty League
E52205a2_small
New Look
Sth70021_small
Exploring Hit f/x, Albeit Badly
Redcap_small
Ricky Nolasco: 4 WAR or 1 WAR?
Redcap_small
Apparently I can't do park adjustments
Small
Which tells us more: The last 7 at bats or 7 at bats against this pitcher?
Sleepy_jeff_small
How Efficient and Effective Were the Rockies in 2009?

+ New FanPost All FanPosts >

FanShots

Quick hits of video, photos, quotes, chats, links and lists that you find around the web.

Recent FanShots

The Mistake Lottery
On the Field, the Yankees Are The Team of the Decade. Off It? The Red Sox.
Tigers' all-time WAR leaders
Primer on Runs Created
How to improve basketball
LB Keith Bulluck uses a sabermetric analogy to explain the Titans' quarterback situation.
Alcides Escobar "abandoned his daughter before she was born"
UZR, Scouting, and the Fans
Not-So-Lousy Lineup Optimizer, Playoff Edition: New York Yankees

+ New FanShot All FanShots >

BtB on Twitter

Main Feed: @BtBScore

Tommy B: @tommy_bennett
Sky: @BtB_Sky
Dan: @dturkenk
Harry: @harrypav
Jinaz: @jinazreds
Jack: @jh_moore
Erik: @Erik_Manning
Tommy R: @trancel
Justin: @justinbopp

Subscribe to BtB via Email

Enter your email address:

Delivered by FeedBurner

Most Commented

Limes_125_small
Time To Move On
Aviles_small
Minnesota: Fielding TargetView Before & After JJ Hardy
Nando_small
A Complete and Lenghty List of Baseball-Related Things Miguel Olivo is Good At
770insig_small
Negative Team WAR - 2009 Edition
E52205a2_small
New Look

BtB Goes Social


Managers

Nando_small R.J. Anderson

Limes_125_small Sky Kalkman

E52205a2_small Tommy Bennett

Editors

Face_small Harry Pavlidis

Rawlings_baseball_bigger_small Dan Turkenkopf

770insig_small Jeff Zimmerman (TucsonRoyal)

Aviles_small Justin Bopp

Authors

Banny_small erik

Raysring1_small Tommy Rancel

Jinaz-reds-avatar_small JinAZ

Jmlogo_small Jack Moore

1753738656_110919ebe9_o_small vivaelpujols

1_small Graham

Baseball_small Mike Rogers

Redcap_small SFiercex4

Small Patrick Clark

Walter_album_small Walter Fulbright