Thursday, November 13, 2014

NFL Watch Factor

I have been working on an NFL weekly pickem site for a while, thinking I would have friends login and submit weekly NFL picks. Knowing my track record with friend website participation, I decided to try something different. I stumbled on a Grantland article written by Bill Barnwell on the NFL Week 10 recap. Near the bottom of the article he starts talking about Raiders chances of going 0-16 this season. He referenced Bill James Log5 calculation and the Pythagorean Wins Expectation theory on win probabilities.

What if I created a site that would project the win probabilities of the home team based on the Log5 and Pythagorean Wins Expectation? For Log5 calculations all I need is the winning percentage of each time. For Pythagorean Wins I just need the points for and points against for each team and apply a little math.

Take 1

The site allows you to plug in the values you have and calculate the win probabilities for the home team. The cool thing about this first attempt is that it works on all major sports by just choosing the home field advantage factor for whatever sport you want.

The winners site is good for quick one off matchup projections, however I realized pretty quick that projecting multiple games was tedious. The data for the calculations is readily available on several websites so I took the logical next step.

Projecting Winners

First I wanted to project the weekly NFL games using Log5 and Pythagorean Wins. I used Python to go out and grab all the data. Sample below

Team Stats Sample

Schedule data Sample

I wrote a couple stored procs to do the projection math and came up with the following result set.

Log5 and Pythagorean Win Projects for NFL Matchups Week 11

Those last 6 columns is the good stuff. The calculated probabilities of the home team winning based on Log5 and Pythagorean Wins on both a neutral field and using home field advantage. So now all I needed was a website to show the week matchups and probabilities.

Watch Factor

Small spoiler on that last screenshot. Since I now had the win probabilities for all the week's matchups, why not create a WatchFactor metric that will predict how watchable a NFL game will be. The WatchFactor is broken up into the following categories.

Barn BurnerIf Visitor Team Wins > Losses AND Home Team Wins > Losses AND the Pythagorean Wins Home Field Advantage Probability Projection is between 40% and 65%Barn Burners should show you the matchups between two teams with winning records where the win probablility for the home team in somewhere near 50%. This would indicate that the teams are pretty well matched and they are both winning teams. Should be a good game
Stink TownCase 1: If Visitor Team Wins < Losses And Home Team Wins < Losses. Case 2: If Home Team Win Probability < 30% and if the matchup is not a dumpster fireStink town games are uninteresting games. Games between 2 losing teams or games where the home team has less than a 30% chance of winning.
Dumpster FireIf home team win probablitiy is <= 20% OR home team win probablity is >= 85%.This game is projected to be a blow out. It is going to get ugly quick.
Keep an Eye on ItIf home team wins = visitor team wins and its not a barn burner or stink townThis was an attempt to show those games that could be good games base soley on the fact that the teams have similar records.
Take it Or Leave itIf the game does not fall into any other category than it’s a take it or leave itCatch all for games that don't fit in a category.

Judging the Projections

So how accurate are the Log5 and Pythagorean Win Projections at picking the winner? I added the green check mark to the teams that are projected to win using the Pythagorean Wins with Home Field Advantage probability. I wrote a final part to the main python script to update the results table with the winning team and stats about the win (winner points, loser points, etc.). Once I have some data stored up I can start showing how accurate the Log5 and Pythagorean Wins projects can be at picking the matchups.

All the NULLS will be updated when the update scripts runs Tuesday morning after the games are finished up. The pPythwinner column shows the projected winner based on the calculated win probabilities.


Finally I thought it would be cool and trendy to post the weekly matchup numbers to Twitter with a link back to this article explaining the method to the madness. Using the Twitter Library for Python it was pretty simple.


Post a Comment