Monte Carlo Simulation

Photo credit to World Casino Directory. Click the photo for the link.

Photo credit to World Casino Directory. Click the photo for the link.

Above is the Monte Carlo Casino from which the Monte Carlo Method derives its name. The Monte Carlo Method was invented by Stanislaw Ulam, and he and John von Neumann used it to help in the development of the Manhattan Project. I used it for Fantasy Football.

 

The Problem…

Fantasy Football.png

I needed to know what my chances of making the fantasy football playoffs were. In a regular season of fantasy football, there are 13 weeks of games followed by four weeks of playoffs. Our league had 12 players which means there are six matches each week. Three outcomes for each match (win, loss, tie) with 6 matches each week and 13 weeks of games means there are approximately 1.34x10^37 different possible seasons. For reference, there are an estimated 1x10^11 stars in the Milky Way and very roughly 7.5x10^18 grains of sand on earth. The number of different possible seasons is nineteen magnitudes larger than the number of grains of sand on earth… whoa. Without a way to calculate who would win future matches, this problem cannot be deterministically solved with combinatorics calculations. Not that I would want to try what with numbers being that large. Some sort of simulation would be required.

The Solution…

No one can predict trades, sports injuries, team dynamics, coaching decisions, etc, so I ignored all of this. I assumed everyone’s fantasy football score followed a normal distribution, so I calculated each team’s average score and standard deviation. This required 3 weeks of data. Next, I created fake scores for the rest of each team’s season by randomly selecting a score from their normal distribution, meaning scores closer to their average were more likely than scores way above or way below. I then created 15,000 seasons worth of fake scores, played out each season, and kept track of the results. By dividing how many times each team finished in each place by the number of seasons that were played out, I found the probability of everyone’s finishing place at the end of the regular season. After every week, I would input what each fantasy football team scored into my Excel file and run the simulation again.

To see my Excel workbook, please click the link below. It contains a macro with which I ran my Monte Carlo simulation. If you would like to see just the macro, click the second link for a PDF of the code. Edit: now in Python! Follow the last link to Github to see that file.

FF Monte Carlo Simulation

Monte Carlo Code

Github Link to Python

This is Joe Burrow shortly after winning the 2019 College Football National Championship. I imagine it feels similar to when your code finally works. Photo credit to Jeffrey Marx via the Cincinnati Enquirer. Click the photo for link.

This is Joe Burrow shortly after winning the 2019 College Football National Championship. I imagine it feels similar to when your code finally works.

Photo credit to Jeffrey Marx via the Cincinnati Enquirer. Click the photo for link.

Skills Used During This Project

Engineering

  • Monte Carlo Simulation

  • Excel / Excel VBA

  • Python

Manufacturing

  • Minor bike repair to get to the library