DEV Community

NegativeEV
NegativeEV

Posted on Originally published at negativeev.com

How the pitch-by-pitch MLB simulator works

How I built a pitch-by-pitch MLB simulator to check bets against

By Jesse, NegativeEV. A lightly edited transcript of a talk I recorded on 10 August 2026.

Written by Jesse, NegativeEV. Last updated 27 August 2026.

Why a simulator at all

I want to talk about the simulator. It is really the key, the backbone of our whole tool. Our bet checker tool is nothing without the underlying simulations that we check against. When I built this, it was the first thing we built. Everything else just went on top of that. So getting it right was very, very important.

Most betting tools, analytics, engines, bet suggestions, models. People say my model says Ohtani is a play for a home run today. What does that mean? I always wonder that. I say, what are they looking at that's highlighting him as a play? Because yeah, you could look at a list with various analytics and sort it, and have a score, and say, well, Ohtani is at the highest score today. He's the play. But that doesn't take into account price. How do you know it's still a positive EV play?

So really, when I wanted to make a tool to help bettors not get ripped off, I couldn't do that without a simulator. And a simulator is hard. It's far and away the hardest way to do this. I don't recommend it to people who are trying to do this quickly. This took a very long time.

First, the model

So what do I mean by simulator? Let me just say exactly, simply, what it's doing.

I take every game on the slate. And first, I take all of the data through yesterday. Every game is producing play-by-play data. And I train a model, a modern machine learning model, on that data.

And what is that model predicting? There's actually three models. There used to be a lot more. But I shrunk it down, actually, because it was better. That's a longer story. At the end of the day, the one model approach for predicting a pitch outcome was by far the most accurate for what we were going for.

So I take all the data and I build a model. That's this prediction engine. That's those weights you always hear about.

Then the game

Okay, I have a model. So then I look at this day's slate, or tomorrow's slate if all the games have ended. Because I don't rebuild my model until all the games have ended. And I take the next day's slate or today's slate. And for each game on the slate, I simulate it, literally, pitch by pitch.

I say, okay, here is our starting state. This is what I know. This is the weather. This is where they're playing. This is the starting lineup for each team. This is the starting pitcher. For a while, I had umpire, even. Here's the umpires. But with ABS now, umpires have actually gotten a lot more consistent. So that's not necessary.

And I start with those inputs. And then I say, given these inputs, what will the result of this pitch be? The count zero, zero, top one. This pitcher. And it tells me. It uses the weights, the model that I trained. And it says strike, swinging strike, even. I actually have it very granular. Or ball, foul, single, home run, double. Obviously, this gets interesting if there's a runner on base, because that becomes an input into the model. Double play. Ground ball to second base, does the runner on second advance to third. I have to kind of figure that out, too. But the whole point is, I literally predict and simulate every single pitch.

And the result of a pitch becomes the starting state of the next run of the model. The next prediction. It says, okay, zero, zero, top one. Given all these inputs. It's 72 degrees at Yankee Stadium. The Yankees are playing the Braves. Cam Schlittler is on the mound. Ball. Okay, now it's one and oh. What's the next pitch? What's the result of the next pitch? Swinging strike. And it does that for the entire game.

And at the end of it, you have a box score. You have a lot of different stats that you otherwise would just not know. You can answer, no runs first inning. That's how I can answer that when people plug that bet in. Yes runs first inning. How many pitches did the pitcher throw?

The other two models: pulls and substitutions

Because I have another model that actually figures out whether to pull the pitcher. Literally after every batter, it runs. Should we pull this pitcher? And it's all based on historical data.

Same with substitutions. Player substitutions. Because that's a thing. So we have to take that into account. And that's, again, where simulations matter. Because, yeah, tonight he might get pulled. He might not. But how often does it happen? That's the whole point of simulations.

One simulation is worth nothing

That maps to betting. We simulate a game and we get a result. Yankees beat the Braves three to two. And you have a box score attached to that. Maybe in that game, Matt Olson, for whatever reason, pulled in the seventh. Okay, well, he had one less at bat, that affects his outcome.

But that's just one simulation. I wouldn't want to bet on that. That's just a random one simulation. So what do I do? I simulate until the numbers kind of settle. There's always kind of a trend that you can see when you simulate things a bunch. It's called a Monte Carlo simulation. And that's what we do. And that shows you how often a thing happens.

What that gets you at a price

And that then becomes trivial to compare when someone checks their bet. They say, Matt Olson over 0.5 home runs, plus 300. Okay. So you're expecting him to hit a home run, hope I'm doing this math right, 25% of times. That's what plus 300 is. Well, in our sims, he only hits a home run in 20%. I know that's a negative EV play, because in our simulations, which are based on actual data, he doesn't hit a home run that often. So why are you taking those odds? That's just a bad play.

And obviously someone can take issue with our simulations and say, well, they're bad simulations. Okay, fine. But they're based on all of the data that is available, and they're based on modern machine learning. I'm not using some form of old machine learning. There's various things you can do to get better results, but you're really grinding out little tiny points at that point.

So you say, here I am using modern machine learning, doing four to 5,000 simulations of a game using all of the available data. And it shows that Matt Olson hits a home run 20% of the time. And you're going to place a bet that only pays out as if he hits a home run 25% of the time. That's a bad bet.

So if you want to take issue with our simulations, I just have to ask, what data are you basing that on? Because I'm using all the available data. Do you have additional data that we don't? Do you have insights that aren't captured by data? Are you simulating this game in your head 4,000 times? How are you coming to these conclusions?

Why I even built this

Because people's natural instinct for what is a good play is so bad. And it's skewed, because you only remember the times when you've made that good play. And you go, oh, I knew it. It was a gut pick. I knew it. And often you'll see a guy hit a home run that you didn't pick and go, oh, I knew that one too. I just didn't trust my gut. And so everyone keeps losing.

So that's, again, the whole point of these simulations. It gives you this second opinion. Like, yeah, I think this is a good play because I watch baseball. And obviously, look at all these people tailing it. It must be a good play. And if it doesn't happen, it's rigged. Well, why not just plug it in to NegativeEV and see? See if the numbers and the simulations back it up.

Like, yeah, it can be wrong, quote unquote. But any bet on any day can be wrong. That's the whole point. It says that Matt Olson hits a home run 20% of the time that this game is simulated. So if he happens to hit a home run that day, okay, I don't think it was wrong. It just happened to hit that series of events where he hits a home run.

How in the heck did I test this?

That brings up the interesting point of, how do I know I'm even getting things right? Because you simulate something thousands of times, you're still not going to get the actual thing that happened. Every player, every at-bat, every pitch. You're not going to ever capture that. It's a one in a trillion chance you get all of that right in a simulation.

So my sort of north star when building this was, can I have a confidence interval that lines up with reality? If something happens in my simulations 90% of the time, everything in my simulations that I predict to happen 90% of the time, when you take those as an aggregate in real life, does it happen 90% of the time? But anyway, we will leave that for another time to dig into.

The compute

The whole point of this was explaining how the simulator works. And really, it is that simple. It's a lot of compute.

When I went into this, I decided I wasn't going to let compute be a constraint. I wanted to make the best simulator. And that ended up with something that's kind of bulky to run. I did find a way. I have to spin up some VMs in the cloud that are pretty beefy in order to run these simulations. I can run them local, but my fan on my computer gets very loud.

But that's the idea. I simulate every single game on the slate, 4,000 to 5,000 times. And that's what we access when you plug in a bet.

What it's for

I can't think of a better way to do this. I think it is the best way. It's certainly not perfect. But I trust it to give me kind of a general idea of who's a bad play. And, yeah, sometimes you're going to plug in somebody, it's going to say this was a bad play, and the play is going to end up winning. It is a second opinion based on actual data.

And, again, you have these gut picks, or you read about picks, you see picks on X. You're in a Discord channel with somebody who's giving picks. Are you just going to blindly trust that that person is doing their research? And what does that research even mean? Are they just looking at a spreadsheet? Sorting? Are they comparing against price? How do we know this is even a good play at a certain price?

A price implies something happens a certain amount of time. How do you know if that's good or not if you don't have actual simulations where something happens a certain amount of times?

I think that is enough of an explanation on the simulator. I will have to dig into other parts of it like I alluded to in other conversations.

NegativeEV checks bets against play-by-play simulations of the full game. It is free to try, 10 free checks a day and unlimited signed in, at negativeev.com.

Check a bet now

Open the checker: https://negativeev.com/

Related reads: how the simulator got built, how a bet check works, and how accurate betting simulators are.

Top comments (0)