Weekly Variability Simulation of Fantasy Football Projections

July 20, 2014
By

(This article was first published on Fantasy Football Analytics » R | Fantasy Football Analytics, and kindly contributed to R-bloggers)

In this post, I show how to estimate players’ week-to-week variability in fantasy football points.  In a prior post, I demonstrated how to calculate a player’s risk level, as defined by the variability of their projected points across sources.  As a reader pointed out, another form of meaningful variability is week-to-week variability (in addition to variability across sources).  Some fantasy statistics are more variable (TDs) than others (yards) from week to week.  For players with a higher percentage of their projected points scored by TDs, their weekly points are likely to be more variable. Another example might be possession receivers vs deep threats.  Possession receivers are likely more reliable from week-to-week than deep threats who are more boom-or-bust.  Here, I use a simulation to estimate each player’s week-to-week variability in fantasy points.

The R Scripts

The R Script for the “Historical Weekly Variability” section is below:

https://github.com/dadrivr/FantasyFootballAnalyticsR/blob/master/R%20Scripts/Historical/Historical%20Weekly.R

The R Script for the “Weekly Variability Simulation” section is below:

https://github.com/dadrivr/FantasyFootballAnalyticsR/blob/master/R%20Scripts/Posts/Weekly%20Simulation.R

Historical Weekly Variability

In order to simulate players’ weekly fantasy points, we first must determine the distribution from which to sample for each player and statistical category (passing yards, rushing TDs, etc.).  I chose to sample from a normal distribution, with each player’s weekly mean of the statistical category as the mean of his distribution.  In other words, if Peyton Manning is projected to have 4800 passing yards this season, that equals an average of 300 yards per game (4800/16).  Thus, for sampling Peyton Manning’s weekly passing yards, we can sample from a distribution with a mean of 300.

For a normal distribution, we have to specify a mean and standard deviation.  What standard deviation should we use for Peyton Manning’s weekly passing yards?  We could theoretically use Peyton Manning’s weekly variability from last season, but some players do not have statistics from last year.  As a result, I chose to calculate the historical weekly variability for passing yards (and all other statistical categories) averaged across all players from the past three seasons.  Then, we use the historical week-to-week standard deviation of players’ passing yards as the standard deviation of players’ sampling distributions for passing yards.

To do this, I scrape data from every week of the season (weeks 1-17) from Pro-Football-Reference for the past three seasons:

After cleaning and merging the data, I then put the data in the necessary form for calculating players’ weekly variability.  This involves transforming the data from long form to wide form so that each week has a separate column:

Then I calculate the week-to-week standard deviation of each statistical category for every player in each season.  Finally, I calculate a robust average across all players and seasons to get a general week-to-week standard deviation for each statistical category:

Here are the average week-to-week standard deviations for each statistical category:

  • Passing yards : 82.1 yards
  • Passing TDs: 0.8 TDs
  • Passing INTs: 0.7 INTs
  • Rushing yards: 11.3 yards
  • Rushing TDs: 0.4 TDs
  • Receptions: 11.1 receptions
  • Receiving yards: 15.9 yards
  • Receiving TDs: 0.4 TDs

Here are the density plots of the week-to-week standard deviations of each statistical category for the different players and seasons:

SD Pass Yards SD Pass TDs SD Pass INTs SD Rush Yards SD Rush TDs SD Rec SD Rec Yards SD Rec TDs

Weekly Variability Simulation

Now that we’ve calculated the historical week-to-week standard deviation for each statistical category, we can simulate players’ weekly performances for each statistical category using the sampling distribution of a) that player’s weekly mean and b) the historical week-to-week standard deviation for the relevant statistical category.  In other words, for simulating Peyton Manning’s passing yards in the example earlier, we will sample from the distribution with a mean of 300 passing yards and a standard deviation of 82.1 yards.  But the sampling has some constraints.  First, the samples (weekly performances in each game) must sum to equal Manning’s projected passing yards for the season.  Second, for some statistical categories (e.g., TDs), values can only be positive integers (e.g., you can’t score half a touchdown or negative touchdowns in a game).  Here’s the function for taking ‘n’ samples from a distribution whose mean is ‘sum’/'n’ and whose standard deviation is ‘sd’, and that only include positive integers that sum to equal ‘sum’:

Using this function, and plugging in the player’s season projection and the historical week-to-week standard deviation for each statistical category, we simulate all 16 games for 100 different seasons for each player and statistical category:

Then we calculate the weekly fantasy points for every player in all 100 seasons based on their simulated performances in each statistical category:

Finally, we calculate the week-to-week standard deviation of fantasy points for each player in all 100 seasons, and the average week-to-week standard deviation across seasons:

Here are some players with high weekly variability in fantasy points according to our simulation:

  • Cam Newton
  • Robert Griffin III
  • Colin Kaepernick
  • Jamaal Charles
  • Matt Forte
  • Montee Ball
  • Cordarrelle Patterson
  • Percy Harvin
  • Alshon Jeffery
  • Tavon Austin

Conclusion

Simulating weekly variability can help you identify players who are more or less reliable from week to week.  For example, possession receivers (who rely less on long gains and touchdowns) are more reliable than deep threats, who tend to boom or bust.

The post Weekly Variability Simulation of Fantasy Football Projections appeared first on Fantasy Football Analytics.

To leave a comment for the author, please follow the link and comment on his blog: Fantasy Football Analytics » R | Fantasy Football Analytics.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.