**Fantasy Football Analytics in R**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

In this post, I calculate the highest value you should bid on each player in an auction draft—what I refer to as the “bid up to” value. In a previous post, I showed how to determine the best starting lineup to draft using an optimizer tool. The “bid up to” value is calculated by finding the highest cost up to which a player is still on the best lineup, as determined by the optimizer.

### How it Works

The optimizer tool finds the starting lineup that maximizes your team’s projected points, while staying within your risk tolerance. By placing the optimization function in a loop, we can calculate the optimal starting lineup for each player at each cost. For example, to find Tom Brady’s bid up to value, we can start his cost at $1 and run the optimization function. At this price, Tom Brady is on the best starting lineup, so we increase his cost by $1 while keeping all other players at their expected cost. At $2, Tom Brady is still on the best starting lineup, so we increase his cost again by $1. We repeat this until Tom Brady’s cost is too high for him to be on the best starting lineup. As of this writing and given my league settings, Tom Brady’s bid up to value is $16. That means that Tom Brady is a good value up to $16—if he’s above that price, I should draft someone else because he is no longer on the optimal starting lineup at this cost. After calculating Tom Brady’s bid up to value, we reset his cost to his expected cost and then we calculate the bid up to value for the next player. We repeat this for all players to calculate each player’s bid up to value.

### The R Script

The R Script for looping the optimizer to find each player’s bid up to value is located here:

https://github.com/dadrivr/FantasyFootballAnalyticsR/blob/master/R%20Scripts/Bid%20Up%20To.R

Here is the syntax for looping the optimizer to calculate each player’s bid up to value:

### Conclusion

**leave a comment**for the author, please follow the link and comment on their blog:

**Fantasy Football Analytics in R**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.