Showing posts with label audacious alternative. Show all posts
Showing posts with label audacious alternative. Show all posts

Monday, August 19, 2019

Elo-based shot evaluation

Important ADDENDUM
The interest in this research was fueled by the presentation of Micah Blake McCurdy at SEAHAC2019, where he described evaluation of quality of goaltenders as the evaluation of the quality of the shots saved.

The author of this article is not a mathematician or a statistician, so possibly the below is an utter absurd, or heresy, however it passed a few sanity checks the author was able to establish, and therefore he likes it.

1. Why Elo?


Shot (or shot attempt, but like Micah, I will use the term shot for all three location-tracked events: GOAL, SHOT and MISS) is an essential zero-sum outcome: either the goal is scored (1) or it is not (0). That always invokes the question - can we use the Elo ratings to evaluate the expectation of a shot being stopped based on the difficulty of the shot, the shooter and the goaltender.

Thus, given the probability of the shot $P_s$ and the outcome of the shot $X (0|1)$, we can adjust the ratings of the shooter and the goalie:

$R_s=R_s_0 + (X-P_s)$ (1)
$R_g=R_s_0 + (P_s-X)$ (2)

For example, if a shot had a probability 0.06 of going in, and still the goal was scored, the rating of the shooter will increase by 0.94 and the rating of the goalie will decrease by 0.94.
But you may ask, how in the formulas above do ratings affect the probability of the shot going in?

2. The factors of the shot.


If we take the shots, for which coordinates are defined, i.e. from the 2010/11 season through 2018/19, we can observe that the average scoring rate is about 0.06% (remember, misses are included).

However as also described by Micah, not all shots are created equal. Therefore we dissect them by the following factors:
  • Location on the rink
  • Season (due to equipment changes)
  • Stage (due to playing style changes)
  • Shooter (Here comes Rs)
  • Shooting team (Team attacking style)
  • Goalie (Here comes Rg)
  • Goalie team (Team defending style)
  • Side (generalized code, see below)
  • Shot type
  • On-Ice strength
  • Score differential
  • Rebound length
  • Is it a rush?
  • Is it a giveaway in Def. zone?
  • Is it a takeaway in Off. zone?
We will discuss the factors in depth below.

Location:

For the sake of simplicity we divide the rink into the following segments:
  • All of the rink outside the offensive zone
  • All of the rink below the goal line of the offensive zone
  • The remainder of the offensive zone split into squares of three to eight feet. Some tests run provided that the optimal size of such a quadrant is five feet.
We realize that this dissection is imperfect, but for this first run it's simple enough. Later we may try to do the same process with more complicated sector shapes.

Season:

The annual changes in the rules of the NHL dictate that a given season may provide different average shot quality than other ones.

Stage:

The famous statement of playoffs being won through defense implies the chances to score are smaller in the postseason.

Shooter:

We use current $R_s$ from (1) for the shooter.

Shooting team:

The team's style of play may rely more on the quantity of shots or the quality, thus affecting the overall chances of a given shot going in.

Goalie:

We use current $R_g$ from (2) for the goalie

Goalie team:

The defending style and capability are not dissimilar to the ones of the shooting team.

Side:

We try to estimate the effect of the shooting side of the skater and the catching side of the goalie together with relative location of the shot:
  • Shot location:
    • C - center, in front of the goal
    • R - to the right of the goal, attacker wise
    • L - to the left of the goal, attacker wise
  • Shooter's side - R|L
  • Goalie's side - R|L
Altogether we have 12 values (LLL, ..., CRL, ..., CRR)

Shot type:

We use all available shot types:
  • Slap
  • Snap
  • Wrist
  • Backhand
  • Wrap-around
  • Tip-in
  • Deflection
Naturally, all unassigned shots are discarded.

Strength:

On-ice strength, from 33 to 55. Penalty shots are discarded. A future development may introduce either special cases of goalies pulled, or incorporating those into different strengths, including the new 63-65 ones.

Therefore the shots that do not have on-ice count are discarded.

Score differential:

We treat the score score situations differently for all well-known reasons. We define the scores differences between -2 (shooting team 2 goals behind) to 2 separately, and the larger differences fall all under -3 and 3.

Rebound:

Rebound is defined when a shot attempt (including blocked shot) happened recently prior to this shot being analyzed. Not only we test for such an event in the 3 seconds before the shot, we also catalog them separately by the time passed between the previous attempt and the rebound (0, 1, 2, 3 seconds).

Rush:

We define rush similarly to others, as a shot attempt from offensive zone which is preceded by a non-faceoff event in non-offensive zone within five seconds.

Give:

We consider a defensive zone giveaway an event seriously tilting the chances of a score due to the goaltender being caught somewhat unaware. We define a qualifying giveaway event to have occurred in the defensive zone within 6 seconds of the shot.

Take:

We consider a offensive zone takeaway an event seriously tilting the chances of a score due to the goaltender being caught somewhat unaware. We define a qualifying takeaway event to have occurred in the offensive zone within 6 seconds of the shot.

Schedule aspects, such as back-to-back games (or prolonged breaks) or Home/Away are possible factors that were not considered. Maybe, next summer.

3. The application of the factors


Now that we managed to classify all the shots by the factors described above, we can try to appraise the effect of the factors.

We begin with setting some starting/default values. We obtain these values from two first seasons of our research period, i.e. from 2010/11 and 2011/12. Later we will incorporate the remainder of the data into it.

As we said earlier, let's assume an overall probability of the shot going in is about 0.0622 (from these two seasons). That corresponds to Elo rating difference of about 471 points in favor of the goaltender. Therefore we can say that an average shooter from an average location against an average goaltender is like a match between a 2029 and a 2500 rated players.

Now the factors from the previous chapter come in handy. For each of these factors (excluding the personal ratings for now) we compute the probability of success for a shot with each value of the factor. For example, for a binary factor like takeaway we get the following table:

Takeaway
0
0.0618
1
0.1014

which means that the Elo differential of the shot which is not preceded by takeaway is lower by 0.8 points, and but higher by 92.5(!) points if there was a takeaway.

For a non-binary factor, e.g. strength (no penalty shots):

StrengthpΔelo
330.0500-40.0
340.096883.5
350.105399.7
430.1099108.1
440.06456.9
450.065610.1
530.1683193.9
540.085259.1
550.0563-18.3

Note that these numbers predate the 3on3 overtime. Also, it's tougher to score in full strength than on average.

Then to get the overall shot rating we add these differences to the original value of $R_{base}$==2029 (divided by 1.5 due to the behavior of the Elo sigmoid at low probabilities), and also add the difference between $R_s$ and 2029 (also assigned as the initial shooter rating), and subtract the difference between $R_g$ 2500 (also assigned as the initial goalie rating).

So we have

$$R_{shot} = R_{base} + 3/2∑Δ_f +(R_s - R_{base} + (2500-R_g)$$

or, effectively

$R_{shot} = R_s +3/2∑Δ_f + (2500 - R_g)$ (3)

Then we can estimate the chances of the goal going in by the Elo formula:

 $$P_s = 1 / ( 1 + 10 ^ (( 2500 - R_{shot} ) / 400))$$ 

 or, effectively

$P_s = 1 / ( 1 + 10 ^ ((R_g - R_s - 3/2∑Δ_f)/400))$ (4)

Note that we never do an explicit match of shooter vs goalie. We could do that instead of including $R_s$ and $R_g$ in the formula, but that way proved to be more complicated and provided less consistent results.

Looks straightforward? Unfortunately, it isn't.

4. Confounders


If the factors were completely independent, our job would be done. Alas, they are not, they are implicitly confounding each other, i.e. there might be more deflecting shots resulting in goal on a powerplay, or more rebounds in quadrants close to the goal, and so on. Therefore we try to mitigate these dependencies in the following way:

I. As a base line we calculate the probabilities of success for shots in each quadrant we defined.

II. Then we compute the probability of success for shots with each separate factor value in the given quadrant.

III. We calculate the ratio the freshly computed probability to the general probability of success in this quadrant.

IV. The resulting confounding effect is then calculated according to the following formula:

$C_f = 1 / (|log(ratio)| + 1)$

Thus, when the probabilities are the same in the quadrant with or without the factor set ($ratio == 1$), we get $C = 1$.

V. We multiply each $Δ$ factor$ by the corresponding $C$, thus formulas (3) and (4) become:

$R_{shot} = R_s + 3/2∑Δ_fC_f/1.5 + (2500 - R_g)$ (5)

and

$P_s = 1 / ( 1 + 10 ^ ((R_g - R_s - 3/2∑Δ_fC_f) /400))$ (6)


Obviously, for the quadrant factor $C_f == 1$.

To test the validity of the math above, we tested log loss of betting each shot not being a goal. By just using the base probability of 0.0622 the log loss was about 0.240. By using the probabilities computed through (5) and (6) the log loss was reduced to 0.210 with each factor contributing to the reduction.

5. The eXpected goal value and the save above expectation


Now by using (5) we can calculate the number of expected goals against each goalie in a game:

$xG = ∑↙{goalie}(P_s)$ in a given game.

We know how many goals were scored against the goalie and we can easily apply (2). The new rating of the goalie will be used in the calculations for the next game he participates in. Same applies for the shooters, only the sum is of the shots taken by the shooter. Empty Net shots are not accounted for.

We calculate the $xG$ and $G$ for games on each date starting with the 2012/13 season onward. After all games for a given date had been processed, we feed them back into the probabilities of the modifiers to keep them current, and in a way that gives the data from the current season double weight compared to the past data, whereas data from the earliest available date is tossed out.

Here is the sample of best and worst performances in $xG-G$ for goalies and skaters, single game, and season (playoffs excluded):

Goals saved above expectation (game)
PlayerDateDelta
ALEXANDAR GEORGIEV201902106.034
EVGENI NABOKOV201403235.787
LAURENT BROSSOIT201504095.245
MIKE CONDON201701195.178
RYAN MILLER201601175.153

Goals saved below expectation (game)
PlayerDateDelta
AL MONTOYA201611046.152
SERGEI BOBROVSKY201812045.706
ROBIN LEHNER201402275.313
SERGEI BOBROVSKY201810135.279
JOEY MACDONALD201304035.251

Goals scored above expectation (game)
PlayerDateDelta
PATRIK LAINE201811244.436
CHRIS KUNITZ201302033.646
ALEX OVECHKIN201312103.582
AUSTON MATTHEWS201610123.531
BRAD RICHARDSON201902283.525

Goals scored below expectation (game)
PlayerDateDelta
NAZEM KADRI201902102.355
BROCK NELSON201412131.873
GABRIEL LANDESKOG201901091.868
LOGAN COUTURE201502171.827
RYAN O'REILLY201903291.693

Goals saved above expectation (season)
PlayerDateDelta
SERGEI BOBROVSKY201635.787
CAREY PRICE201332.607
JOHN GIBSON201626.296
CAREY PRICE201424.424
THOMAS GREISS201524.153

Goals saved below expectation (season)
PlayerSeasonDelta
JONATHAN QUICK201842.428
CAREY PRICE201733.573
CRAIG ANDERSON201728.724
THOMAS GREISS201725.168
SCOTT DARLING201724.161

Goals scored above expectation (season)
PlayerSeasonDelta
LEON DRAISAITL201823.047
PATRIK LAINE201722.6
ALEX DEBRINCAT201820.249
STEVEN STAMKOS201819.833
ALEX OVECHKIN201319.052

Goals scored below expectation (season)
PlayerSeasonDelta
ALEX CHIASSON201312.174
MIKE RICHARDS201311.016
ERIC STAAL201510.476
TYLER TOFFOLI201810.319
BRAYDEN SCHENN20149.894


As another validity check, we checked for inflation of ratings over time. We found that the goalie ratings inflated by the total of just 318 points for 186 goaltenders, and, correspondingly, deflated by the same amount for 1683 skaters. These values are pretty admissible for inflation.

6. Predictive aspects

Shooter

If a shooter has the rating $R_s$ above base shot rating $R_{base}$, then he increases the probability of a goal (and vice versa). The difference should be computed for each separate case, but on average, given a nearly linear behavior of the Elo function at low probabilities, each extra 10 points would account for 0.0035 difference in the probability of the shot. We can do a more particular job by surveying which factors dominate the shots of the player, and what's their probability altogether, excluding the shooter and thus compute the difference more precisely.

Goalie

If a goalie has the rating $R_g$ above 2500 (base goaltender rating) then he decreases the probability of a goal (and vice versa) in exactly reverse way that the shooter does. However, the goaltenders face the shots from all possible factor values, therefore we must adjust the probability from the base probability (e.g. 0.0622). The only factor that possibly should be taken into account is the goalie's team.

Team

We can approach the $xG$ (or rather $pG$ (projected goals)) of a team by two ways: iterating over the projected or published roster, or by blanket-weighted-averaging the shots the team takes per game and their probabilities. The first way is more complex, but supposedly more precise.

Season

We do not see any particular implications of a season-wide projection at any level, team, skater or goaltender. For the first two we just multiple a single game projection by the number of games in a season. For the latter one, an estimate of the number of games would be necessary.

Playoffs

In the playoffs we can hone our predictions to the given shooter and goalie's team. Maybe, that when home/away factors will also become more prominent.

Here's current (EOS 2018/19) top 5 goalie and skater rankings:

Top 5 Goalies after 18/19
PlayerRating
ANTTI RAANTA2535.5
BEN BISHOP2534.8
JOHN GIBSON2533.9
ROBIN LEHNER2524.7
JUUSE SAROS2523.1

Top 5 Colanders after 18/19
PlayerRating
KEITH KINKAID2480.6
MAXIME LAGACE2482.7
GARRET SPARKS2485.4
CRAIG ANDERSON2485.9
CHAD JOHNSON2487.7

Top 5 Scorers after 18/19
PlayerRating
ALEX OVECHKIN2104.4
STEVEN STAMKOS2097.2
NIKITA KUCHEROV2079.8
PATRICK KANE2077.3
PATRIK LAINE2076.0

Top 5 Whiffers after 18/19
PlayerRating
JORDAN STAAL2002.8
MATT MOULSON2002.9
JUSTIN ABDELKADER2004.8
PATRIC HORNQVIST2004.9
KYLE CLIFFORD2005.1

Concluding, the author wants to underline once again, that he realizes the insufficient theoretical background for the task undertaken, and that many assumptions that are made smell of ad hoc approach. However, we hope that the model finds its usefulness among the hockey fans, and that this research attracts people of better qualification that would be interested to polish and improve it.

Monday, January 15, 2018

A suggestion for the All-Star Game

While the series "Website - A Page A Day" is being delayed by all kinds of things, here comes a short post on a different topic.

Last year, in my opinion, the accuracy shooting competition which included shooting the pack from the goal line into a small hole was, in my opinion a total failure. Mike Smith's spectacular score across the rink did the injustice and provided a false impression this skill contest was any good. Otherwise, the competition was not exciting to say the least.

Therefore, here's a suggestion to replace it: reverse shootouts.

Let the goaltenders shed their equipment for once, and let the skaters don it instead. Let's have a competition where the goaltenders skate and attempt to score in shootout, while the skaters try to stop them. I am sure that somewhere in the back of their minds that would fulfill a little dream both parties would have!

Thursday, March 30, 2017

On the NHL Scoring System - Part III

Part I
Part II


Once again, driven by idea that if you want to encourage goal scoring, you need to reward the goal scoring in standings directly, not indirectly through winning. Then, based on the idea of a fellow hockey fan and blogger, a new suggestion was born in my mind.

Not so long ago I was involved in another discussion on the subject on Twitter, where an interesting alternative, 2-1-0-0 was described. The idea is that you still get two points for a win in regulation, just one point for a win in OT, but nothing if you lose, and, the key, both teams get nothing if the game is tied at the end of regulation (shootouts are abolished). This is a very sharp idea, but for me something felt very wrong, and then it crystallized:

It's not fair to reward a hard fought 5-5 tie with zero points, just like a lazy-skated 1-1. We still want to encourage goal scoring, and the simple 2-1-0-0 just unbalances the game. And so it dawned on me. We should reward goals with extra standings points!

The formula that first came to mind, and which seemed fair: give each goal a 0.1 point in the standings, while the win-scoring system shall be 2-1-0-0. If you or your database have an aversion against decimals, assign 20 points for a win, 10 points for OT loss, and 1 extra point for each goal scored. This will encourage goal scoring in any situation, and for both sides, including the games that go into garbage time pretty quickly. So, a 7-2 win will give the winner 2.7 points, and the loser 0.2 points. A 2-0 win will give the winner 2.2 points, the loser 0. A 4-3 OT win will give the winner 1.4 points, the loser 0.3 points. A 5-5 OT tie will give each side 0.5 points.

Wait, there's a caveat.

Imagine a situation where a team needs just 0.1 point to pass another one in the standings for the playoff spot. They are playing an opponent whose number of points in the standings does not have any effect on them. In such a situation, the team would play without a goaltender at all, because they don't care how much they lose, they just need that goal. Now, this is not really hockey, so to prevent this kind of play a restriction needs to be introduced:

Any goal scored without a goaltender on the ice, when not on a delayed penalty, and when trailing by more than two goals shall not yield any standings points.

Here is an example what the today's standings would look like under the suggested system:

Team                           W  OW T  L  GF  GA  P
Boston Bruins                  34 04 04 34 216 201 93.6
Montreal Canadiens             31 09 05 31 205 186 91.5
Ottawa Senators                32 04 08 31 191 191 87.1
--------------------------------------------------------
Washington Capitals            41 08 07 20 246 165 114.6
Columbus Blue Jackets          38 09 04 24 233 170 108.3
Pittsburgh Penguins            37 06 08 25 256 211 105.6
--------------------------------------------------------
New York Rangers               38 05 06 28 242 203 105.2
Toronto Maple Leafs            29 06 09 31 229 213 86.9
--------------------------------------------------------
New York Islanders             28 05 06 36 217 224 82.7
Tampa Bay Lightning            27 06 07 35 206 207 80.6
Carolina Hurricanes            28 04 07 36 198 208 79.8
Buffalo Sabres                 24 06 08 39 191 215 73.1
Philadelphia Flyers            22 07 11 36 193 218 70.3
Florida Panthers               21 07 11 37 192 210 68.2
New Jersey Devils              18 06 06 46 171 221 59.1
Detroit Red Wings              16 07 08 45 181 224 57.1
--------------------------------------------------------
Chicago Blackhawks             36 09 05 27 230 197 104.0
Minnesota Wild                 37 04 05 30 241 193 102.1
St. Louis Blues                35 06 02 33 213 200 97.3
--------------------------------------------------------
San Jose Sharks                35 06 03 32 204 185 96.4
Anaheim Ducks                  37 02 06 31 200 183 96.0
Edmonton Oilers                33 05 09 29 221 191 93.1
--------------------------------------------------------
Nashville Predators            33 04 06 33 224 206 92.4
Calgary Flames                 30 09 06 32 208 206 89.8
--------------------------------------------------------
Winnipeg Jets                  29 03 04 41 226 243 83.6
Dallas Stars                   27 04 02 43 207 240 78.7
Los Angeles Kings              23 11 06 36 183 185 75.3
Vancouver Canucks              19 07 06 44 169 221 61.9
Arizona Coyotes                17 04 08 48 176 245 55.6
Colorado Avalanche             14 06 01 55 150 257 49.0

Naturally, they would not be the same standings if the system were indeed implemented, but why not to take a look. And once again, try it in the AHL first, it won't hurt anyone.

Sunday, March 12, 2017

On Buchholz and Sonneborn-Berger coefficients.


The practice of chess tournaments provides two traditional metrics that are used to rank participants beyond their mere scoring. Their names are the Buchholz coefficient and the Sonneborn-Berger coefficient (often called just Berger). They are frequently used as tie-breakers in chess events, however I arrived to completely different application for them for the National Hockey League seasons.

1. The Buchholz coefficient

The Buchholz coefficient is simply the sum of the points of your opponents.

B = Σn=1N Pn

So, if you played five games, and your opponents currently have 5, 3, 8, 6 and 6 points, your Buchholz value will be 28. Please note, that the current number of points is always used, not the number of points at the moment of meeting. The outcome of the game does not matter (for that one see the Sonneborn-Berger).

At first, the usefulness of such a criteria would prompt a raise of the eyebrow. However, it's not used in round-robin all-play-all tournaments as a final tie-break, because, naturally, the coefficient would be the same for all tied parties. It's used in a special format of chess events called the Swiss Tournament, not very popular outside of the realm of board games for purely logistic reason. But then, consider, first, an NFL season. The list of opponents every team plays there over the 16-game season may be quite different. And, whoever would end up with a larger Buchholz coefficient, clearly would've had stronger opposition on the way.

Now let's go back to hockey. First of all, at the end of the season, although everyone has played everyone, they did so a different number of times. Thus, the sum of opponents' points at the end of the season could be different between teams - including within the same division, if they had a different schedule. So, this could still be a very valid tiebreak. Secondly, the season is so long (82 games, unlike a chess Swiss which is rarely longer than 11 rounds), and that gives us a lot of midway points in time, when the all-play-all has not been completed yet! Here the Buchholz coefficient can clearly show, who has had the stronger opposition up until a certain moment.

Then, if we look at the remainder of the schedule for each team, and for every game we add the opponent's points we get an excellent remaining schedule strength estimator.

Wait... there's a caveat.

Unlike in a chess tournament, where every round occurs for everyone at the same time, and barring very rare circumstances, every participant played an equal amount of games at any point of the tournament, there may be a significant difference in the number of games played by different teams, so summing the opponents up will not work very well. And these opponents also played a different number of games, so their total amount of points is not a very good indicator.

Fortunately, it's not a big deal. Instead of totals, let's operate with per-game numbers. So the NHL Buchholz Coefficient for a team after N games becomes:

B = (Σn=1PPGn)/N. 

Same applies for the remaining schedule strength, where the per-game numbers of the remaining opposition are summed an averaged.

So, if the team played three games against opponents who currently are:
A) 6 points in 4 games, B) 3 points in 3 games, C) 2 point in 5 games, then the team's Buchholz value would be (6/4 + 3/3 + 2/5) / 3 = 2.9/3 ~ 0.967pts.

Here are the current (Mar 12th 2017) Buchholz coefficients and remaining schedule strengths for the entire 30 times (and note how the Blues stand out with plenty of matchups vs Colorado and Arizona remaining).

+-----------------------+-----------+-------+-------+
| Team Name             | PPG       | Buch  | RStr  |
+-----------------------+-----------+-------+-------+
| Washington Capitals   | 1.4179105 | 1.119 | 1.133 |
| Pittsburgh Penguins   | 1.4029851 | 1.117 | 1.127 |
| Minnesota Wild        | 1.3939394 | 1.090 | 1.070 |
| Columbus Blue Jackets | 1.3731343 | 1.125 | 1.132 |
| Chicago Blackhawks    | 1.3283582 | 1.088 | 1.096 |
| San Jose Sharks       | 1.2985075 | 1.106 | 1.106 |
| New York Rangers      | 1.2941176 | 1.120 | 1.184 |
| Ottawa Senators       | 1.2537313 | 1.105 | 1.169 |
| Montreal Canadiens    | 1.2352941 | 1.122 | 1.097 |
| Edmonton Oilers       | 1.1791044 | 1.121 | 1.040 |
| Anaheim Ducks         | 1.1764706 | 1.102 | 1.150 |
| Calgary Flames        | 1.1764706 | 1.099 | 1.140 |
| Boston Bruins         | 1.1470588 | 1.115 | 1.151 |
| Toronto Maple Leafs   | 1.1343284 | 1.114 | 1.150 |
| Nashville Predators   | 1.1323529 | 1.105 | 1.116 |
| St. Louis Blues       | 1.1194030 | 1.144 | 0.943 |
| New York Islanders    | 1.1194030 | 1.142 | 1.103 |
| Tampa Bay Lightning   | 1.0895522 | 1.121 | 1.134 |
| Los Angeles Kings     | 1.0746269 | 1.118 | 1.104 |
| Philadelphia Flyers   | 1.0447761 | 1.122 | 1.179 |
| Florida Panthers      | 1.0298507 | 1.118 | 1.175 |
| Carolina Hurricanes   | 1.0000000 | 1.138 | 1.136 |
| Buffalo Sabres        | 0.9855072 | 1.127 | 1.158 |
| Winnipeg Jets         | 0.9565217 | 1.110 | 1.143 |
| Vancouver Canucks     | 0.9558824 | 1.115 | 1.152 |
| Dallas Stars          | 0.9552239 | 1.119 | 1.100 |
| Detroit Red Wings     | 0.9545455 | 1.151 | 1.059 |
| New Jersey Devils     | 0.9117647 | 1.148 | 1.132 |
| Arizona Coyotes       | 0.8358209 | 1.133 | 1.098 |
| Colorado Avalanche    | 0.6119403 | 1.128 | 1.164 |
+-----------------------+-----------+-------+-------+

In tne next installment we're going to talk about the application of the Sonneborn-Berger coefficient to the NHL regular season.


Thursday, February 16, 2017

Another rule change suggestion

Better less, but better
V.I. Lenin

I've got another rule change suggestion, this one even simpler:

Allow teams to decline penalty shot awards in favor of a regular power-play.

I think it adds more tactical variety to the game and discourages penalties on breakaways that are worse in penalty shooting.

As a side matter, I think: a player who is charged with the offense after which the penalty shot is awarded should still be added a minor penalty (2 minutes) in the statistics.

Wednesday, February 1, 2017

A rule change suggestion

There's no irreplaceable people.
I.V. Stalin

Rushing this one up, because this idea already came to my mind before, but I forgot about it. The age is taking its toll.

Anyways. Everyone is talking these days about rule changes. I've already expressed a few thoughts on the scoring systems, but I am not original there. Now, however, I want to make a suggestion I haven't seen mentioned yet.

Allow soccer (baseball, too)-like substitutions in hockey. Allow the coaches to replace players in the original lineup at the start of the game with one of the "healthy scratches", as submitted in the roster sheet, like the one Peter DeBoer recently messed up in the game against Edmonton.

The substitution goes ONE-WAY. That means that the player that was substituted cannot return to the game. The substitutions may occur:

  • During the intermissions
  • During the commercial breaks
  • During a time-out
First and foremost this will allow teams to handle early injuries much better. Your D-man got injured at the 7:04 mark of the 1st period? Around 10:00 there will be a commercial break, you can substitute him with one of the scratches!

Second, it may allow coaches to send stronger messages to players they deem slacking. Rather than shorten the roster by benching that guy, you can send an eager healthy scratch in. Of course, then the "slacking" player is benched for the whole remainder of the game.

Third (oh, I did military service, so I have a natural obsession of providing three reasons for each thing), it may give the coaches some extra flexibility if a designated roster player gets slightly injured in the warm-ups. Then a scratch takes his place as usual, but if the original player is fixed by the 1st intermission, he can substitute the starting scratch.

The substitutes will have to come from the "scratch" list with the exception of the emergency goaltending contracts.

Oh, and I am sure the NHL website will make a mess out of it in their game reports.

Tuesday, January 17, 2017

On Players Evaluation - Part VII and Final (Bundling it all up)



Now that we obtained a way to estimate players' performances for a season, we can move on to estimate their performances for a specific game.

For the season of interest, we compute the average against for each teams, just like we computed the season averages. I.e. we calculate how many goals, shots, hits, blocks, saves are made on average against each team. Thus we obtain the team against averages Tavg. The averages are then further divided by the number of skaters and goalies (for respective stats) the team had faced.

After that we can calculate the "result" Rt of each season average stat in a chess sense, i.e. the actual performance on the scale from 0 to 1:
For Goalie Wins/Losses:

Rtwins = 0.5 + Tavgwins/(Tavgwins+Tavglosses)

For Plus-Minus:

Rt+/- = 0.5 + (Tavg+/- - Savg+/-) / 10 (10 skaters on ice on average)

For the rest:

Rstat = 0.5 + (Tavgstat - Savgstat) / K

where K is a special adjustment coefficient that is explained in part VI (and, as we remind, describes the rarity of each event)

And from the result Rt we can produce teams' Elo against in each stat, just like we computed the players' Elos.

Then, the expected result Rp of a player against a specific team in a given stat is given by:

Rp = 1/(1 + 10(Et - Ep)/4000)

where Et is the team's Elo Against and the Ep is the player's Elo in that stat.

From the expected result Rp, we can compute the expected performance Ep just like in the previous article:

Pexp = (Rp - 0.5) * A * Savg + Savg

(See there exceptions for that formula).

Please note that we do not compute "derived" stats, i.e. the number of points (or SHP, or PPP), or the GAA, given the GA and TOI, or GA, given SA and SV.

Thus, if we want to project expected result of a game between two teams, since it's the expected amount of goals on each side, we compute the sum of the expected goals by each lineup (12 forwards and 6 defensemen):

Shome = SUMF1..12(MAX(PexpG)) + SUMD1..6(MAX(PexpG)) for the home team
Saway = SUMF1..12(MAX(PexpG)) + SUMD1..6(MAX(PexpG)) for the away team

while filtering the players that are marked as not available or on injured reserve. Please note that we assume the top goal-scoring cadre is expected to play, if we knew the lineups precisely, we would substitute the exact lineup for the expected one.

You can see the projections at our Daily Summary page. So far we predicted correctly the outcome of 408 out of 661 games, i.e. about 61.7% . Yes, we still have a long way to go.

Now to the different side of the question. Given that a player expectation overall is a vector of [E1, E2, ... En] for all the stats, what is the overall value of that player. And the answer is, first and foremost, who's asking.

If it's a statistician, or a fantasy player, then the value V is simply:

V = SUM1..n(WnEn)

where Wn are the weights of the stats in the model that you are using to compare players. Fantasy Points' games (such as daily fantasy) are even giving you the weights of the stats - this is how we compute our daily fantasy projections.

Now, if you're a coach or a GM asking, then the answer is more complicated. Well, not really, mathematically wise, because it's still something of a form

V = SUM1..n(fn(En))

where fn is an "importance function" which is a simple weight coefficient for a fantasy player. But what are these "importance functions"?

Well, these are the styles of the coaches, their visions of how the team should play, highlighting the stats of the game that are more important for them. These functions can be approximated sufficiently by surveying the coaches and finding which components are of a bigger priority to them, for example, by paired-comparison analysis. Unfortunately, there are two obstacles that we may run into: the "intangibles", and the "perception gap".


But that's a completely different story.

Wednesday, January 11, 2017

On Players Evaluation - Part VI (Skater's [and Goaltender non-SVP] Elo)



The most important conclusion of the last chapter that dealt with goalies' Elos is that it is defined by actual performance of a goaltender versus the expected performance of the team he is facing. That is the approach we are going to inherit for evaluating skaters.

For the start we compute the average stats of a league for each season. We do that for most of the stats that are measured, from goals and assists to faceoffs taken, up to the time on ice for the goaltenders. This is a trivial calculation. Thus we obtain season stat averages Savg.

Now we can begin to work with the skaters. We assign them a rating of 2000 in each stat. The first and the most difficult step is to coerce the actual performance of a skater in each stat to a chess-like result, on the scale from 0 to 1. This is a real problem, since the result distribution for the number of players looks something like one of these chi-squares:


Therefore we need to rebalance it somehow while preserving the following rules:
  • They should be more or less distributive, i.e. scoring 1 goal thrice in a row in a game should produce approximately the same performance as scoring a hat trick in one game and going scoreless in the other two.
  • They should still have the same shape as the original one.
  • The average rating of the league in each stat should remain 2000 at the end of the season.

So first, we do not apply rating changes after a single game. We take a committing period, for example, five games, and average players' performance in every rated stat over that period. Second, we apply the following transformation to the performance:

P'player = (Pplayer - Savg) / Savg

where Savg is the season average on that stat. It could be more precise to compute against the averages against of the teams played (see the first paragraph), but we decided to go via a simpler route at this stage.

Then we scale the performance by the Adjustment Factor A:

P'playeradj = P'player / A

The adjustment factor sets the result between -0.5 and 0.5. More or less. There still are outliers, but they are very infrequently beyond 0.5 . The A factor depends on the rarity of the scoring in the stat and varies from 6 (Shot on Goal) to 90 (Shorthanded goal). The adjustment for goals, is, for example, 9. The adjustment for faceoffs won is 20. The latter one might look a bit surprising, but remember that many players do not ever take faceoffs, e.g. defensemen. Naturally, only skaters stats are computed for skaters, only goalie stats for goaltenders.

The final Result Rplayer is then:
Rplayer = P'playeradj + 0.5

So for the rare events we have a lot of results in the 0.48-0.5 area and a few going to 1. For the frequent events (shots, blocks, hits), the distribution is more even.

Now that we got the player's "result" R, we can compute the elo change through the familiar formula:

ΔElo = K * (R - (1/(1+10(2000 - Eloplayer)/400)))

where K is the volatility coefficient which we define as:

16 * √(A) * √(4 / (C + 1))

A is the aforementioned Adjustment Factor and C is the Career Year for the rookies (1) and the sophomores (2), and 3 for all other players.

'What is 2000', an attentive reader would ask? 2000 is the average rating of the league in each stat. We use, because the "result" of the player was "against" the league average. If we used team averages, we would put the average "Elo against" of the teams faced instead.

After we have the ΔElo, the new Elo' of a player in a specific stat becomes:

Elo' = Elo + ΔElo

And from that we can derive the expected average performance of a player in each stat, per game:

Rexp = 1/(1+10(2000-Elo')/400)
Pexp = (Rexp - 0.5) * A * Savg + Savg

which is an "unwinding" of the calculations that brought us from the actual performance to the new rating.

The calculation differs for the three following stats:

  1. SVP - processed as described in Part V.
  2. Win/Loss - processed as a chess game against a 2000 opponent, where the result is:
Rw = Pw/(Pw+Pl), Rl = Pl(Pw+Pl)
over the committing period.
The only subtlety here is that sometimes a hockey game may result in goalie win without a goalie loss.
  1. PlusMinus -
R+/- = 0.5 * (P+/- - Savg+/-) / 10 (10 skaters on ice on average)

Then, via the regular route we get the Elo' and the expected "result" Rexp, and the expected performance is:
Pexp+/- = (Rexp+/- - 0.5) * 10 + Savg+/-

Please note that we do not compute "derived" stats, i.e. the number of points (or SHP, or PPP), or the GAA, given the GA and TOI, or GA, given SA and SV.

An example of the computed expected performances that lists expectations of top 30 Centers in Assists (Adjustment Factor 9) can be seen below:

# Player Pos Team Games A a/g Avg. g. Avg.a  E a/g  E a/fs
1 CONNOR MCDAVID C EDM 43 34 0.791 44.00 33.00 0.706 61.54
2 JOE THORNTON C SJS 41 24 0.585 74.11 52.00 0.665 51.27
3 NICKLAS BACKSTROM C WSH 40 24 0.600 69.20 50.10 0.663 51.85
4 EVGENI MALKIN C PIT 39 27 0.692 62.09 44.73 0.659 55.33
5 SIDNEY CROSBY C PIT 33 18 0.545 61.67 51.50 0.655 46.15
6 RYAN GETZLAF C ANA 36 25 0.694 68.58 45.42 0.648 50.26
7 EVGENY KUZNETSOV C WSH 40 22 0.550 54.75 27.75 0.605 47.43
8 ANZE KOPITAR C LAK 36 16 0.444 72.73 41.55 0.594 40.33
9 ALEXANDER WENNBERG C CBJ 40 28 0.700 59.00 25.67 0.583 52.50
10 CLAUDE GIROUX C PHI 43 25 0.581 61.70 37.60 0.579 47.56
11 TYLER SEGUIN C DAL 42 26 0.619 66.86 31.14 0.566 48.65
12 RYAN O'REILLY C BUF 30 16 0.533 66.00 26.38 0.553 39.23
13 DAVID KREJCI C BOS 44 18 0.409 60.64 32.36 0.528 38.05
14 RYAN JOHANSEN C NSH 41 22 0.537 65.33 27.00 0.523 43.43
15 JOE PAVELSKI C SJS 41 23 0.561 69.64 29.09 0.517 44.21
16 HENRIK SEDIN C VAN 43 17 0.395 75.56 47.81 0.517 37.17
17 DEREK STEPAN C NYR 42 22 0.524 68.00 30.86 0.508 42.31
18 VICTOR RASK C CAR 41 19 0.463 67.00 22.67 0.497 39.37
19 MARK SCHEIFELE C WPG 40 20 0.500 44.50 17.83 0.493 39.23
20 JASON SPEZZA C DAL 35 18 0.514 62.71 37.79 0.490 37.60
21 JOHN TAVARES C NYI 38 16 0.421 68.50 35.00 0.488 37.46
22 MITCHELL MARNER C TOR 39 21 0.538 39.00 21.00 0.484 41.82
23 STEVEN STAMKOS C TBL 17 11 0.647 65.11 29.00 0.474 29.97
24 ALEKSANDER BARKOV C FLA 36 18 0.500 56.75 21.00 0.463 36.51
25 MIKAEL GRANLUND C MIN 39 21 0.538 55.80 24.40 0.460 40.80
26 PAUL STASTNY C STL 40 13 0.325 65.09 34.55 0.457 31.74
27 JEFF CARTER C LAK 41 15 0.366 69.67 24.33 0.448 33.35
28 MIKE RIBEIRO C NSH 41 18 0.439 62.88 33.06 0.447 36.32
29 MIKKO KOIVU C MIN 39 16 0.410 66.83 34.25 0.445 35.14
30 ERIC STAAL C MIN 39 22 0.564 74.46 36.77 0.442 40.99

You can see more of such expectation evaluations on our website, http://morehockeystats.com/fantasy/evaluation .

Now, we ask ourselves, how can we use these stats evaluations to produce an overall evaluation of a player?


To be concluded...