Optimizing Betting on Korea Professional Baseball with the Frank–Wolfe Algorithm

Mon, May 19, 2025
by SportsBetting.dog

Introduction

The intersection of optimization algorithms and sports betting has opened up sophisticated ways for bettors and quantitative analysts to gain an edge in prediction and portfolio management. Among such algorithms, the Frank–Wolfe algorithm (also known as the conditional gradient method) stands out for solving constrained convex optimization problems efficiently.

In this article, we explore how the Frank–Wolfe algorithm works and delve into how it can be applied to betting on Korea Professional Baseball (KBO), one of Asia’s most popular baseball leagues. We'll discuss the mathematics behind the method, how it fits into a sports betting framework, and propose a system that leverages Frank–Wolfe to maximize expected returns from a portfolio of bets.



What is the Frank–Wolfe Algorithm?

The Frank–Wolfe algorithm is an iterative first-order optimization method used to solve problems of the form:

minimize f(x)subject to xD\text{minimize } f(x) \quad \text{subject to } x \in \mathcal{D}

Where:

  • f(x)f(x) is a convex and differentiable objective function.

  • D\mathcal{D} is a convex feasible region (e.g., a polyhedron or simplex).

Algorithm Steps

Given an initial point x0Dx_0 \in \mathcal{D}, the method iterates as follows:

  1. Direction Finding Step:

    sk=argminsDf(xk),ss_k = \arg\min_{s \in \mathcal{D}} \langle \nabla f(x_k), s \rangle
  2. Update Step:

    xk+1=xk+γk(skxk)x_{k+1} = x_k + \gamma_k (s_k - x_k)

    where γk\gamma_k is a step size, either set via a line search or a predefined schedule such as γk=2k+2\gamma_k = \frac{2}{k+2}.

Why Use Frank–Wolfe?

  • Simplicity: Only requires solving a linear subproblem at each step.

  • Efficiency in High Dimensions: Well-suited for large-scale optimization with sparse constraints.

  • Projection-Free: Does not require projecting onto the constraint set, unlike many other gradient-based methods.



Sports Betting as a Convex Optimization Problem

Modeling Sports Betting as a Portfolio

Betting can be viewed analogously to investing in assets. Each bet represents an asset with a probabilistic return. The bettor’s objective is to allocate capital among a set of bets to maximize expected utility or return, while managing risk and satisfying constraints like budget or betting limits.

Let’s Define:

  • Let nn be the number of possible bets (e.g., KBO game outcomes).

  • Let xRnx \in \mathbb{R}^n be a vector of fractions of capital allocated to each bet.

  • Let pRnp \in \mathbb{R}^n be the vector of true winning probabilities (subjectively estimated).

  • Let oRno \in \mathbb{R}^n be the vector of odds offered by the bookmaker.

  • The expected return function is:

f(x)=i=1nxi(pioi1)f(x) = -\sum_{i=1}^n x_i (p_i \cdot o_i - 1)

The goal is to minimize negative expected return, subject to:

i=1nxi=1,xi0\sum_{i=1}^n x_i = 1, \quad x_i \geq 0

This is a convex optimization problem over the probability simplex, ideal for Frank–Wolfe.



Applying Frank–Wolfe to Korea Professional Baseball Betting

Step 1: Data Collection and Probability Estimation

To apply the Frank–Wolfe algorithm, you need accurate probability estimates for each game outcome.

Sources:

  • Historical match data (scores, win/loss, pitcher stats, etc.)

  • Team and player performance metrics

  • Lineup announcements and injury reports

  • Weather and venue information

Use statistical modeling or machine learning methods (logistic regression, XGBoost, Bayesian models) to estimate probabilities pip_i of each team winning.

Step 2: Odds Retrieval

Gather bookmaker odds oio_i for all KBO games on a given day. You can use APIs like OddsAPI or scrape sportsbook websites.

Step 3: Constructing the Optimization Problem

Each bet corresponds to a possible team win or loss. Let’s say you’ve estimated that for a particular KBO match:

  • Doosan Bears win probability: 0.60

  • Bookmaker odds for Doosan Bears: 1.80

Then expected value for betting on Doosan is:

EV=0.601.801=0.08\text{EV} = 0.60 \cdot 1.80 - 1 = 0.08

Now, compile this for all games and bets into a vector form:

  • p=[p1,p2,...,pn]p = [p_1, p_2, ..., p_n]

  • o=[o1,o2,...,on]o = [o_1, o_2, ..., o_n]

Define the objective:

f(x)=i=1nxi(pioi1)f(x) = -\sum_{i=1}^n x_i (p_i o_i - 1)

Subject to:

  • xi=1\sum x_i = 1 (capital allocation)

  • xi0x_i \geq 0 (no short betting)

Step 4: Applying Frank–Wolfe

  1. Initialize: Start with x0x_0 as uniform allocation or betting nothing.

  2. Compute Gradient:

    f(x)=[(p1o11),...,(pnon1)]\nabla f(x) = -[(p_1 o_1 - 1), ..., (p_n o_n - 1)]
  3. Direction Finding: Solve:

    sk=argminsΔf(xk),ss_k = \arg\min_{s \in \Delta} \langle \nabla f(x_k), s \rangle

    This reduces to putting all capital on the best EV bet.

  4. Update Allocation:

    xk+1=xk+γk(skxk)x_{k+1} = x_k + \gamma_k (s_k - x_k)
  5. Repeat until convergence or a practical iteration limit is reached.

This process yields a betting portfolio: a distribution of your bankroll across the available KBO bets that (according to your model) maximizes expected profit.



Advantages of Frank–Wolfe in KBO Betting Predictions

  1. Handles Simplex Constraints Naturally: No need for complex projection onto probability simplex.

  2. Efficient for Daily Re-Optimization: As KBO games occur frequently, recalculating optimal bets daily is computationally feasible.

  3. Robust to Noise: Small perturbations in odds or probabilities do not drastically affect the solution.

  4. Sparse Solutions: Tends to produce solutions where only a few bets get large allocations – mimicking expert bettors who only bet when value exists.



Practical Considerations

Estimation Errors

If your probability estimates are inaccurate, the optimization won't help. It’s crucial to:

  • Regularly backtest your prediction model

  • Incorporate uncertainty (e.g., using Bayesian intervals)

  • Avoid overfitting to past seasons

Market Impact and Limits

Bookmakers may restrict bet sizes or change odds when large bets are placed. Thus, you may need to include liquidity constraints:

xiLix_i \leq L_i

This remains a convex problem and still works with Frank–Wolfe.

Risk Management

Consider including variance or drawdown constraints:

  • Maximize Sharpe ratio instead of expected value.

  • Add a constraint on total variance:

Var=xi2Var[ri]σmax2\text{Var} = \sum x_i^2 \cdot \text{Var}[r_i] \leq \sigma^2_{\text{max}}

Where Var[ri]\text{Var}[r_i] is variance of return from bet ii.



Example Code (Python + CVXPY Approximation)

import numpy as np
import cvxpy as cp

# Example data
p = np.array([0.60, 0.45, 0.55])  # Estimated win probabilities
o = np.array([1.8, 2.1, 1.95])   # Bookmaker odds

n = len(p)
x = cp.Variable(n)
expected_return = cp.sum(cp.multiply(x, p * o - 1))
objective = cp.Maximize(expected_return)

constraints = [cp.sum(x) == 1, x >= 0]
prob = cp.Problem(objective, constraints)
prob.solve()

print("Optimal betting fractions:", x.value)

To apply the Frank–Wolfe algorithm explicitly, you'd use custom iterative updates as described in the algorithm section.



Conclusion

The Frank–Wolfe algorithm offers a powerful, projection-free method for optimizing sports betting portfolios, particularly when dealing with probability-simplex constraints as found in KBO betting strategies. Its iterative nature and sparsity-inducing properties align well with real-world betting behaviors, where only a few bets may be truly profitable.

By combining high-quality probabilistic modeling of KBO games with this convex optimization approach, bettors can move from intuitive gambling toward quantitatively grounded betting systems that aim to maximize expected return under risk and budget constraints.

Sports Betting Videos

IPA 216.73.216.182

2025 SportsBetting.dog, All Rights Reserved.