In this post, I use a Shiny app in R to determine the best possible players to pick in a fantasy football auction draft. The app includes the most accurate fantasy football projections available, and calculates a robust average of more sources of projections than any other website using a robust average (see here for a list of the sources of projections). You can even choose how much weight to give each source. Based on your league settings, it determines which players you should draft to maximize your starting lineup’s projected points. It also allows you to change your risk tolerance to avoid picking risky players. Best of all, the app updates the selections automatically with your inputs, and you can download the data for yourself. So let’s get to it. Here’s a more thorough description:
How it Works
First, I use a script to scrape player’s projected points from numerous sources using R. Our projections include projections from FantasyPros, an ideal source of projections because it averages across numerous sources of projections, and is the most accurate source of projections. Second, I scrape average auction values from Yahoo, ESPN, and FantasyPros. Third, I calculate players’ risk levels, as defined by the standard deviation (uncertainty) around the players’ ranks and projections across sources. Note that risk is standardized to have a mean of 5 and a standard deviation of 2. Fourth, I take user inputs on league settings to calculate projections that are custom tailored for your league (e.g., based on how many points a passing TD is worth in your league). The projections are based on a weighted average using the source weights input by the user. If the weights are all 1, a robust average is calculated that is less affected by outliers (crazy projections).
Fifth, I take the average auction values (AAV) from the source you select (e.g., Yahoo, ESPN), and normalize the players’ costs relative to the cap available and to the number of teams. In line with an unpublished analysis from Harvard on the optimal draft strategy, I apply a 10% premium to the top players and a 10% discount to the lower-tiered players. According to the study, the majority of one’s excess cap should be spent on the starting lineup, and you should spend less on bench players. This is because bench players do not contribute much to the team’s projected points. Although bench players are important in the case of a starter’s injury or under-performance, it is generally best to draft starters with minimal risk to ensure solid, if not superior, performance. On the other hand, one should accept more risk with bench players because such a move has a low risk, high reward potential. This 10% adjustment results in a projected cost that reflects the cost you can expect and should be willing to pay for a player if he is selected by the optimizer. Note: The projected costs don’t always map onto the projected points because the projected cost is derived from the AAV of the site you selected and not the projected points. That’s because your draft costs will be in large part driven by your site’s AAV, which greatly influences what other people in your league will be willing to pay for each player.
Then, based on how many starters you need for each position, your cap available, the players already drafted, and your maximum risk tolerance, I use the Rglpk package to find your optimal starting lineup by selecting the remaining players available that maximize the starting lineup’s sum of projected points while meeting all of the constraints. For a similar execution using Excel’s Solver function, see here. See below for a description of the possible user inputs.
Players You Drafted: Select all players you’ve already drafted (can type player’s name or scroll to select).
Cap Spent: How much cap you spent on the players you drafted.
Other Players Drafted: Select all players that other teams already drafted (can type player’s name or scroll to select).
Auction Values: Source of average auction values to use in calculating projected cost.
Number of Teams: the number of teams in your fantasy league.
League Cap: the cap available for each team at the beginning of the draft.
Total Number of Players on Roster: the total number of players on roster, including bench players. This is used to determine your available cap (it assumes you must spend at least $1 on each bench player).
Passing Yards Per Point: How many passing yards are worth 1 fantasy point?
Points Per Passing TD: How many points is each passing touchdown worth?
Points Per Passing INT: How many points is each interception worth?
Rushing Yards Per Point: How many rushing yards are worth 1 fantasy point?
Points Per Rushing TD: How many points is each rushing touchdown worth?
Points Per Reception: How many points are receptions worth?
Receiving Yards Per Point: How many receiving yards are worth 1 fantasy point?
Points Per Receiving TD: How many points is each receiving touchdown worth?
Points Per Fumble: How many points is each fumble worth?
Maximum Risk Tolerance: Selects the maximum risk allowed for any player to be considered for inclusion in the optimal starting lineup. Players’ risk levels have a mean of 5 and a standard deviation of 2.
Enter number of starters needed from each position.
How much weight to give each source of projections when calculating projected points. If all weights = 1, a robust average is calculated. Otherwise, a weighted average is calculated. For instance, if you want to exclude ESPN projections, you would give them a weight of 0. If you want to give Yahoo projections twice the weight of CBS, you would give Yahoo a weight of 2 and CBS a weight of 1.
The Shiny App
Below is a preview of the Shiny App for optimizing your draft by picking the players that maximize your starting lineup’s projected points. For the actual Shiny App, go to: http://fantasyfootballanalytics.net:3838/Auction Draft/