Category Archives: Simulations

December 14, 2022

Poetry in Motion

Like so many people, I’m trying ChatGPT. I challenged it like this:

Write a poem in the style of Sylvia Plath describing the value of MLB free agents.

Here is the poem it produced:

The value of free agents, oh how they shine
Like diamonds on the diamond, they are divine
Their worth cannot be measured in mere dollars and cents
For they bring excitement and joy to the game's events

With each swing of the bat and throw of the ball
They thrill us and captivate us, one and all
Their talents on the field are truly a sight to behold
As they chase their dreams and make their stories unfold

But their value goes beyond the wins and the losses
For they are the lifeblood of the game, its very pulse
Their contracts may be rich, but they earn every penny
With the blood, sweat, and tears they pour into their game, so many

So let us celebrate the free agents of MLB
For they are the ones who make the game worth watching, you see
Their value is immeasurable, their worth is incalculable
For they are the heart and soul of America's favorite pastime, baseball.

I guess the AI does not see them as overpaid. Even if you ask it to take that stance, ball players come out pretty well:

If Paul McCartney wrote a song about MLB free agents being overpaid, how would it go?

Verse 1:
Money can't buy me love, or so they say
But in MLB, it seems to be the only way
To land the top free agents and make a splash
Teams will pay whatever it takes, with cash

Chorus:
Free agents, oh free agents, how much is too much to pay?
When it comes to baseball, the price just seems to sway
From one outrageous contract to the next
Do they really deserve it, or is it just baseless excess?

Verse 2:
With each new deal, fans and critics alike
Cry out that the players are overpaid, it's not right
But the owners and GMs just keep on shelling out
For the best of the best, there's no doubt

Chorus:
Free agents, oh free agents, how much is too much to pay?
When it comes to baseball, the price just seems to sway
From one outrageous contract to the next
Do they really deserve it, or is it just baseless excess?

Bridge:
But in the end, it's all about the love of the game
And the players who bring it to life, who make it their aim
To entertain and thrill us, to make us cheer and clap
For the free agents of MLB, the overpaid and the underpaid, the best and the worst, it's all part of the game's allure and its magic.

Chorus:
Free agents, oh free agents, how much is too much to pay?
When it comes to baseball, the price just seems to sway
From one outrageous contract to the next
Do they really deserve it, or is it just baseless excess?

Pretty cool.

July 23, 2020

Only the Game is Real?

Fox plans to enhance their national broadcasts with virtual crowds:

“We’re not looking to fool everyone. We know it is a virtual crowd. But we also know how jarring watching a game in an empty stadium is on TV.”

ESPN.com

I’m glad they are only trying to fool some of the people some of the time.

Why not just simulate the players, too? There would be no worries about infections, no need to opt out, they could get secretly paid by the clubs, and no one would no the difference, because they would too distracted by the fake fans and the fake crowd noise.

Stop trying to coddle us. This season should be jarring. Pandemics tend to be forgotten by history. This is the first one being broadcast, so let the empty seats be a part of history so we don’t forget.

July 9, 2020 May 5, 2020

Combining Simulations

Both Strat-o-Matic and Baseball Reference are running simulations of the yet to start 2020 season. These can be fun to follow, but a single simulation can give a skewed view of the real strength of a team. If we combine the two, we’ll get a slightly better idea of the strength of teams. Note that what we’d really need is thousands of simulations. That’s how Baseball Prospectus comes up with their playoff probabilities.

This spreadsheet combines the two simulations through games of May 5th. Some team, like the Yankees, Indians, Braves, and Dodgers are excellent in both simulations. Some teams, like the White Sox, Mariners, Cubs, and Padres are great in one and terrible in the other. The Giants and Tigers are just bad no matter the simulation.

Going by the combined winning percentage, the Yankees would be the best team in the majors at .681, with the Dodgers second at .657. No surprise there. Cleveland is dominating what should be a very good Twins team, as the Indians lead the AL Central with a .605 WPct to Minnesota’s .542. Athletics lead the Astros .592 to .583 in the the tightest 1-2 race in the AL.

The Braves have played four more games that the Nationals so Washington has games in hand to make up the difference as Atlanta leads .605 to .588. The rest of the division is under .500. St. Louis easily controls the NL Central, in what I thought would be a very tight four team race.

Detroit is the only really terrible team, with a combined winning percentage of .347. That would be good for 56 wins over the entire season. Texas and San Francisco are the only other two teams playing below .400 ball.

April 9, 2020

The Randomness of a Short Season

538 Looks at how a shortened season and an expanded playoff format changes the probabilities of making the playoffs and winning the World Series. I found this part fascinating:

An interesting change from a normal season to a much different one was that the greatest gainers included a number of clubs that have young and promising cores (the Jays, Rays and Padres) and clubs that made significant offseason additions — like the White Sox, who signed Yasmani Grandal, and the Angels, who gave Mike Trout the best teammate he’s ever had in Anthony Rendon. We wondered in December if such signings would make baseball more competitive; an expanded playoff field would perhaps benefit those teams that tried to improve this winter and serve as a disincentive to tanking.

FiveThirtyEight.com

I would expect young core teams to do better in a short season format because other teams have less time to adjust to the weaknesses of those players. In addition, the younger players would not need to adjust to a longer season than they played in the minor leagues. I assume that is not built into the simulation, so these young core teams might do even better than indicated here.

March 30, 2020

The Batter Versus the Pitcher

With no baseball, there are a number of active simulations of the season. Strat-O-Matic is offering one such virtual season, and the Red Sox pounded the Blue Jays in the opening series.

At the heart of the simulation lies the batter-pitcher match-up. Strat-O-Matic combines batter and pitcher events in a straight forward way simply adding the two probability distributions together. So if a batter hits a home run every 0.064 PA, and a pitcher allows a home run every 0.032 PA, then when facing each other, the home run rate would be 0.048 per PA.

That is not the only way to model the match-up, however. The Log5 method combines the probability distribution for the batter with the probability distribution for the pitcher in the context of the league average to produce the new distribution. For example, the same batter and pitcher in a league with a 0.034 HR/PA rate would expect a home run rate of 0.060 according to Log5. A really good home run hitter facing a pitcher near league average should still be a really good home run hitter.

So a nice way to simulate the 2020 season might be to start with projections for players, and calculate the Log5 probabilities for events. This spreadsheet contains Musings Marcels rates for batters and pitchers for the 2020 season, and a third sheet that does the Log5 calculation, and displays the results both as a rate and per 600 PA. Feel free to make a copy of the spreadsheet and play with match-ups. Copy a batter line and a pitcher line to the Log5 sheet and see how one would hit against the other.

The current sheet shows Mike Trout against Gerrit Cole. These are two three-true outcome players, and the calculation indicates that 361 of the 600 PA would end in a home run, strikeout, walk, or hit by pitch. Trout doesn’t get many hits against the Cole, posting just a .238 BA. He does walk a ton, however, and over half his hits go for extra bases. That gives him a .353 OBP and a .506 slugging percentage. Trout would in fact be a very effective hitter against Cole, just not the greatest of all time.

This version of Log5 is not very dynamic, however. Strat-O-Matic offers different distributions for every batter and pitcher based on the handedness of the opponent. It builds in situational hitting and park effects. There are special probability charts for various strategies.

What would be great is a way of building all that into a probability distribution without writing special code to handle strategy or game situations. A calculator that knows to return a zero probability of a sacrifice fly with two out or no one on base. A probability distribution that is much more likely to sacrifice with a poor hitter at the plate, or in close and late situations. A function that accounts for parks, and handedness and men on base.

Some experiments will be on the way soon.

March 29, 2020

A Little More Luck

A shorter season could be a boon to some middle of the road teams. Fewer games gives luck more of a chance to shape a pennant race.

The 95% confidence interval provides the range of wins (or losses) expected for a series of binary events that covers the middle 95% of a probability distribution. If a team is considered a .500 team, that is they are expected to win and lose in equal amounts, we can calculate the range of wins that would fit into this interval.

For a .500 team playing a 162 game schedule, we would expect the team win between 69 and 93 games in 95% of their seasons. In terms of winning percentage, that is .426 to .574. In a 100 game season, the 95% confidence interval ranges from 40 wins to 60 wins, or .400 to .600. So it’s easier for a .500 team to post a division winning record in a short season. We’ve seen examples over the years of a team winning the first 100 games easily but winding up in second place.

You can also see this by playing with the Baseball Musings Season Simulator. Play with the number of teams and the number of games. Change it from assigning all teams a .500 winning percentage to assigning them random winning percentages. It’s a nice way of visualizing how evenly matched teams can finish with very different winning percentages, and how teams with lower intrinsic winning percentage sometimes finish on top of the division.

March 26, 2020 March 19, 2020

Strat Steps In

Strat-O-Matic Baseball will simulate the season until baseball returns:

GLEN HEAD, N.Y., March 19, 2020—Can the Mets’ Pete Alonso better his rookie record 53 homers in 2020? Will the Angels’ Mike Trout again prove he’s the best in the game? What will Mookie Betts do in a Dodgers’ uniform? While the baseball season, along with the rest of the sports world, is on hold, Strat-O-Matic (www.strat-o-matic.com), the market leader in sports simulations, will help fans keep rooting for their favorite players and teams until they get back onto big league fields by playing out the 2020 campaign daily. It all starts with the slate of 15 Opening Day games as originally scheduled on Thursday, March 26.

Using its innovative Baseball Daily product powered by its unmatched realism in calculating player ratings, Strat-O-Matic will allow fans, media and former players to help select the day’s pitchers and lineups, as well as follow the action via www.strat-o-matic.com and on its various active social media platforms, including Facebook, Twitter and Instagram.

Each afternoon at 2 p.m. ET / 11 a.m. PT, Strat-O-Matic will announce the results, standings, statistics and key game highlights from that day’s scheduled contests through the website, social channels and multimedia presentations.

“Like all baseball fans, we are disappointed that the season won’t be starting on time, but we hope this day-by-day simulation will provide a fun, viable substitute for the time being,” said Hal Richman, Strat-O-Matic founder. “And since fans have always enjoyed the control that playing Strat-O-Matic gives them, we are enlisting their help in picking the lineups and pitchers we use in the simulation. Although we don’t know how the year will unfold, there is no other game that fans trust more than Strat-O-Matic for the most accurate and realistic action, and we can’t wait to get the games started next week.”

Fans with questions about any facet of the daily simulation can contact Strat-O-Matic at 2020season@strat-o-matic.com.

www.strat-o-matic.com

It’s a fun game, and this will be a nice diversion while the majors leaguers are idle.

February 16, 2017

Better Pattern Recognizers

Via BBTF, Donnie Dewees talks about using NeuroScouting software to improve his pitch recognition:

The NeuroScouting software program is built to continue challenging participants as they use it.

“You graduate through levels as you use it, and it gets harder. It’s pretty fast-paced, and I have seen the difference it has made in helping me lay off of pitches.” Dewees said.

He cited improved patience at the plate as the most significant benefit from his time spent using the program, and his numbers bear this out to a degree. His walk percentage jumped from 4.6 percent with the Short-Season A Eugene Emeralds in 2015 to 7.1 percent during his time with the Class A South Bend Cubs in 2016. The trend continued after his move up to High A Myrtle Beach in late July, with a 6 percent walk rate over 167 plate appearances.

This sounded familiar to me, so I checked the archives and found this article:

With runs at a premium in the major leagues, a handful of teams are trying to help their young hitters with a high-tech program known as neuroscouting. The details are being treated as a state secret by three clubs believed to be using the product — the Cubs, Red Sox and Rays. But it involves helping players with pitch recognition in an era when 95 mph fastballs, big curveballs and wicked sliders are more prevalent than ever.

Dewees came up with the Cubs, and now plays for the Royals. Given the way the Red Sox and Cubs hit last season, this software may be the real deal.

December 29, 2016

Thinking About Luck

From time to time, I think about the batter-pitcher match-up (or batter-defense matchup) and how best to simulate the outcomes. Some games, like Strat-o-Matic, use fixed stats on batter and pitcher cards. It doesn’t matter how good the batter is if you roll on the pitcher card, and it doesn’t matter how bad the pitcher is if you roll on the batter card. A better way would be to generate Log5 probabilities for events based on the batter and pitcher/defense. So the probabilities of the outcomes adjust for each matchup, and random number determines the outcome.

The batter-pitcher match-up is more nuanced than that, however. I like to think of it as a collision of two probability distributions. For example, a batter reaching base has to do with the ability of the batter, represented by his OBP, and the ability of the pitcher/defense, represented by the pitcher’s OBP against. One might model those probabilities with spheres. They would be painted two colors, one color representing the batter reaching base (positive outcome for the batter, negative outcome for the pitcher), and one color representing the batter not reaching base (negative outcome for the batter, positive outcome for the pitcher). So the collision of the two probability distributions could be simulated by the collision of the two spheres.

There are four possible ways the spheres could collide:

  1. Batter reaches base for on both the batter and pitcher spheres.
  2. Batter is out on both the batter and pitcher spheres.
  3. Batter reaches on the batter sphere, does not reach on the pitcher sphere.
  4. Batter is out on the batter sphere, reaches on the pitcher sphere.

Now think of the four cases like this:

  1. The batter executes well, the pitcher/defense executes poorly, and the batter reaches base. Think of the pitcher throwing a hanging curve ball and the batter smashing it. In this case, the batter always reaches.
  2. The pitcher executes well, but the batter executes poorly. Think of the pitcher throwing a good four-seam fastball, and the batter popping it up. Or the pitcher throws a breaking ball that looks out of the strike zone, but comes back over the plate for a K. In this case, the batter never reaches.
  3. Both batter and pitcher execute well. The pitcher throws a good sinker, but the batter was ready for the pitch and golfs it.
  4. Both the batter and pitcher execute poorly. The pitcher throws a fast ball down the middle of the plate, but the batter doesn’t get the barrel of the bat on the ball.

In the last two cases, sometimes the batter reaches, and sometimes he doesn’t. These are the situations where the batter hits a line drive right at a fielder, or he pops a ball into no-man’s land for a single.

Take a batter with a .380 OBP, a pitcher with a .310 OBP against, and a league average OBP of .320. Log5 tells us the batter should get on base against this pitcher at a .366 clip. So where does the .366 come from? Look at the probabilities of the four cases above:

  1. Both reach: 0.080
  2. Neither reach: 0.490
  3. Batter and pitcher both execute: 0.300
  4. Neither batter nor pitcher executes: 0.130

So .286 of the .366 OBP comes from the two situations where some luck is involved. I suspect most of it comes from the third situation, where the batter executes well. Hitters like Ichiro Suzuki, however, who beat out weakly hit balls may get more from the fourth situation.

What should be clear is that there is a lot of opportunities for luck. In 600 PA, the results of 240 of them might go either way. That represents more than enough chances for good luck to lead to a career year, or bad luck to make one wonder what’s wrong with a player.

July 15, 2016

All Colon, All the Time

Someone made a major league in which all the players were Bartolo Colon. Here is the summary of the first game:

The teams combine for 8 hits in the first 11 innings, and from the 12th inning to the 17th inning, nobody on either side gets a single hit. There are 47 total strikeouts in the entire game -?? 25 for the Cardinals, and 22 for the Cubs. There is one walk in the entire game. Both starters go 8 scoreless before being pulled for pinch hitters (yeah, I don’t know).

This game is just zeroes after zeroes, and I am beginning to wonder at this point if the game would ever end. Had I created an infinite loop of Bartolo? Would it be possible for this season to even start, let alone end, if games were infinite? Finally though, in the 18th inning, the Cardinals break through on an error and score 2 runs. They win the game, 2-0. It took 18 innings.

Oh dear lord what have I gotten myself into.

What I really like, however, is the final standings. These 30 teams are identical, yet the best team went 90-73, and worst 70-92, a 20 game difference. That’s a good measure of the amount of luck in a season, and why teams that don’t look good on paper sometimes win.

Many years ago I wrote this season simulator to explore that very idea.

April 25, 2015

Secret Pattern Training

The New York Times publishes an article about a shadowy piece of software that might help batters with pitch recognition:

With runs at a premium in the major leagues, a handful of teams are trying to help their young hitters with a high-tech program known as neuroscouting. The details are being treated as a state secret by three clubs believed to be using the product — the Cubs, Red Sox and Rays. But it involves helping players with pitch recognition in an era when 95 mph fastballs, big curveballs and wicked sliders are more prevalent than ever.

“It’s on a laptop. What the producers made was they took I think the pitchers from major league baseball in 2014 and programmed every pitch they had thrown,” said Stephen Bruno, a Double-A infielder in the Cubs’ organization. “There’s a series of games — reaction time, recognizing pitches, laying off the curveball, hitting the fastball. And all those pitches that are thrown are replicas of pitches thrown in 2014 by major league pitchers.”

Almost no one will talk about it in detail, however. I think it’s a great idea. At the heart of hitting is pattern recognition, the ability to tell in a split second where a ball will travel. Minor league batters making the transition to the majors often need to make an adjustment to the constant high quality pitches they see in the majors. If this program exposes them to these pitches sooner and allows them to build pattern recognizers quickly, they might be more productive quicker.

Note that this is not the first attempt at this kind of training. At the 2012 MIT-Sloan Sports Analytics Conference, Peter Fadde did a presentation on this kind of training with college hitters. If nothing else, this is an extension of the constant video review Tony Gwynn loved so much.

March 21, 2014

Never Count a Team Out at the Start of the Season

I like this idea by Tom Tango:

BPro ran simulations where they had the Astros winning the World Series 0.4% of the time. What I’d like to see is someone run the Diamond Mind simulations, and stop at the first one where the Astros win the World Series. And then show us what the player stats were for the regular season. That is, show us what it takes for good breaks to beat out bad breaks sufficiently so the Astros win the World Series.

It might be useful to look at all such simulations in which the Astros win the division. It could be that the Astros good breaks were not that big, but the other teams in the AL West caught lots of bad ones. Do good breaks with the pitching staff help more or less than good breaks for the hitters? It’s a great area of study for someone with the time.

August 2, 2010 July 7, 2010 March 25, 2010

Game Review

I received a copy of MLB 2K10 for the Wii in the mail recently. I’ve tried to play it, and it takes some getting used to. I’m not a gamer; the Wii is for my daughter, I use it to work out with the Wii fit, so I’m not used to using all the controls. MLB 2K uses the full capabilities of this game console, including the nunchuck controller.

On offense, you can swing, and control if you want to try to hit a grounder, hit for power, check a swing, or bunt. When in pitching mode, you can select a pitch, throw and defend. Throwing the pitch is easy, although timing is everything. The game provides a target that shrinks, and you want to release when it shrinks to a green circle. Batting is tougher, as you need to time the pitch, just like in real life.

I had problems after the ball was put into play. On defense, you need to move the fielders with the nunchuck joy stick. That took some getting used to. You also need to direct the throws to the right base with the plus control pad. I kept hitting the lower leg of the controller to throw the ball in to the infield, which sent it all the way to home plate. It would be nice if there was a button for default throw, that threw to first on a grounder, or second on a double play, or second on a ball to the outfield.

I also had problems advancing runners. On what was an obvious double, the runner on first stopped at second. When I later figured out to hit the Z key to advance runners, they didn’t stop at the obvious base. You can make them runner faster and slide.

There are also options you can set make things more automatic, but I didn’t explore those.

All thirty teams are available, and you can create players as well. You can also let the game play itself to simulate seasons. Operation Sports did just that, and their top fantasy picks are here.

The graphics are very good. Most of the players look like their real-life counterparts, and the stadiums have the feel of the actual ballparks. The colors are rich and vibrant.

There was a huge learning curve for me to play this game well. Someone more used to this type of play will undoubtedly pick it up faster. My daughter enjoyed it. As a software developer, I think the game should be more obvious. If you are going to play, take the time to work through the tutorials and practice pitching, hitting and fielding. It will be a lot more fun to play that way than just jumping right in.

December 23, 2009

Predicting Batter-Pitcher Matchups

Jeremy Greenhouse at Baseball Analysts tries to figure out the system Tampa Bay used to decide Willy Aybar could hit Zach Greinke, even though they never faced each other.

A few years ago I helped a team out writing software for a idea that they had to compare batters to pitchers similar to the one they were going to face that day. It was a way to expand the sample size of batter vs. pitcher. This sounds similar, but with better technology.

October 14, 2009 October 22, 2007 October 16, 2006

Strat-o-Matic Openings

I play in the Postwar Baseball League. The league is getting ready to expand and is looking for new managers, as well as a replacement manager:

The Postwar Baseball League (PWBL) is looking for a general manager
to take over the Seattle Pilots starting in 1966.
Founded before the start of the 1946 season, the PWBL is a play-by-email league that has been in existence for six calendar years. Seven of its original twelve owners are still with the league, testifying to its stability. (One of the original owners describes the PWBL as a “terrific league–best non-FTF league I’ve ever been involved with by a long margin. . . .”) Now consisting of sixteen teams, the PWBL is populated by an exceptional group of GM’s, who have a wide and varied knowledge of baseball and its history (and who get along exceptionally well).
Because the PWBL has played twenty complete seasons, it has a rich history of its own, especially in the accumulated statistics. Last year (1965) Robin Roberts of the New York Mets became the second PWBL player to reach 300 wins when he defeated the San Diego Padres in a game in which teammate Willie Mays hit three homers, giving him 67 for the season and 498 for his career. (Warren Spahn, who pitched his last season for St. Louis Cardinals in ’65, was the league’s first 300-game winner. He retired with 328 victories.) Eddie Mathews is the career leader in homeruns with 546.
The league is remarkably competitive. So competitive, in fact, that no team has ever won back-to-back Mulcahy Cups–named after Hugh Mulcahy, the first major league baseball player to enlist in the armed forces after Pearl Harbor. Twelve different teams have captured the championship in the league’s history.
League games are played in round-robin fashion by those GM’s who volunteer. Other GM’s prefer to stick to the front office, drafting and trading and keeping track of their players. Because of its remarkable stability and quick pace–we finish at least three seasons per calendar year–the league “runs itself,” and GM’s can fluctuate between active involvement and a more detached interest as their schedules permit.
The Seattle Pilots enter the 1964 season with a strong nucleus, including its Gold Glove doubleplay combination of Bill Mazeroski and Luis Aparicio. Third baseman Tony Perez and slugging first sacker Boog Powell round out its infield. Tony Oliva is the team’s leading hitter, while Ken Holtzman and Fritz Peterson are Seattle’s top mound prospects. After winning their division in 1962, the Pilots have fallen under .500 and need a new winning attitude.
Looking ahead to the 1969 season, about one calendar year from now, the league hopes to expand by two or even four teams, if we can find responsible, committed GM’s willing to build teams from scratch. Our previous expansion, from 12 to 16 teams at the turn of the decade, was a successful one, with new teams quickly becoming competitive. By keeping the ratio of PWBL teams to real-life teams high (currently 80%), we have avoided “All-Star-itis,” maintaining player usage at realistic levels by permitting 110% usage for most players, with unlimited usage allowed for mediocre “replacement-level” players.
Ideally, we would like expansion team GM’s to join the league far enough in advance that they can become fully immersed in the PWBL even before they begin building their teams, participating in league decision-making, voting on current-season awards, perhaps even lending a hand with game play.
If you are interested in Sixties baseball and think you might like to join the PWBL, please drop a line to David Myers (dgmyers@tamu.edu), the league’s commissioner.

I really enjoy seeing the boxscores cross every day. I’m not one of the more active members, but the drafts are challenging, as you balance your needs for the season vs. your needs for the future. Check it out.

March 21, 2006 June 27, 2004 March 31, 2004

Strat-o Memories

Steve Treder offers up his memories of Strat-o-Matic baseball at the Hardball Times. I started playing the game in college, where I was a proud member of the Thirteenth Floor Strat-o-Matic League. Later, I joined the Sombilla, and participated in two seven-game World Series (I lost both, you can read the summaries here and here). I also played in a play-by-mail league for a couple of seasons. I love the game, and many of my best stories are a result of Strat-o.