matchup-win-probability-sim
БесплатноБез исполняемых скриптовНе проверенComputes P(we win at least K of N categories) for a head-to-head categorical matchup via Monte-Carlo simulation or Poisson-binomial approximation…
от lyndonkl★ 208 звёзд на GitHubОб этом скилле
Matchup Win Probability Simulator
Table of Contents
Example
Scenario: Yahoo MLB 10-category H2H matchup, Week 8, threshold = 6 of 10. Categories: R, HR, RBI, SB, OBP (hitting); K, ERA, WHIP, QS, SV (pitching). ERA and WHIP are inverse (lower is better).
Inputs (remaining-week projections for both teams; mean = expected output, stddev = uncertainty):
| Cat | Our mean | Our stddev | Opp mean | Opp stddev | Inverse? |
|---|---|---|---|---|---|
| R | 42 | 8 | 38 | 7 | no |
| HR | 12 | 3.5 | 14 | 4 | no |
| RBI | 40 | 9 | 41 | 8 | no |
| SB | 6 | 2.5 | 4 | 2 | no |
| OBP | 0.335 | 0.015 | 0.328 | 0.014 | no |
| K | 55 | 10 | 50 | 9 | no |
| ERA | 3.85 | 0.45 | 4.10 | 0.50 | yes |
| WHIP | 1.22 | 0.08 | 1.28 | 0.09 | yes |
| QS | 4 | 1.5 | 3 | 1.4 | no |
| SV | 2 | 1.2 | 5 | 1.5 | no |
Run both modes with random_seed=42, cat_win_threshold=6, n_simulations=10000:
Monte Carlo output:
matchup_win_probability= 0.612expected_cats_won= 6.18variance_estimate= 2.42 (variance of cats-won count)per_cat_win_probability: R 0.64, HR 0.35, RBI 0.47, SB 0.72, OBP 0.64, K 0.64, ERA 0.65, WHIP 0.68, QS 0.69, SV 0.08
Poisson-binomial output (for comparison, uses the same per-cat win probs as inputs to the PB recurrence):
matchup_win_probability= 0.605expected_cats_won= 6.18 (exact — sum of per-cat probs)variance_estimate= 2.11 (variance of sum of independent Bernoullis)
Interpretation: we are a modest favorite (~61%). SV is a hard-punt cat (8% win). HR is contested but we lean losing. The six most defensible pushes are SB, QS, WHIP, ERA, R, K (and OBP). Downstream mlb-lineup-optimizer uses win_prob = 0.612 to classify us as a favorite → damp variance.
Workflow
Copy this checklist and track progress:
Matchup Win Probability Simulation Progress:
- [ ] Step 1: Validate inputs and cat_list coverage
- [ ] Step 2: Choose sim_mode (monte_carlo or poisson_binomial)
- [ ] Step 3: Apply inverse-cat handling
- [ ] Step 4: Run simulation with seeded RNG
- [ ] Step 5: Compute per-cat and overall win probabilities
- [ ] Step 6: Emit outputs with variance and optional sim_trace
Step 1: Validate inputs
Confirm every cat in cat_list has an entry in both our_per_cat_projection and opp_per_cat_projection, each with {mean, stddev}. Confirm cat_win_threshold <= len(cat_list). Confirm cat_inverse_list ⊆ cat_list. See resources/template.md.
- Every cat in
cat_listhas both sides' projections -
stddev > 0for all cats (zero stddev blocks correct simulation; use small floor if unknown) -
cat_win_thresholdin[1, len(cat_list)] - All
cat_inverse_listentries are valid cat names - If
sim_mode == "monte_carlo",n_simulations >= 1000(10k default; 100k for tight confidence)
Step 2: Choose sim_mode
Default to monte_carlo for operational decisions (full distribution of cats-won). Use poisson_binomial when you need a deterministic, sub-millisecond answer and are willing to assume per-cat independence. See resources/methodology.md.
-
monte_carlo: when you needsim_tracefor audit, when distributions are non-normal, or when per-cat correlations are passed -
poisson_binomial: when you need a fast closed-form approximation, or when calling this skill inside an inner optimization loop
Step 3: Apply inverse-cat handling
For every cat in cat_inverse_list, flip the comparison: our team wins the cat when our draw is less than the opponent's draw (ERA 3.50 beats ERA 4.20). The cleanest implementation is to negate the margin (our_draw - opp_draw) → (opp_draw - our_draw) for inverse cats before counting the win. See resources/methodology.md.
- Identify inverse cats from
cat_inverse_list - Negate margin (or flip comparison) per cat
- Verify the per-cat win prob for a known-inverse cat aligns with intuition
Step 4: Run simulation
With random_seed set, draw paired outcomes (one per team per cat per sim) from the configured distribution (normal default) and score each sim.
- Seed the RNG deterministically from
random_seed - For each of
n_simulations:- Draw
our_draw[cat] ~ Normal(our_mean, our_stddev)for every cat - Draw
opp_draw[cat] ~ Normal(opp_mean, opp_stddev)for every cat - For each cat, compute margin (negated for inverse)
- Count
cats_won = sum(margin > 0)(tie-break rule: exact tie counts as 0.5 or 0; see guardrail #4) - Record
matchup_win = (cats_won >= cat_win_threshold)
- Draw
For Poisson-binomial mode instead: compute per-cat win prob p_i = Φ(margin_mean_i / combined_stddev_i) analytically (n
Установить matchup-win-probability-sim в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл matchup-win-probability-sim?
Computes P(we win at least K of N categories) for a head-to-head categorical matchup via Monte-Carlo simulation or Poisson-binomial approximation. Domain-neutral — works for any fantasy sport with H2H Categories scoring (MLB, NBA, NHL) or any zero-sum per-category competition. Use when you need matchup_win_probability, per_cat_win_probability, expected_cats_won, or variance_estimate; or when user mentions "matchup win probability", "head to head simulation", "Monte Carlo matchup", "Poisson binomial matchup", "P win 6 of 10", "category matchup simulation", or "weekly win probability".
Как установить скилл matchup-win-probability-sim?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл matchup-win-probability-sim запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic