brackt/app/models/__tests__
Chris Parsons 79ec477a98 feat: implement Expected Value System with ICM probability calculator
Implements Phase 5.2 of the EV system with Harville-Malmuth Independent Chip Model
for calculating participant placement probabilities from futures odds.

## Key Features

### ICM Probability Calculator
- Implements Harville-Malmuth method for distributing probabilities
- Converts American odds to championship probabilities
- Generates P(1st) through P(8th) for all participants
- Column-normalized: each placement sums to 100% across all teams
- Works with any number of participants (not limited to 8)

### Admin UI - Futures Odds Entry
- Enter American odds (e.g., +550, -200) for championship futures
- Live preview of ICM-calculated probability distributions
- Displays all 8 placement probabilities
- Persists odds for editing on subsequent visits
- Automatic probability normalization (removes bookmaker vig)

### Database Schema Updates
- Renamed participant_expected_values.season_id → sports_season_id
- Updated foreign key to reference sports_seasons instead of seasons
- Added source_odds field to store original futures odds
- Migration 0025: Column rename and FK update
- Migration 0026: Add source_odds field

### Model Layer
- participant-expected-value: CRUD operations for probability distributions
- Supports multiple probability sources (manual, futures_odds, elo_simulation)
- Automatic EV calculation based on league scoring rules
- Probability validation and normalization

### Service Layer
- icm-calculator: Harville-Malmuth probability distribution
- probability-engine: Odds conversion and Elo utilities (for future use)
- bracket-simulator: Monte Carlo simulation (for future hybrid approach)
- ev-calculator: Expected value computation from probabilities

## Technical Details

- Uses exponential decay favoring top positions for strong teams
- Preserves championship probability ordering in final distributions
- Row sums vary (strong teams ~100%, weak teams lower)
- All probabilities between 0-1, mathematically valid
- Comprehensive test suite: 97 tests passing

## Future Enhancements

- Hybrid approach: ICM pre-playoffs, bracket simulation during playoffs
- Integration with league-specific scoring rules
- Historical probability tracking for accuracy analysis

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 22:19:46 -08:00
..
afl-finals.test.ts feat: Implement AFL Finals bracket template and scoring logic with double-chance system 2025-11-12 23:21:22 -08:00
bracket-integration.test.ts Add bracket seeding tests and implement tournament-style seeding for 16 and 32-team brackets 2025-11-04 22:09:44 -08:00
bracket-seeding.test.ts Add bracket seeding tests and implement tournament-style seeding for 16 and 32-team brackets 2025-11-04 22:09:44 -08:00
bracket-templates.test.ts feat: Implement NFL 14 bracket template with bye week handling and comprehensive unit tests 2025-11-08 21:56:57 -08:00
ncaa-68-bracket.test.ts feat: Implement NCAA 68 tournament structure with First Four play-in games and Round of 64 seeding logic 2025-11-08 21:18:09 -08:00
nfl-bracket.test.ts feat: Implement NFL 14 bracket template with bye week handling and comprehensive unit tests 2025-11-08 21:56:57 -08:00
participant-expected-value.test.ts feat: implement Expected Value System with ICM probability calculator 2025-11-17 22:19:46 -08:00
point-progression.test.ts feat: add recharts library and implement PointProgressionChart component for historical views 2025-11-14 21:18:34 -08:00
qualifying-points.test.ts feat: Implement Qualifying Points Standings component and related logic 2025-11-11 10:08:25 -08:00
scoring-calculator-qualifying.test.ts feat: Implement Qualifying Points Standings component and related logic 2025-11-11 10:08:25 -08:00
scoring-calculator.test.ts feat: Implement bracket expansion plan to support various tournament structures 2025-11-03 09:36:16 -08:00
season-standings.test.ts feat: Implement season standings processing and participant result management for final standings events 2025-11-08 22:35:07 -08:00
standings-snapshots.test.ts feat: implement daily standings snapshot system with admin management interface 2025-11-14 09:15:58 -08:00
tiebreaker-logic.test.ts feat: add standings page and enhance standings functionality 2025-11-13 13:24:03 -08:00