ŷTrick
A from-scratch NHL player-value project: isolated even-strength and special-teams impact ratings, plus a browsable, shift-by-shift view of every game.
The name
In statistics, a hat marks a predicted value — ŷ (“y-hat”) is the model’s estimate of an outcome. In hockey, a hat trick is three goals. The two share that hat: the ŷ supplies it, so ŷ + “Trick” said aloud is exactly “y-hat-trick.” Hence the mark ŷ Trick — and the domain spells it out as yhattrick.com.
What it does
Two things, from the same underlying data:
- Isolated impact ratings. For every skater, an estimate of how much they raise their team’s expected-goal rate (offense) and suppress the opponent’s (defense), separated from the quality of their linemates and competition.
- Game inspection. Each game broken into stints — intervals of constant on-ice personnel — with the exact players, strength state, shot events, and an expected-goals tally for each, on a rink map.
How the model works
The ratings are a regularized adjusted plus-minus (RAPM). Every stint becomes an observation: the response is a team’s expected goals per 60 minutes of that ice time, and the predictors are indicators for which players are on the ice — an offense term for each attacker and a defense term for each defender. Solving the whole season at once with ridge regression untangles teammates from opponents, because players who appear in many different combinations can be separated.
- Strength states. Even strength (5v5) and special teams (5v4 power play, 4v5 penalty kill) are fit separately so power-play offense and penalty-kill defense stay clean.
- Context adjustment. Shared covariates — home ice, offensive/defensive zone start, score state, period, and season — absorb deployment, score, and era effects so player coefficients better reflect skill.
- Regular season only, pooled across multiple seasons for a stronger signal. Playoffs and shootouts are tracked separately and never enter the model.
- Uncertainty is shown. Each rating carries a 95% confidence interval that widens with low ice time and with linemates who rarely separate; percentiles are computed within position group.
Where the data comes from
Everything is computed from raw NHL sources — play-by-play and shift charts — joined shift-to-shot in-house: box scores, on-ice personnel, shot volume (Corsi/Fenwick/shots on goal), score and zone context, the impact model, and our own per-shot expected-goals model. No third-party model outputs.
Caveats
- Linemates who almost never play apart are hard to separate; their shared impact can land unevenly on one of them. Pooling seasons helps; a hierarchical model will help more.
- The most recent season is still filling in (not every game has shift data yet), so its sample is partial.
- These are impact components, not a finished Wins Above Replacement number. Finishing, penalties, and the goals-to-wins conversion are still to come.
Expected goals are a model estimate, not actual goals. Treat every rating as an estimate with a margin of error, not a verdict.