I need help with this assignment.

profilezeezoo-17
winning_the_world_series.pdf

Winning the World Series

For this assignment, you are going to need to use the data provided to predict the outcome of the 2016

World Series. Actually, that’s not quite right, you are going to do something better than that. You are going

to calculate the odds for each of the 10 teams that have made it to the post-season progressing any further.

The instructions on how to do this are below.

The Data You can download the Excel spreadsheet for this assignment on Blackboard. This is a macro-enabled

workbook, which means it is going to ask you if you want to enable it when you open it. You will want to

select ‘yes’ so that you can run the simulations necessary. In the data tab you will see the data I have

provided you. It includes all 10 teams who have made it into the MLB post-season, their average runs scored

per game, the average runs they allowed per game, and the variances of both of those.

Background Playoffs can be notoriously difficult to predict, and many billions are won and lost by gamblers trying to

forecast the outcomes. What makes the odds so hard to calculate is that a team’s chances depend on the

competition they face along the way. So the odds that the Cubs make it to the World Series depends on

who they face for the National League Championship, and who they face depends on a previous set of

games with uncertain match-ups. A sequence of probabilistic outcomes like this, in which the odds of

sequential events depends on the odds of previous events, is known as a Markov Chain.

Back in the late 1940s, a mathematician named Stanislaw Ulam was working for the U.S. government trying

to develop radiation shielding to protect against the effects of the nuclear bomb. Ulam was tasked with

figuring out how far neutrons would go through various materials. If you remember your high school

physics, you probably remember that there is actually a bunch of space between atoms, and neutrons are

super tiny. So theoretically is it possible for a neutron to get through just about any material without hitting

something and being stopped. So the problem was a probabilistic one. How likely is a neutron to make it

through the first layer of atoms in concrete? How about the second layer? The third? And so on. It turns

out, for whatever reason, that this problem was a lot more complex than it sounds, and the probability

distributions were almost impossible to calculate even for the world’s greatest mathematicians. Ulam had

the idea to use random experiments to figure it out. Just hit the materials with a bunch of neutrons and

measure how much got through. But this would be expensive, and difficult. His friend and colleague, Jon

von Neumann, had the brilliant idea to run these experiments in a computer. He simulated, via computer

code, these experiments, and was able to run them thousands of times in just a couple days, giving them

the data that they needed to make the calculations. When they needed a name for this method, another

colleague suggested Monte Carlo, referencing a casino where Ulam’s uncle would gamble with his relative’s

money.

It’s not important that you know any of that, but I thought it was interesting enough to share. You’ll be

using the Monte Carlo method to estimate each team’s odds of making it to sequential rounds of the MLB

post-season tournament.

Methods Monte Carlo analysis requires us to make a few assumptions about the way stochastic outcomes are going

to be determined. Stochastic is a fancy word for random, and here it means we have to choose a

distribution for possible scores from which we can have the computer draw random outcomes over and

over again across thousands of simulations. For our purposes, I think the best distribution to use is the

Gamma Distribution. Aside from have an awesome name, the Gamma distribution has several favorable

properties for our purposes. First, like baseball scores themselves, it cannot go below zero. Second, the

Gamma distribution is shaped by two parameters (α and β) which we can construct using our average runs

and the variance of runs to fit the observed performance of the team over their regular season. Third, Excel

has a built in function which will allow us to use the Gamma distribution in our simulations.

The two parameters which define the Gamma distribution also define the distributions mean (�̅�) and

variance (𝑠2). Use the equations below for those parameters, I can solve for α and β respectively.

�̅� = 𝛼𝛽 → 𝛼 = �̅�2

𝑠2

𝑠2 = 𝛼𝛽2 → 𝛽 = 𝑠2

�̅�

Thus, if I set α equal to �̅�2

𝑠2 and β equal to

𝑠2

�̅� then a set of randomly drawn outcomes from the Gamma

distribution should have a mean of �̅� and a variance of 𝑠2. That is, we can calculate α and β in Excel, and it

will then generate for us a random score for each team in a simulated game of baseball. The question now

is what to use for the mean and variance.

If I wanted to simulate how many runs the Cubs would score in a particular game, I could just use their

average runs scored in the regular season along with its variance. Plug that into the Gamma distribution

and I would generate outcomes which look a lot like their regular season performance. The problem of

course is that I am not taking into account the quality of their opponent. The Giants, for example, were

easy to score against in the regular season than the Mets. So arguably, the Mets would be harder for the

Cubs to beat than the Giants. To account for this, we will use a simple average.

�̅� = (𝑟𝑢𝑛𝑠𝑖 + 𝑎𝑙𝑙𝑜𝑤𝑒𝑑𝑗 )/2

𝑠2 = (𝑟𝑢𝑛𝑠 𝑉𝐴𝑅𝑖 + 𝑎𝑙𝑙𝑜𝑤𝑒𝑑 𝑉𝐴𝑅𝑗 )/2

Our assumption here is that equal weight should be given to both a team’s offense and a team’s defense.

This may or may not be right, but as you will learn in student presentations, it’s probably a fair assumption.

This means we will have to calculate a unique α and β for each team in each series, as their values will

depend on both a team’s own runs and variance, but also their opponent’s runs allowed and variance.

The key to a good Monte Carlo analysis is running lots of simulations in order to get a filled-out sense of

the probability distributions. For our purposes, about 2,500 simulations should be sufficient, and I have

already built into your Excel spreadsheet a function to run those simulations once you fill out the Games

tab.

The Games Tab You will need to enter in formulas to calculate α and β for each of the nine match-ups in the MLB playoffs.

To do this, you will need to use the formulas given above for �̅�, 𝑠2, 𝛼, and 𝛽. The only inputs you will need

then are the ones from the table in the Data tab for runs, allowed, runs VAR, and allowed VAR. To get those,

you will need to use the VLOOKUP function in Excel.

The VLOOKUP function can take a value, find it in a specified table, and then return a corresponding value

in a specified row. The arguments are entered into the function as follows: =VLOOKUP(Value you want to

look up, range where you want to lookup the value, the column number in the range containing the return

value, Exact Match or Approximate Match – indicated as 0/FALSE or 1/TRUE).

For our purposes, the value we want to look up is the team listed in the same row in column C (we will be

entering these formulas into columns D and C). The range we want to look them up is in the data tab at the

coordinates A2:E11. For your convenience, I have also named this range “Data”, and so you can simply use

the word “Data” to the second argument. The column we are looking for depends on the value we are

trying to pull up. ‘Runs’ is in column 2, ‘Allowed’ is in column 3, ‘Runs VAR’ is in column 4, and ‘Allowed

VAR’ is in column 5. For the last argument, you will always want to use ‘FALSE’. This will require an exact

match on team, rather than letting Excel settle on a close match without looking any further.

Using VLOOKUP to grab your values, you should be able to construct the appropriate equations to get the

distributions right. Figuring this out is the assignment.

Running the Simulations and Submitting Your Work Once you have calculated the alpha and beta for each team in each matchup (that is 36 total

calculations), then you will be ready to run the simulation. To do so, simply go to the Simulation tab and

click the ‘Run Simulation’ button. Excel will automatically start running 2500 total simulations. While it is

doing so, don’t try and edit anything in the Excel file and just wait for it to finish running. This may take a

few minutes on some computers.

When the simulation is finished, head over to the Summary tab to see the results. The columns labeled

‘League’ gives the odds of a team making it into their League Championship game. Four teams will make

it, so these odds should add to 400%. The column labeled ‘World Series’ gives the teams odds of making it

into the World Series. And lastly the column ‘Win’ gives the odds that the team will actually win the

World Series.

Once you have these figures and are confident you followed the methods described here, head over to

blackboard to complete the Winning the World Series Quiz. Once you complete this quiz, you will have

completed the assignment. Please note that each student should get slightly different results. Blackboard

knows that your results should differ from other students’, so please do your own work on this

assignment.

This assignment is due by 11:59PM on 10/19/16.