Skip to content

calculations.matches_14_prob_goals_total

Poisson probabilities for the total goals in a match using λ = stats_goals_expected_total. Evaluated for k ∈ 0…7; the 7_plus bucket is computed as 1 − sum(prob_0…7).

P(X = k) = e^(-λ) · λ^k / k!

flowchart LR
m9[/matches_9_expected_goals/] --> me[/calculations.matches_14_prob_goals_total/]
me --> mart[/mart.matches/]
click m9 "/calculations/matches_9_expected_goals/" "Open"
click mart "/mart/matches/" "Open"
ColumnDescriptionFormula
event_idBet365 event identifier.passthrough
event_dateEvent date.passthrough
event_partition_keyClickHouse partition key.passthrough
score_totalActual total goals (carried).passthrough
stats_goals_expected_totalExpected total goals.passthrough
stats_goals_expected_homeExpected home goals.passthrough
stats_goals_expected_awayExpected away goals.passthrough
prob_goals_total_0Probability total = 0.round(max(if(goals = 0, probability, 0)), 4)
prob_goals_total_1Probability total = 1.round(max(if(goals = 1, probability, 0)), 4)
prob_goals_total_2Probability total = 2.round(max(if(goals = 2, probability, 0)), 4)
prob_goals_total_3Probability total = 3.round(max(if(goals = 3, probability, 0)), 4)
prob_goals_total_4Probability total = 4.round(max(if(goals = 4, probability, 0)), 4)
prob_goals_total_5Probability total = 5.round(max(if(goals = 5, probability, 0)), 4)
prob_goals_total_6Probability total = 6.round(max(if(goals = 6, probability, 0)), 4)
prob_goals_total_7Probability total = 7.round(max(if(goals = 7, probability, 0)), 4)
prob_goals_total_7_plusProbability total ≥ 8.round(1 - sum(probability), 4)
prob_goals_total_sumSanity check — exactly 1.round(sum(probability) + (1 - sum(probability)), 4)

probability = round(poisson_pmf(stats_goals_expected_total, goals), 4) from macros/poisson_pmf.sql.