KCL Expected Runs Using Markov Chain
By Jackson Wiggins
What is a Markov Chain?
Andrey Markov was a Russian mathematician in the early 1900s known for his work with probability and statistics. His research led to a process known as the Markov Chain. This process starts with one state and looks at the probability of moving to the next state. The Markov Chain can be used in simulating situations in baseball, such as predicting the expected runs that may occur in an inning. This can be useful to the manager or coaches of a baseball team in making decisions in game time situations.
With the high volume of game data available for the four teams of the KCL, I thought it would be interesting to develop a Markov Chain analysis that could continue to provide more and more data as the season progresses.
The Process
The most challenging part of constructing a baseball Markov Chain is collecting the data. As each batter comes to the plate it can be captured as one of 24 baseball situations. (example: A runner on first and second base with 2 outs, a runner on third with one out, etc) I assigned each of the baseball situations a code that would allow for analysis. The first part of the code reflects what if any players are on base, and the second part of the code indicates how many outs exist when the batter comes to the plate. (example: 23,1 means that there is a runner on second and third base with only one out)
The way the Baseball Analytics Interns capture the play by play information for KCL allowed me to begin translating the information into the baseball situation codes. Although time consuming, entering the data in an Excel spreadsheet following each game made it manageable to quickly turn around each of the two games played each day. As the dataset grew over the summer the accuracy increased, especially among the less frequent baseball situations. At the conclusion of the KCL season, there are over 700 at-bats used to create an Expected Runs Matrix (eRunsmatrix).
The Expected Runs Matrix is then computed by taking the row sums of Rscore. These values are the expected number of runs to be scored starting from each of the states after one plate appearance. Figure 1 is an example of how these matrices are constructed.

The Results
I was curious to look at each Team’s data to see what baseball situations produced the highest Expected Runs in an Inning (ERI). The graphs below reflect all of the baseball situations (or States) along with the ERI that allow the coaches to understand the expected runs that could occur next. When used to make decisions, it is important to look at the baseball situations that are most statistically valid. In the raw data I focused on states that occurred more than 20 times during the season with an ERI of greater than .200. Here is that view by Team:
The Blue Caps:

The Bobcats:

The Ground Sloths

The Merchants:

Here is an example of how the teams can use this data using the Ground Sloths information above. Making a decision to steal a base when there is a batter on first with one out (1,1) moving them to second (2,1) is a risk and only increases the ERI from .1935 to .2581. However, a sacrifice fly with a batter on second with no outs (2,0) has a significant impact on the ERI by putting the Team in a (3,1) situation by taking the out and advancing the batter to third. In this situation the ERI would increase from .3000 to .4839.
Thank you for your interest in this work and that of the other Baseball Analytics Interns supporting the Normal Cornbelters and the KCL.