Saturday, December 27, 2025

Part II: Optimizing Daily Fantasy Basketball Lineups with Monte Carlo Simulation

Basketball, at its core, is a fast-paced, high-scoring sport played by two teams of five. Unlike baseball or football, the continuous nature of play means that players accumulate statistics rapidly: points, rebounds, assists, steals, and blocks. In Daily Fantasy Basketball (DFB), each of these statistics maps directly to fantasy points.

In DFB, participants select a roster of real players subject to a virtual salary cap. The objective is to maximize the combined fantasy score of the roster. This turns uncertainty in real-world player performance into a constrained mathematical optimization problem.

Beyond deterministic projection

The central challenge of DFB is not simply selecting the highest projected players, but constructing a lineup that balances upside and risk under a hard salary constraint. Traditional approaches rely on deterministic optimization techniques such as Linear Programming (LP), where each player is assigned a single projected score. While LP efficiently finds the lineup with the maximum projected total, it fundamentally ignores the stochastic nature of athletic performance.

Player outcomes are random variables. A projection is not a truth; it is a summary statistic.

A typical projection might state that LeBron James will score 55.0 fantasy points. In an LP framework, this value is treated as fixed. In reality, 55.0 fantasy points represents the expected value of a distribution of possible outcomes.

Formally, for player ii, fantasy points scored PiP_i are modeled as

PiN(μi,σi2)P_i \sim \mathcal{N}(\mu_i, \sigma_i^2)

where

μi=projected mean fantasy points\mu_i = \text{projected mean fantasy points}σi=standard deviation of performance\sigma_i = \text{standard deviation of performance}

In practice, truncated Gaussian or skew-normal distributions are often more realistic, since fantasy scores cannot be negative and upside tails are asymmetric. The key point remains: performance is stochastic.

Monte Carlo optimization framework

Monte Carlo Simulation (MCS) provides a natural way to incorporate this uncertainty into lineup construction. The goal shifts from finding the lineup with the highest projected score to finding the lineup that maximizes the probability of achieving an elite outcome, such as winning a tournament or finishing in the top percentile of a contest.

The framework proceeds as follows.

1. Input data preparation

For each player ii, we require:

μi(mean projection)\mu_i \quad \text{(mean projection)}Si(salary)S_i \quad \text{(salary)}σi(performance standard deviation)\sigma_i \quad \text{(performance standard deviation)}

The standard deviation σi\sigma_i is estimated from historical data, incorporating factors such as opponent defensive rating, recent usage trends, pace of play, and injury uncertainty. These contextual factors often inflate variance significantly, especially for ball-dominant players.

2. Simulation loop

We perform NN independent simulation trials, typically with

N10,000N \geq 10{,}000

For trial jj, each player receives a randomized fantasy outcome:

Pi,jN(μi,σi2)

Each trial produces a fully realized slate in which every player has a concrete score.

3. Inner deterministic optimization

For each Monte Carlo simulation ss, we obtain a vector of simulated player fantasy scores

f(s)=(f1(s),,fN(s)).\mathbf{f}^{(s)} = (f_1^{(s)}, \dots, f_N^{(s)}).

Given these fixed scores, we solve the deterministic optimization problem

maxxi=1Nfi(s)xisubject toi=1NcixiC,x{0,1}N,and all positional roster constraints.\begin{aligned} \max_{\mathbf{x}} \quad & \sum_{i=1}^N f_i^{(s)} x_i \\ \text{subject to} \quad & \sum_{i=1}^N c_i x_i \le C, \\ & \mathbf{x} \in \{0,1\}^N, \\ & \text{and all positional roster constraints.} \end{aligned}

The resulting optimal value

Z(s)=maxxifi(s)xiZ^{(s)} = \max_{\mathbf{x}} \sum_i f_i^{(s)} x_i

is the highest achievable lineup score in that simulated universe.

4. Aggregation and portfolio construction

After all NN simulations, we analyze how frequently players and lineups appear in optimal solutions.

Key quantities include:

  • Frequency of appearance: how often a player or lineup is selected across simulations

  • Expected value:

EV(L)=E[Score(L)]\text{EV}(L) = \mathbb{E}[\text{Score}(L)]

  • Conditional Value-at-Risk (CVaR), which measures average performance in the extreme upper tail:

CVaR95(L)=E[Score(L)Score(L)q95]\text{CVaR}_{95}(L) = \mathbb{E}[\text{Score}(L) \mid \text{Score}(L) \geq q_{95}]

where q95q_{95} is the 95th percentile of the lineup’s score distribution.

The optimization objective no longer maximizes μi\sum \mu_i. Instead, it prioritizes lineups that perform exceptionally well when things break right.

Variance stacking

Monte Carlo simulation naturally exposes the importance of variance stacking. Lineups composed solely of high-mean, low-variance players rarely dominate the extreme tail of the distribution. Instead, optimal tournament lineups tend to combine:

  • A small number of high-floor players with low σi\sigma_i

  • Several high-variance players whose upside outcomes align positively

When multiple high-σi\sigma_i players simultaneously realize outcomes near their upper percentiles, the resulting lineup score can exceed the deterministic expectation by a wide margin.

This phenomenon cannot be captured by single-projection optimization. It emerges only when uncertainty is modeled explicitly.

The edge belongs to the analyst who best understands variance, correlation, and tail behavior, and who is willing to let uncertainty drive the optimization rather than pretending it does not exist.

No comments:

Post a Comment

Part II: Optimizing Daily Fantasy Basketball Lineups with Monte Carlo Simulation

Basketball, at its core, is a fast-paced, high-scoring sport played by two teams of five. Unlike baseball or football, the continuous nature...