Add files via upload

This commit is contained in:
Peter Norvig authored and GitHub committed 2018-04-28 22:59:58 -07:00
1 parent e41dead58a
commit 43a93a875d
1 file changed
+111 -78
+111 -78
View File
@@ -10,7 +10,7 @@
"\n", "\n",
"\"It's tough to make predictions, especially [about](https://en.wikiquote.org/wiki/Yogi_Berra) [the](https://en.wikiquote.org/wiki/Niels_Bohr) future.\" That's true for the **NBA basketball playoffs**, where there is a wide range of opinion about the Warriors and Cavs, the teams that met in the finals each of the last three years. The Las Vegas oddsmakers have the Warriors as co-favorites at 35% chance to win the title, while [538](https://fivethirtyeight.com/features/the-nba-playoffs-sleepers-favorites-and-best-first-round-matchups/), using their ELO rating, give the Warriors only a 4% chance. That 9-fold difference underscores that rational people can use different models with different assumptions and come to different conclusions. Here are some models you might choose:\n", "\"It's tough to make predictions, especially [about](https://en.wikiquote.org/wiki/Yogi_Berra) [the](https://en.wikiquote.org/wiki/Niels_Bohr) future.\" That's true for the **NBA basketball playoffs**, where there is a wide range of opinion about the Warriors and Cavs, the teams that met in the finals each of the last three years. The Las Vegas oddsmakers have the Warriors as co-favorites at 35% chance to win the title, while [538](https://fivethirtyeight.com/features/the-nba-playoffs-sleepers-favorites-and-best-first-round-matchups/), using their ELO rating, give the Warriors only a 4% chance. That 9-fold difference underscores that rational people can use different models with different assumptions and come to different conclusions. Here are some models you might choose:\n",
"\n", "\n",
"1. **Holistic**: I just feel that the Warriors have about a 1/3 chance of winning it all.\n", "1. **Holistic**: I just feel that the Warriors have about a 1 in 5 chance of winning it all.\n",
"2. **Game by Game**: I think the Warriors have an 75% chance of winning each game in the first round, then 65% for each game in the second round, but only 45% against the Rockets, then 55% if they make it to the finals. From that I'll calculate their overall chance.\n", "2. **Game by Game**: I think the Warriors have an 75% chance of winning each game in the first round, then 65% for each game in the second round, but only 45% against the Rockets, then 55% if they make it to the finals. From that I'll calculate their overall chance.\n",
"3. **Point by Point**: The Warriors have a per-game average point differential of +5.8; I'll compare that to the other teams and caclulate their overall chance.\n", "3. **Point by Point**: The Warriors have a per-game average point differential of +5.8; I'll compare that to the other teams and caclulate their overall chance.\n",
"4. **Play by Play**: Use [detailed statistics](https://www.basketball-reference.com/play-index/plus/shot_finder.cgi) to [model](https://danvatterott.com/blog/2016/06/16/creating-videos-of-nba-action-with-sportsvu-data/) the game shot-by-shot, or even pass-by-pass. That's too complex for me.\n", "4. **Play by Play**: Use [detailed statistics](https://www.basketball-reference.com/play-index/plus/shot_finder.cgi) to [model](https://danvatterott.com/blog/2016/06/16/creating-videos-of-nba-action-with-sportsvu-data/) the game shot-by-shot, or even pass-by-pass. That's too complex for me.\n",
@@ -38,6 +38,8 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"from statistics import mean\n", "from statistics import mean\n",
"from random import gauss\n", "from random import gauss\n",
"\n", "\n",
@@ -54,7 +56,7 @@
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"0.61163" "0.61325"
] ]
}, },
"execution_count": 2, "execution_count": 2,
@@ -70,43 +72,14 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"The model says the Raptors have a 61% chance of beating the Sixers in a game. We can make a table of point differentials and game win percentages:" "The model says the Raptors have a 61% chance of beating the Sixers in a single game. "
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 point differential = 50% win game\n",
"1 point differential = 54% win game\n",
"2 point differential = 58% win game\n",
"3 point differential = 61% win game\n",
"4 point differential = 65% win game\n",
"5 point differential = 68% win game\n",
"6 point differential = 72% win game\n",
"7 point differential = 75% win game\n",
"8 point differential = 78% win game\n",
"9 point differential = 80% win game\n"
]
}
],
"source": [
"pct = '{:4.0%}'.format \n",
"\n",
"for diff in range(10):\n",
" print(diff, 'point differential =', pct(simulate(diff)), 'win game')"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"This agrees very well with the \"Differential vs. Win Percentage\" [chart](http://a.espncdn.com/combiner/i?img=%2Fphoto%2F2018%2F0408%2F180408_differential.png&w=1140&cquality=40) on [this page](http://www.espn.com/nba/story/_/id/23071005/kevin-pelton-weekly-mailbag-including-nba-all-offensive-teams).\n", "\n",
"\n", "\n",
"# Game by Game Model\n", "# Game by Game Model\n",
"\n", "\n",
@@ -117,7 +90,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 3,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@@ -134,12 +107,12 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"We can extend the table:" "We can make a table:"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 5, "execution_count": 4,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -148,7 +121,7 @@
"text": [ "text": [
"0 point differential = 50% win game = 50% win series\n", "0 point differential = 50% win game = 50% win series\n",
"1 point differential = 54% win game = 58% win series\n", "1 point differential = 54% win game = 58% win series\n",
"2 point differential = 57% win game = 66% win series\n", "2 point differential = 58% win game = 67% win series\n",
"3 point differential = 61% win game = 73% win series\n", "3 point differential = 61% win game = 73% win series\n",
"4 point differential = 65% win game = 80% win series\n", "4 point differential = 65% win game = 80% win series\n",
"5 point differential = 68% win game = 85% win series\n", "5 point differential = 68% win game = 85% win series\n",
@@ -161,23 +134,23 @@
], ],
"source": [ "source": [
"for diff in range(10):\n", "for diff in range(10):\n",
" game = simulate(diff)\n", " g = simulate(diff)\n",
" series = win_series(game)\n", " print('{} point differential = {:4.0%} win game = {:4.0%} win series'.format(\n",
" print(diff, 'point differential =', pct(game), 'win game =', pct(series), 'win series')" " diff, g, win_series(g)))"
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"For example, a team with a 3 point net differential has a 61% chance of winning each game in a series, and a 73% chance of winning the series. \n", "With a zero point differential obnviously you're at 50% win percententage; with a 3 point differential you're at 61% to win a game, and 73% to win the series. This agrees very well with the \"Differential vs. Win Percentage\" [chart](http://a.espncdn.com/combiner/i?img=%2Fphoto%2F2018%2F0408%2F180408_differential.png&w=1140&cquality=40) on [this page](http://www.espn.com/nba/story/_/id/23071005/kevin-pelton-weekly-mailbag-including-nba-all-offensive-teams). \n",
"\n", "\n",
"What happens if some games in a series have already been played? The following function prints a table where each row tells a team's current win-loss record, each column is the game win percentage, and each entry in the table is the series win percentage." "What happens if some games in a series have already been played? The following function prints a table where each row tells a team's current win-loss record, each column is the game win percentage, and each entry in the table is the series win percentage."
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": 5,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -210,6 +183,8 @@
} }
], ],
"source": [ "source": [
"pct = '{:4.0%}'.format \n",
"\n",
"def series_table(pcts=[p/100 for p in range(15, 90, 5)]):\n", "def series_table(pcts=[p/100 for p in range(15, 90, 5)]):\n",
" print('W-L | Game Win Percentage')\n", " print('W-L | Game Win Percentage')\n",
" print(' | ' + ' '.join(map(pct, pcts)))\n", " print(' | ' + ' '.join(map(pct, pcts)))\n",
@@ -226,7 +201,67 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"For example, if our team with a 60% win percentage loses the first game of the series, then check the \"0-1\" row and the \"60%\" column to see that it still has a 54% chance of winning the series. " "For example, if our team with a 60% game win percentage loses the first game of the series, check the \"0-1\" row and the \"60%\" column to see that it still has a 54% chance of winning the series. \n",
"\n",
"We can also do plots:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"diff = [d/10 for d in range(100)]\n",
"game = [simulate(d) for d in diff]\n",
"series = [win_series(p) for p in game]"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},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jM2bN2fz5s0cP34cgMWLF9O1a1fOnj2buG7JkiU0atSIbNmysWfPHkJCQoiPt7emvO222xg0aBBNmzbluuuuo23btomvyww6ntlN28LNV21x4QJERsKQIXDvvbYOXrEiDBpkSy23325Hr+zeDZMmwWuvwSOPQLNmgZPYQZN7iipVqkS2bNkIDw9n9uzZxMbGXvH8tGnT+OCDD/jll184cuQIzZo1o1u3bv/aZuXKlWzatAm4cqz4gAED2L59O+vXr2f79u3s27ePt956C4ChQ4dSpkwZjh07xuHDh3nvvfeSjbF06dJX9NSjoqJo3rw5jRs3/te6BElr7VOnTuWrr77iyJEjXLhwgY8//jg9zaWU3zHGJu2RI6FDB5ugBwyAgwfh/vshKgpOnLAnQT/7DJ58MnUnOf1eJk9baZJztfVXbpPxR3r99ddf5vHHHzdlypQxOXLkMHfffbc5fPiwMcaYdu3amfHjxyduGxcXZ/LmzWv27t1rjDFGRExkZOQV+xMRs2PHDmOMMfny5TM7d+5MfG7ZsmWmfPnyxhhjBg0aZDp37my2b9+eYozh4eHm+eefN/Hx8eaGG24w58+fN6NGjUpcV6hQIRMVFWWMMWb37t0mJCTExMXFGWOMadmypXn33XcT9/X555+bdu3aJXuc1LxXSjnlzBlj/vrLine truncated
"text/plain": [
"<matplotlib.figure.Figure at 0x10c059ac8>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(diff, series, label='Series Win')\n",
"plt.plot(diff, game, label='Game Win')\n",
"plt.legend(loc='best');\n",
"plt.grid()\n",
"plt.title('Point Differential vs. Win Percentage');"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAEKCAYAAAD3tSVSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAIABJREFUeJzt3WmYFPXV9/HvQcVdUDQqKhL3XbyjxF3URMAlLjEqKohL5ImRaFyJK8HbLcYIatxRbtxwwSiJEVwHBAER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rWDffcNa/HrrJN2ZOVN7RoRSdXUqfC3v8ETT8DRR0OfPrDrrmlHVVpa0q7RmryIpGL0aLjqqrAf+5lnwowZWmsvBPXkU6Lea0y5iFV6LtzDnjH77QenngrHHAMffAAXXfTjAl/puSgWrcmLSFG8/DJceCHMng2XXALHHw8rqgIVnHryIlJQ06eHNfWXXoI//xl691ZxbyrtQikiJeerr8Ka+x57hNMLTJ8Op52mAl9sKvIpUb8xplzEKiEX7nD//eGI1E8+gTffDGvyTT3xVyXkohToO1VEEjNjRtgFcv58ePhh2HPPtCMS9eRFpMWWLoUbboBrr4U//QnOOkttmSRpP3kRSc20aeFUA2utFfag2WyztCOSTOrJp0T9xphyESunXNTWwo03wt57w8knwzPPJFvgyykXpUxr8iLSZHPmhLX3RYtg/HjYcsu0I5Jc1JMXkSYZNSrs696nTzioSb3Line truncated
"text/plain": [
"<matplotlib.figure.Figure at 0x10e433828>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"P = [p/100 for p in range(100)]\n",
"plt.plot(P, [win_series(p) for p in P])\n",
"plt.grid()\n",
"plt.title('Game Win Percentage vs. Series Win Percentage');"
] ]
}, },
{ {
@@ -240,7 +275,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 7, "execution_count": 9,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@@ -263,7 +298,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": 10,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -287,7 +322,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 9, "execution_count": 11,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -320,17 +355,17 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 12,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Rockets vs Wolves 89%; through here: 89%\n", "Rockets vs Wolves 88%; through here: 88%\n",
"Rockets vs Jazz 78%; through here: 69%\n", "Rockets vs Jazz 78%; through here: 69%\n",
"Rockets vs Warriors 69%; through here: 48%\n", "Rockets vs Warriors 69%; through here: 48%\n",
"Rockets vs Raptors 58%; through here: 28%\n" "Rockets vs Raptors 57%; through here: 27%\n"
] ]
} }
], ],
@@ -344,17 +379,17 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 11, "execution_count": 13,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Warriors vs Spurs 72%; through here: 72%\n", "Warriors vs Spurs 73%; through here: 73%\n",
"Warriors vs Blazers 74%; through here: 54%\n", "Warriors vs Blazers 75%; through here: 55%\n",
"Warriors vs Rockets 31%; through here: 16%\n", "Warriors vs Rockets 31%; through here: 17%\n",
"Warriors vs Raptors 38%; through here: 6%\n" "Warriors vs Raptors 37%; through here: 6%\n"
] ]
} }
], ],
@@ -379,7 +414,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": 14,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@@ -393,7 +428,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 13, "execution_count": 15,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -468,7 +503,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 14, "execution_count": 16,
"metadata": { "metadata": {
"scrolled": true "scrolled": true
}, },
@@ -494,7 +529,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 15, "execution_count": 17,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -518,7 +553,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 16, "execution_count": 18,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -562,7 +597,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 17, "execution_count": 19,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -593,7 +628,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 18, "execution_count": 20,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -617,7 +652,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 19, "execution_count": 21,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -660,7 +695,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 20, "execution_count": 22,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -684,7 +719,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 21, "execution_count": 23,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -708,7 +743,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 22, "execution_count": 24,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -732,7 +767,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 23, "execution_count": 25,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -776,7 +811,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 24, "execution_count": 26,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -811,7 +846,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 25, "execution_count": 27,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -835,7 +870,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 26, "execution_count": 28,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -859,7 +894,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 27, "execution_count": 29,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -883,9 +918,7 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {},
"collapsed": true
},
"source": [ "source": [
"# The 2016 Finals\n", "# The 2016 Finals\n",
"\n", "\n",
@@ -896,7 +929,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 28, "execution_count": 30,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@@ -943,16 +976,16 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 29, "execution_count": 31,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"0.966301733" "0.968211263722248"
] ]
}, },
"execution_count": 29, "execution_count": 31,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@@ -982,5 +1015,5 @@
} }
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 1 "nbformat_minor": 2
} }