Beyond the Box Score: An SB Nation Community

Navigation: Jump to content areas:


Pro Quality. Fan Perspective.
Login-facebook
Network Message: 50% Off: CBS/SB Nation Fantasy Baseball

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

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.

Connect_with_facebook

Cbs_fantasy_baseball_promo

FanPosts

Community blog posts and discussion.

Recommended FanPosts

Picture-2_small
Advanced Graphing Techniques Part 4 - Cluster Analysis in R
770insig_small
BoaB Billy Butler Division - Draft Rounds 20 to 25
62890-z7fr_big_small
BoaB Zack Greinke Draft Rounds 16-25
770insig_small
BoaB Billy Butler Division - Draft Rounds 6-?

Recent FanPosts

Otto_-_image_adjusted_small
Good reasons for getting past the divided leagues era
Small
Nathan's Replacement
Rays_small
Chasing the Grail, Part Two
Rays_small
Chasing Sabermetric’s Holy Grail or, Another Stab at Estimating Catcher Defense
Loper_sports_small
Sabermetrics in Wikipedia Articles
Beanser-logo_small
H2H 30 Team Dynasty League needs owners
N16115505_31581383_8646_small
Tell us what you think of Bullpen Banter
Minter_small
My take on Sabermetrics as a whole

+ New FanPost All FanPosts >

FanShots

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

Recommended FanShots

I got Dye.

Recent FanShots

Spring Training Pitch FX Data
The All-CHONE Team
Think like a statistician – without the math
New "Sabermetrics Library" Feature: Free Online Course
Why I love searching baseball on Wichita's Craigslist
Chris Coghlan as a Second Baseman
Do Inexperienced Starting Pitchers Falter in the World Series?
SFiercex4 (Michael Jong) is now Triple Dipping - Writing for B-Pro Fantasy
Batting Eye – Updated and Explained

+ New FanShot All FanShots >

BtB on Twitter

Main Feed: @BtBScore

Jeff: @jeffwzimmerman
Steve: @steve_sommer
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

BtB Goes Social


Managers

Wbc_029_small Jeff Sullivan

Editors

Rawlings_baseball_bigger_small Dan Turkenkopf

Limes_125_small Sky Kalkman

770insig_small Jeff Zimmerman (TucsonRoyal)

Aviles_small Justin Bopp

Paige_small Satchel Price

Authors

Jinaz-reds-avatar_small JinAZ

Face_small Harry Pavlidis

Newavatar_small Matt Klaassen

1753738656_110919ebe9_o_small vivaelpujols

Ozzie_small erik

Big_pun--300x300_small Tommy Rancel

Adam_small adarowski

Redcap_small SFiercex4

St_louis_cardinals_ce1141_003263_small stevesommer05

Julio_teheran_2_small PWHjort

Cclogo_small Daniel Moroz