- Published on
Quantifying and Optimizing Baseball Decision-Making
- Authors

- Name
- Tristan Mott
Defining In-Game Decision-Making
In a single baseball game, hundreds, if not thousands, of decisions are made: which pitch to throw next, whether to swing, whether to dive for a fly ball, who to warm up in the bullpen, how long to keep the starting pitcher in, etc. Some of these are split-second decisions made by players on the field, while others are carefully considered by managers. Both types of decisions are essential to the outcome of a game, but we model on-field player execution as probabilistic outcomes rather than as controllable decisions. When we refer to optimizing in-game decision-making, we are specifically referring to the optimization of management decisions under the assumption that players will perform to the best of their abilities.
Examples of management decisions that we aim to optimize include: pitcher relief substitutions, pinch-hitting substitutions, defensive substitutions, intentional walks, sacrifice bunt attempts, and stolen base attempts. Our goal is to present data about player abilities in a way that enables baseball managers to reach their full potential when making these decisions.
Modeling What Happens Between Decisions
Any baseball game can be described as an alternating sequence of management decisions and plate appearances. Each plate appearance is dominated by the current pitcher and batter, but it also involves the runners on base, who may advance or be picked off. With a model to represent everything that could happen within a plate appearance window, the problem formulation for optimizing management decisions becomes much more tractable. Because each plate appearance window is primarily a function of the current pitcher-batter matchup, we refer to such models as matchup models.
The first step of building a matchup model is to create an outcome model. For a given pitcher and batter, an outcome model gives the probability of a strikeout, walk, hit-by-pitch, groundout, flyout, single, double, triple, and home run (the exact categories could be adjusted). A good outcome model should take into account player histories, recency, sample sizes, handedness, park factors, league trends, and more.
The second piece of a matchup model is the transition model. The transition model essentially says: given the current batter, the state of the baserunners and outs, and the outcome, what are the probabilities of each new baserunner/out state? For example, if there is one out and a runner on second base and the batter hits a single, a transition model may say there is a 50% chance of the runner advancing to third base and a 50% chance of the runner scoring. If the batter is a fast baserunner, there may also be some probability of them stealing second base during the next plate appearance or getting caught stealing.
With an outcome model and a transition model, we can represent the entire plate appearance window as a set of states and probabilities. There are 24 traditional baserunner/out states (8 baserunner combinations × 3 out states), plus four inning-ending outcomes. A complete matchup model takes the start state plus the current pitcher and batter as input and then outputs the probability of transitioning to each of the 28 possible end states. Once the matchup model is complete, any baseball game can be described as an alternating sequence of management decisions and random samples from the matchup model.
Our Matchup Model
Our platform, Perfect Game, uses Bayesian machine learning to train a robust outcome model that combines player histories and league patterns with recent player performance. For our transition model, we use a Gaussian Mixture Model to bin players by their baserunning abilities and then use empirical league data to assign transition probabilities to each bin. For more details on how we construct our matchup model, refer to this paper. However, we do not believe in one correct way to build a matchup model.
We expect and encourage our users to experiment with different outcome and transition models to see what works best for their team. Many professional baseball teams already have their own proprietary models, so Perfect Game allows users to upload outputs from their own matchup model before using the decision-making features of the platform.
From Player Models to Winning Strategies
Having a reliable matchup model, whether it is a complex statistical model or an intuitive model in a manager’s mind, is essential to in-game decision-making. However, a matchup model alone is not a complete solution. An analyst who believes a player model makes them a manager is analogous to a chess player who believes knowing how each piece moves makes them a master; the matchup model describes the abilities of each piece in the game, but does not say anything about how these pieces can best be used to win the game.
Modeling Baseball as a Strategic Game
In game theory, it is common to represent sequential decision-making problems as extensive-form games. An extensive-form game is a tree structure where each node represents a state of the game and each branch represents an action a player could take at that state. In baseball, the decision-making players are the two opposing managers, while the matchup model represents chance. In some nodes, the manager of one of the teams chooses an action (like making a substitution) that will lead to the next state. In other nodes, the matchup model "chooses" an action by sampling from its distribution, making baseball a stochastic extensive-form game (some actions are determined by chance). All baseball games start in a node at the top of the first inning and end in a win or a loss. The goal of each manager is to choose a path through the tree that maximizes their probability of ending the game with a win.
In a two-player extensive-form game, a Nash equilibrium is a pair of strategies (one for each player) such that neither player can improve their outcome by unilaterally changing their strategy. Because baseball is a zero-sum game (one team's win is the other team's loss), the equilibrium strategies assume both managers will perfectly counter each other's actions. In other words, any manager who uses a strategy other than the equilibrium will be exploited by any opponent that is using the equilibrium strategy. For this reason, it is safe to consider the equilibrium strategies to be truly optimal. Thus, the goal of our optimization problem is to find the Nash equilibria of the baseball extensive-form game.
Depicted below is an example of Nash equilibrium strategies in a hypothetical game between the Los Angeles Dodgers and the Toronto Blue Jays. The Blue Jays are down 0-1 in the bottom of the 12th with 2 outs and the bases loaded. Justin Wrobleski is pitching for the Dodgers, with Yoshinobu Yamamoto, Anthony Banda, Tyler Glasnow, and Roki Sasaki available in the bullpen. Nathan Lukes is up to bat with Vladimir Guerrero Jr. on deck and Davis Schneider available off the bench. The equilibrium strategies are indicated by the blue arrows.

In this example, the equilibrium is for the Blue Jays to replace Lukes with Schneider and for the Dodgers to respond with Yamamoto. The Schneider / Yamamoto plate appearance is then determined by chance, where the game can only continue if exactly one run is scored. Interestingly, the Blue Jays would prefer that Wrobleski remain in the game, but they do not regret their decision to pinch-hit Schneider even after Yamamoto is brought in. Because the Blue Jays are playing in equilibrium, they were actually expecting Yamamoto to be brought in when they made the decision to pinch-hit Schneider (though they wouldn't have complained if the Dodgers had deviated). Equilibrium strategies always minimize regret in this way, planning actions not just one, but hundreds of steps into the future, all the way to the end of the game.
Making Baseball Solvable
Solving a complete Nash equilibrium requires computations for every single state of the game. In baseball, the game tree has far too many states for the equilibrium to be computed directly (the combination of all possible scenarios, lineups, and bullpen availabilities is astronomical). We overcome this challenge via a novel approach for compressing the quadrillions of states in a baseball game down to a much smaller number of strategically equivalent states. The exact size of the compressed game depends on how many players are available for each team (larger bullpens and benches require solving a larger game). Most games corresponding to realistic MLB rosters have on the order of tens to hundreds of billions of states. While these numbers are still extremely large, our algorithms are capable of solving games of this size in anywhere from a couple hours to a few minutes, using modern computing resources. For more details on our exact methodology, refer to this paper.
Once we compute the optimal strategy for a given game, it is trivial to look up any possible scenario and find the win value of any management decision. The use cases for this ability are vast, ranging from pre-game opponent analysis to in-game decision support to post-game performance review. By quantifying the value of each management decision, we can help teams make better decisions and ultimately win more games.
Winning One Game is not Enough
We now see that combining a matchup model with game theory in just the right way can be turned into something useful. However, there are still gaps in the discussion so far. Some baseball fans who read the equilibrium example in the previous section may have thought to themselves, "Yoshinobu Yamamoto is one of the best pitchers in baseball. Was that extra percent in win probability really worth bringing him in if it means he cannot pitch the next day?". The answer, of course, depends on context. In game 7 of the World Series? Certainly. In a regular season game when he is expected to start the next day? Probably not. To properly account for these types of considerations, we need to extend our game theory model to include multiple games.
The problem with the single-game approach is that win probability is the wrong utility, or goal. Ideally, the utility would be something like "probability of winning the World Series", but we haven't yet figured out how to condense that extensive-form game (let us know if you figure it out). A suitable proxy for this utility is expected wins over a series of games. This could be an actual baseball series against a single team, or a sequence of games against multiple opponents. Perfect Game currently supports optimization over as many as 7 games in a row. Remarkably, the same algorithms we use to compress and solve single games can be extended to multi-game scenarios without materially increasing computational cost.
The secret to optimizing over multiple games is to incorporate user-provided relief pitcher usage limits into the game state. All the user has to do is specify how many appearances each reliever can have between rest days. Once we have that information, our game-theoretic algorithms are able to rapidly evaluate every possible sequence of decisions across the entire series. Just like with the single-game scenario, we compute equilibrium strategies that optimally prepare for an intelligent opponent and minimize regret over the course of the series. In the Yamamoto example, our algorithm would consider how putting him in would affect both the current game win probability and the expected wins over future games. The calculated win value of that decision would be the sum of both components, recommending the decision only if the immediate benefit outweighs the future cost. We believe this multi-game optimization is a crucial step toward adding real value to professional baseball teams.
Perfect Game
The ideas described above are not just theoretical. They are fully implemented in our platform, Perfect Game. It allows users to create games, customize rosters, import matchup models, and compute equilibrium strategies according to their own constraints. Once strategies have been computed, users can easily navigate any scenario in the game tree and visualize every possible decision. We put control in the hands of the user, allowing them to inject their intuition, knowledge of their players, and even their own analytics into our tool. Our philosophy is to do the computational heavy lifting and then stay out of the way, empowering users to fully leverage their own expertise.
Want to learn more? Try Perfect Game or reach out to our team.