Chapter 13 Exercises: Goalkeeper Analysis
Overview
These exercises cover shot-stopping metrics, distribution analysis, sweeper-keeper evaluation, and comprehensive goalkeeper profiling. You will work with real match data to calculate, visualize, and interpret goalkeeper performance metrics.
Data Requirements: StatsBomb open data (accessed via statsbombpy)
Estimated Completion Time: 8-10 hours
Part 1: Shot-Stopping Fundamentals (Exercises 1-6)
Exercise 1: Basic Save Statistics
Calculate fundamental save statistics for goalkeepers in a match.
Tasks: a) Load a World Cup match and identify the goalkeepers b) Calculate total shots on target faced by each goalkeeper c) Calculate save percentage for each goalkeeper d) Compare these statistics between the two goalkeepers
Expected Output: Table showing basic save statistics for both goalkeepers
Exercise 2: Expected Goals Analysis
Analyze expected goals faced by goalkeepers.
Tasks: a) Calculate total xG of shots faced by each goalkeeper b) Compare xG faced to actual goals conceded c) Calculate goals prevented (xG - goals conceded) d) Interpret: Did either goalkeeper over- or under-perform expectations?
Expected Output: xG analysis table with interpretation
Exercise 3: Shot Quality Zones
Analyze shots faced by pitch zone.
Tasks: a) Categorize shots into zones (inside box central, inside box wide, outside box) b) Calculate save percentage by zone for each goalkeeper c) Calculate xG faced by zone d) Identify which zone presented the greatest challenge
Expected Output: Zone-based shot analysis matrix
Exercise 4: Save Difficulty Analysis
Examine the difficulty of saves made.
Tasks: a) For each save, record the xG of the shot b) Calculate the total "difficult saves" (xG > 0.15) c) Calculate average xG of saves made vs. goals conceded d) Create a visualization showing save difficulty distribution
Expected Output: Histogram of save difficulties with statistics
Exercise 5: Shot Outcome Breakdown
Create comprehensive shot outcome analysis.
Tasks: a) Categorize all shots by outcome (Goal, Saved, Saved to Post, Missed, Blocked) b) Calculate percentage distribution of outcomes c) Compare on-target shot outcomes between goalkeepers d) Calculate "shot conversion rate against" (goals / shots on target)
Expected Output: Shot outcome breakdown table and pie chart
Exercise 6: Goals Prevented Per 90
Normalize goalkeeper statistics to per-90 rates.
Tasks: a) Load multiple matches for a goalkeeper b) Calculate total xG faced and goals conceded c) Calculate goals prevented per 90 minutes d) Compare to league average benchmarks
Expected Output: Per-90 statistics with benchmark comparison
Part 2: Distribution Analysis (Exercises 7-12)
Exercise 7: Pass Completion Analysis
Analyze goalkeeper passing statistics.
Tasks: a) Extract all passes by the goalkeeper b) Calculate pass completion percentage c) Categorize passes by length (short <20m, medium 20-40m, long >40m) d) Calculate success rate by length category
Expected Output: Pass statistics table by length category
Exercise 8: Distribution Style Classification
Classify goalkeeper distribution style.
Tasks: a) Calculate percentage of long passes (>40m) b) Calculate ground vs. lofted pass ratio c) Analyze goal kick patterns specifically d) Classify style: "Launcher", "Builder", or "Balanced"
Expected Output: Distribution style classification with supporting metrics
Exercise 9: Progressive Distribution
Measure how effectively the goalkeeper advances play.
Tasks: a) Identify progressive passes (advances ball >10m forward) b) Calculate progressive pass percentage c) Calculate average progression distance on successful passes d) Identify the most common pass targets (by position)
Expected Output: Progressive pass statistics and target analysis
Exercise 10: Build-Out Play Analysis
Analyze goalkeeper involvement in build-out play.
Tasks: a) Count passes to defenders vs. midfielders vs. forwards b) Calculate success rate by target position c) Analyze pass timing (first-touch vs. controlled) d) Identify patterns in build-out sequences
Expected Output: Build-out analysis with pass flow visualization
Exercise 11: Goal Kick Patterns
Detailed analysis of goal kicks.
Tasks: a) Extract all goal kicks b) Calculate short vs. long goal kick ratio c) Analyze success rate by type d) Map goal kick end locations
Expected Output: Goal kick analysis with location heatmap
Exercise 12: Distribution Under Pressure
Analyze passing under defensive pressure.
Tasks: a) Identify passes made under pressure b) Calculate success rate under pressure vs. not under pressure c) Analyze how passing patterns change under pressure d) Identify risky passes in dangerous areas
Expected Output: Pressure analysis comparison table
Part 3: Sweeper-Keeper Metrics (Exercises 13-18)
Exercise 13: Actions Outside the Box
Analyze goalkeeper involvement outside the penalty area.
Tasks: a) Count ball recoveries outside the box b) Count clearances outside the box c) Count interceptions by the goalkeeper d) Calculate "sweeper actions per 90"
Expected Output: Outside-box action summary
Exercise 14: Defensive Line Support
Measure how the goalkeeper supports the defensive line.
Tasks: a) Analyze goalkeeper's average position during opponent possession b) Calculate distance from goal line during defensive actions c) Compare to team's defensive line height d) Identify patterns in sweeping behavior
Expected Output: Positioning analysis with defensive line comparison
Exercise 15: Cross Claiming Analysis
Analyze goalkeeper performance on crosses.
Tasks: a) Identify all crosses into the box against the goalkeeper's team b) Count successful claims (catches) by the goalkeeper c) Count punches and aerial clearances d) Calculate claim rate and success rate
Expected Output: Cross handling statistics
Exercise 16: Aerial Duel Analysis
Evaluate goalkeeper aerial ability.
Tasks: a) Count aerial duels won and lost b) Calculate aerial win percentage c) Analyze locations of aerial duels d) Compare to outfield defenders' aerial rates
Expected Output: Aerial duel statistics with comparison
Exercise 17: One-on-One Situations
Analyze goalkeeper performance in breakaway situations.
Tasks: a) Identify shots from counter-attacks or 1v1 situations b) Calculate xG of these shots c) Calculate save rate in these situations d) Compare to regular shot save rate
Expected Output: One-on-one analysis summary
Exercise 18: Rush-Out Timing
Analyze timing of goalkeeper advances.
Tasks: a) Identify instances where goalkeeper comes off line b) Analyze outcomes (save, goal, clearance) c) Calculate success rate of rush-outs d) Identify patterns in successful vs. unsuccessful rushes
Expected Output: Rush-out analysis with success factors
Part 4: Sample Size and Uncertainty (Exercises 19-24)
Exercise 19: Confidence Intervals
Calculate confidence intervals for goalkeeper metrics.
Tasks: a) Calculate raw save percentage from match data b) Calculate 95% confidence interval for save percentage c) Visualize the uncertainty range d) Discuss how sample size affects confidence
Expected Output: Save percentage with confidence intervals
Exercise 20: Bayesian Save Percentage
Implement Bayesian estimation for save percentage.
Tasks: a) Define an informative prior based on league averages b) Calculate posterior save percentage estimate c) Compare Bayesian estimate to raw estimate d) Show how the estimate evolves with more data
Expected Output: Bayesian analysis comparison chart
Exercise 21: Rolling Performance Metrics
Track goalkeeper performance over time.
Tasks: a) Load multiple matches for a goalkeeper b) Calculate match-by-match goals prevented c) Calculate 5-match rolling average d) Identify form trends and outliers
Expected Output: Rolling performance time series chart
Exercise 22: Stabilization Analysis
Investigate metric stabilization.
Tasks: a) Simulate goalkeeper performance over a season b) Track when save percentage stabilizes c) Track when goals prevented stabilizes d) Recommend minimum sample sizes for reliable evaluation
Expected Output: Stabilization analysis with recommendations
Exercise 23: Regression to Mean
Demonstrate regression to the mean in goalkeeper statistics.
Tasks: a) Identify goalkeepers with extreme first-half season performance b) Compare to their second-half performance c) Calculate regression effect magnitude d) Discuss implications for goalkeeper evaluation
Expected Output: Regression analysis with visualization
Exercise 24: Uncertainty Visualization
Create visualizations that communicate uncertainty.
Tasks: a) Create bar chart with error bars for save percentage b) Create distribution plot for goals prevented estimate c) Create comparison plot showing overlap in confidence intervals d) Discuss how to present uncertain data to non-technical audiences
Expected Output: Suite of uncertainty visualizations
Part 5: Comprehensive Applications (Exercises 25-30)
Exercise 25: Complete Goalkeeper Profile
Build a comprehensive goalkeeper profile.
Tasks:
a) Create a GoalkeeperProfile class with all major metrics
b) Populate the profile for a specific goalkeeper
c) Generate radar chart visualization
d) Classify goalkeeper style
Expected Output: Complete profile with visualization
Exercise 26: Multi-Goalkeeper Comparison
Compare multiple goalkeepers from a tournament.
Tasks: a) Build profiles for 5+ goalkeepers from the World Cup b) Rank by each major metric category c) Create comparison visualizations d) Identify the "best" overall performer with justification
Expected Output: Multi-goalkeeper comparison report
Exercise 27: Goalkeeper Recruitment Analysis
Apply analysis to a recruitment scenario.
Tasks: a) Define requirements for a "sweeper-keeper" role b) Create scoring criteria for each requirement c) Evaluate 3 goalkeeper candidates d) Make a recommendation with supporting analysis
Expected Output: Recruitment analysis report
Exercise 28: Match Report Generation
Create an automated match report for goalkeeper performance.
Tasks: a) Build a function that generates a text summary of goalkeeper performance b) Include key statistics with context c) Highlight notable saves or errors d) Generate the report for a specific match
Expected Output: Automated match report
Exercise 29: Season Evaluation
Conduct a full-season goalkeeper evaluation.
Tasks: a) Load all available matches for a goalkeeper b) Calculate cumulative season statistics c) Track performance evolution throughout the season d) Provide end-of-season evaluation summary
Expected Output: Season evaluation report
Exercise 30: Goalkeeper Analytics Dashboard
Design a goalkeeper analytics dashboard.
Tasks: a) Create a multi-panel figure with key visualizations b) Include shot map, distribution patterns, and radar chart c) Add summary statistics panel d) Make it suitable for presentation to coaching staff
Expected Output: Complete dashboard visualization
Submission Guidelines
Code Requirements
- Well-commented Python code with docstrings
- Functions should be reusable and modular
- Include error handling for missing data
- Handle the uncertainty inherent in goalkeeper data
Analysis Requirements
- Acknowledge sample size limitations
- Provide confidence intervals where appropriate
- Compare to relevant benchmarks
- Consider tactical context in interpretation
Visualization Requirements
- Clear, labeled visualizations
- Communicate uncertainty appropriately
- Professional formatting
- Suitable for non-technical audiences where specified
Grading Rubric
| Component | Weight |
|---|---|
| Code Quality | 25% |
| Statistical Accuracy | 25% |
| Uncertainty Handling | 20% |
| Visualization | 15% |
| Interpretation | 15% |
Additional Challenges
-
Tracking Data Extension: If tracking data is available, incorporate positioning analysis
-
Video Integration: Select 5 key saves and analyze technique alongside statistics
-
Cross-League Comparison: Compare goalkeeper styles across different leagues
-
Historical Analysis: Track a goalkeeper's development over multiple seasons
-
Novel Metric Development: Propose and implement a new goalkeeper metric