calculations.matches_8_team_strength
Builds attack and defence strength multipliers for both teams. Each is the team’s per-match scoring (or conceding) average divided by the relevant league average. League average of zero falls back to 1.0 so the downstream expected-goal calculation degenerates to the league mean rather than zero.
Lineage
Section titled “Lineage”flowchart LR m7[/matches_7_league_stats_window/] --> me[/calculations.matches_8_team_strength/] me --> m9[/matches_9_expected_goals/] me --> mart[/mart.matches/] click m7 "/calculations/matches_7_league_stats_window/" "Open" click m9 "/calculations/matches_9_expected_goals/" "Open" click mart "/mart/matches/" "Open"
Columns
Section titled “Columns”| Column | Description | Formula |
|---|---|---|
* (matches_7_league_stats_window) | All upstream columns. | passthrough |
stats_attack_home | Home team’s attack strength relative to the league. | round(case when stats_goals_league_avg_home = 0 then 1.0 else stats_goals_scored_avg_home / stats_goals_league_avg_home end, 2) |
stats_attack_away | Away team’s attack strength. | round(case when stats_goals_league_avg_away = 0 then 1.0 else stats_goals_scored_avg_away / stats_goals_league_avg_away end, 2) |
stats_defense_home | Home team’s defence rating (vs typical away scoring). | round(case when stats_goals_league_avg_away = 0 then 1.0 else stats_goals_conceded_avg_home / stats_goals_league_avg_away end, 2) |
stats_defense_away | Away team’s defence rating (vs typical home scoring). | round(case when stats_goals_league_avg_home = 0 then 1.0 else stats_goals_conceded_avg_away / stats_goals_league_avg_home end, 2) |