NBA Prediction System
Professional betting intelligence powered by live data and Monte Carlo simulation
What This System Does
This is a comprehensive NBA prediction platform that analyzes games using advanced statistics and Monte Carlo simulation to identify betting opportunities with positive expected value.
10,000+
Simulations per game for accurate probabilities
Live Data
Real-time odds and stats from ESPN & TheOddsAPI
Edge Detection
Only recommends bets with 3%+ statistical advantage
Injury Adjusted
Accounts for player availability and impact
How to Use
1. View Predictions (Web Interface)
Simply click "View Predictions" above to see all upcoming games with betting recommendations.
Look for pink/red cards - These have 5%+ edge and represent the strongest betting opportunities!
2. Generate Fresh Predictions
Click "Run New Predictions" to fetch the latest odds and stats, then generate new predictions for upcoming games.
3. View Detailed Analysis
Click any game card to see:
- Win probabilities for each team
- Spread and total predictions
- Top 6 factors influencing the prediction
- Injury impact analysis
- Player prop recommendations
- Data source audit trail
4. Use CLI Scripts (Advanced)
# Generate predictions for today + 2 days
php run/predict.php --window="today+2" --format=summary
# Run historical backtest
php run/backtest.php --season=2024
# Test system
php run/test.php
Understanding Predictions
Win Probability
Based on 10,000 Monte Carlo simulations. Example: LAL 63.4% means the Lakers win in 6,340 out of 10,000 simulations.
Model Spread
Expected point margin. -5.2 means the home team is expected to win by 5.2 points.
Edge %
Your statistical advantage over the market. 5.43% edge means your model gives you a 5.43% better probability than the market odds imply.
Bet Types
- Moneyline: Straight-up winner
- Spread: Team covers the point spread
- Over/Under: Total points scored
Stats Calculated
The system calculates these advanced metrics for every team:
- Net Rating: Offensive Rating - Defensive Rating
- Pace: Possessions per game
- True Shooting %: Points / (2 × (FGA + 0.44×FTA))
- Effective FG%: (FGM + 0.5×3PM) / FGA
- Home/Away Splits: Location-specific performance
- Rolling Averages: Recent form (3/7/14 games)
- Recency Weighting: Recent games matter more
Data Sources
All predictions use live data from authoritative sources:
- ESPN API: Game schedules, scores, team stats, injuries
- TheOddsAPI: Live betting odds and line movements
- Basketball-Reference: Historical game logs
- SportsRadar: Enhanced lineup data (optional)
Every data fetch is logged with URL and timestamp for full auditability. Check the "Data Sources" section in any game detail view.
Sample Data
The system currently shows sample predictions to demonstrate functionality. When NBA games are scheduled, click "Run New Predictions" to fetch real game data and generate live predictions.
System Configuration
All settings are configurable in config/config.php:
- Timezone (default: US/Eastern)
- Monte Carlo simulations (default: 10,000)
- Edge threshold (default: 3%)
- Recency decay factor (default: 0.95)
- API keys and endpoints
Technical Specifications
- Platform: PHP 8.4 with SQLite
- Database: 8 tables for games, stats, predictions, odds, injuries, props, audit logs
- Performance: <1 second per game prediction
- Architecture: Modular with 8 core components
- UI: Responsive HTML5/CSS3, works on all devices
Files & Documentation
- README.md: Complete technical documentation
- QUICKSTART.md: User guide and troubleshooting
- DEPLOYMENT.md: Validation checklist and metrics
Support
Logs are stored in logs/app_YYYY-MM-DD.log
Database is located at data/nba_predictions.db