技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
odds-analysis【数据与研究】Converts betting odds between formats and removes bookmaker margin to find true implied probabilities. Use when user asks about devigging, vig removal, implied probability, no-vig lines, American/decimal/fractional odds conversion, Shin method, Power method, or bookmaker margin. Prerequisite for edge detection. Do not use for viewing current odds -- …
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Default data tool: PuckAPI (
puckapi-tool). Useget_odds(10 credits) for current odds data. Useget_line_movement(25 credits) for historical line movement -- most expensive operation. For your own odds CSV, skip the tool and work with the file directly.
You are an expert in betting odds mathematics. Your goal is to extract true implied probabilities from bookmaker odds by removing the embedded margin (vig). This is prerequisite knowledge for any downstream edge detection or expected value calculation.
odds-exploreredge-detectionprobability-calibrationget_line_movement endpoint covers that; this skill covers the math| Command | What It Does | Credits |
|---|---|---|
get_odds | Current odds snapshot for a game | 10/game |
get_line_movement | Historical line movement for a game | 25/game |
| Not Available | Use Instead |
|---|---|
get_no_vig_line | Compute from get_odds using devig methods below |
get_true_probability | Compute from get_odds using Shin or multiplicative method |
get_historical_odds | Use get_odds with a past game date |
compare_books | Fetch get_odds per book and compare manually |
| Operation | Credits | Notes |
|---|---|---|
| Odds snapshot (one game) | 10 | Returns all available books |
| Line movement (one game) | 25 | Full price history, use sparingly |
| Full season odds (backtest) | ~820-1,230 | 82 NHL games * 10cr each |
Before starting, establish:
# Positive odds (underdog)
decimal = (american / 100) + 1
# Example: +150 -> (150/100) + 1 = 2.50
# Negative odds (favorite)
decimal = (100 / abs(american)) + 1
# Example: -180 -> (100/180) + 1 = 1.556
# Decimal >= 2.0 (underdog)
american = (decimal - 1) * 100
# Example: 2.50 -> (2.50 - 1) * 100 = +150
# Decimal < 2.0 (favorite)
american = -100 / (decimal - 1)
# Example: 1.556 -> -100 / (1.556 - 1) = -180
# Positive: american/100 = fractional
# +150 -> 150/100 = 3/2
# Negative: 100/abs(american) = fractional
# -180 -> 100/180 = 5/9
# From American positive
raw_prob = 100 / (american + 100)
# +150 -> 100 / 250 = 0.400
# From American negative
raw_prob = abs(american) / (abs(american) + 100)
# -180 -> 180 / 280 = 0.643
# From decimal
raw_prob = 1 / decimal
# 1.556 -> 1 / 1.556 = 0.643
Vig (vigorish) is the bookmaker's margin. On a two-sided market, both raw probabilities sum to more than 1.0.
total_implied = raw_prob_home + raw_prob_away
vig = total_implied - 1.0
Example: DraftKings has Sabres +150 / Leafs -180.
Typical vig ranges:
Divide each raw probability by the total overround. Simple and fast.
true_prob_home = raw_prob_home / total_implied
true_prob_away = raw_prob_away / total_implied
Example (continued):
Use when: Quick estimate is needed, books are balanced. Assumes vig is distributed proportionally across both sides.
Assumes equal overround per outcome -- finds exponent p such that sum of probabilities^p = 1.
# Find p via numerical solve:
raw_prob_home^(1/p) + raw_prob_away^(1/p) = 1
true_prob_home = raw_prob_home^(1/p)
true_prob_away = raw_prob_away^(1/p)
Use scipy.optimize.brentq or similar to solve for p. More accurate than multiplicative on asymmetric markets (heavy favorites).
Use when: Moneyline markets with significant favorites where vig is likely tilted.
Accounts for the possibility of insider trading (informed bettors). The bookmaker widens lines beyond pure vig to protect against sharp action. Shin estimates the true probability plus the insider trading component.
# Shin's z parameter (fraction of bets from informed traders):
z = solve for: sum of (raw_prob_i^2 / (z + (1-z) * raw_prob_i)) = 1
# True probability:
true_prob_i = sqrt(z^2 + 4*(1-z)*raw_prob_i^2) / (2*(1-z)) - z / (2*(1-z))
The Shin calculation requires numerical methods. In practice:
from scipy.optimize import brentq
def shin_z(z, raw_probs):
return sum(p**2 / (z + (1-z)*p) for p in raw_probs) - 1
z = brentq(shin_z, 0, 0.5, args=(raw_probs,))
true_probs = [
(math.sqrt(z**2 + 4*(1-z)*p**2) - z) / (2*(1-z))
for p in raw_probs
]
Use when: You want the most accurate true probability estimate. Best for comparing against model. Gold standard for research.
Limitation: Requires at least two outcomes. For three-outcome markets (soccer), extend the formula to three sides.
Assumes all vig is placed on one side -- the most conservative estimate.
# Assumes entire vig on favorite:
true_prob_favorite = raw_prob_favorite - vig
true_prob_underdog = raw_prob_underdog # no adjustment
# Or alternatively: entire vig on underdog
true_prob_underdog = raw_prob_underdog - vig
true_prob_favorite = raw_prob_favorite
Use when: Conservative analysis, want to know the floor on underdog true probability. Not recommended for betting EV calculations -- too conservative.
| Method | Use Case | Sample Size | Accuracy |
|---|---|---|---|
| Multiplicative | Quick estimates, balanced markets | Any | Moderate |
| Power | Favorites with significant lines | Any | Good |
| Shin | Research, model comparison, EV bets | Best with multiple books | Best |
| Worst-case | Conservative floor estimates | Any | Conservative |
Default recommendation: Shin for any research or betting application. Multiplicative only for quick sanity checks.
Market: DraftKings Sabres +150 / Leafs -180
Step 1: Raw implied probabilities
Step 2: Multiplicative method
Step 3: Power method
Step 4: Shin method
Result comparison:
| Method | Sabres True Prob | Leafs True Prob |
|---|---|---|
| Multiplicative | 38.4% | 61.7% |
| Power | 38.5% | 61.5% |
| Shin | 38.3% | 61.7% |
| Raw (with vig) | 40.0% | 64.3% |
Note how raw probabilities sum to 104.3%. Using raw probabilities for EV calculation would make every bet look worse than it is -- you'd be comparing your model against an inflated baseline.
The no-vig line is the American odds equivalent of the true probability.
# True prob -> American odds:
# If true_prob > 0.5:
no_vig_american = -100 * true_prob / (1 - true_prob)
# If true_prob < 0.5:
no_vig_american = 100 * (1 - true_prob) / true_prob
Example: Shin says Sabres true prob = 38.3%
DraftKings posts +150, no-vig line is +161. DraftKings is 11 cents short on the underdog side.
| Rationalization | Why It's Wrong | Do This Instead |
|---|---|---|
| "I'll just use the raw implied probability from the odds" | Raw implied probability includes the vig. For a -180 favorite, raw implied is 64.3% but true probability might be 61.7%. Using raw makes every underdog look worse than it is. | Always devig before comparing against model. One of the four methods above, Shin preferred. |
| "Multiplicative is close enough for moneyline" | On balanced markets (near -110/-110), yes. On heavy favorites (-300+), multiplicative and Shin diverge by 1-2%. On an edge that is already 2-3%, that's significant. | Use Shin for anything with significant implied probability asymmetry. |
| "Line movement means sharp action, I should follow it" | Line movement reflects many things: injury news, public betting, sharp action, or just book repositioning. It is evidence, not proof. | Use line movement as one signal. Cross-reference with injury reports and model output before acting. |
| "Props have the same vig as moneylines" | Props carry 7-12% vig vs 3-5% on moneylines. The no-vig probability for a prop at -115 is very different from a moneyline at -115. | Always calculate vig explicitly from the two-sided market before devigging. |
For a devigged market:
Game: Buffalo Sabres vs Toronto Maple Leafs
Book: DraftKings
Raw odds: Sabres +150 / Leafs -180
Raw implied: Sabres 40.0% / Leafs 64.3% (total: 104.3%, vig: 4.3%)
Devigged (Shin method):
Sabres: 38.3%
Leafs: 61.7%
No-vig line: Sabres +161 / Leafs -161
| What You Found | Next Action | Skill |
|---|---|---|
| Devigged odds in hand, have model probability | Compare model vs market to find edge | edge-detection |
| Want to explore current lines across books | Browse available odds | odds-explorer |
| Need calibrated model probability first | Verify model output quality | probability-calibration |
| Building a backtest with historical odds | Fetch historical odds data | backtesting |