Tuesday, February 20, 2018

A Lemma Research - Penalty Box and TOI - Part II

Part I

After completing the first part of the lemma research - penalty box - the second part was shorter, easier, but just as useful. I decided to find out the share of time teams spend on average while at even strength, on power play/shorthanded and with empty net. Then given this number, and the number of goals scored in each such situation, I was able to calculate the frequency of EVG/PPG/SHG/ENG or the reverse of it which I called the difficult of such goal.

I scanned the database of all games between the 1999/00 season and today, and all the goals extracted from these games. Penalty shot goals were ignored, regardless if during the game itself, or in post-game shootout. The EN time was calculated as total game time minus goaltender TOI. PP/SH time was deducted from the recorded PP TOI of the players. The EV time would naturally become the total game time minus EN minus PP of both teams.

Then I calculated the difficulty of scoring a goal in each of these situations through the following formula:


where the difficulty of the EV goal is considered "1". Here are the combined results of the difficulties in a table:
1999 1.000 0.502 3.506 0.162
2000 1.000 0.473 3.387 0.146
2001 1.000 0.492 3.635 0.153
2002 1.000 0.468 3.585 0.167
2003 1.000 0.445 3.127 0.221
2005 1.000 0.535 4.247 0.272
2006 1.000 0.506 4.000 0.228
2007 1.000 0.458 3.597 0.187
2008 1.000 0.438 3.745 0.183
2009 1.000 0.456 4.044 0.192
2010 1.000 0.450 3.517 0.177
2011 1.000 0.460 3.568 0.169
2012 1.000 0.430 3.890 0.169
2013 1.000 0.453 3.209 0.198
2014 1.000 0.427 3.564 0.171
2015 1.000 0.415 3.284 0.158
2016 1.000 0.419 3.252 0.178
2017 1.000 0.427 3.052 0.168

If you divide 1 by these values you can get the relative frequency of goals scored in each situation.

The dataset containing this data is available on the website, on the Request Analysis page.

So why did I need these two lemmas? That blog post won't be ready any time soon, and I better resume the "Page A Day series'.

Monday, February 19, 2018

A Lemma Research - Penalty Box and TOI

Nothing derails from the regular blogging like a research that you've been so eager to start, but were putting off to finish simpler and more materialistic stuff, but then you couldn't hold it off any longer.

But then, I realized that in order to do that research I need to perform a lemma research. Just like its mathematical namesake, a lemma research is one that is done for the sake of a bigger one, yet producing a useful result by itself.

So I noticed that I needed the penalty box data. Who was in the penalty box during a power play goal? More specifically, who was responsible for that goal, i.e. who left the penalty box as the result (or had a non-matched 5-minute major penalty during it). Once there was a feed that had penalty box data, but it was only since 2010 or so, and it seems to have become discontinued. Therefore I gathered the game data I already had and just went through the power play goals from 1987/88 through now, and tried to match them with penalties, while weeding out all the cancelling and all the irrelevant (e.g. misconduct) ones.

I am glad to tell that I was able to create a consistent, at least at first look, dataset. But before that I had to go in and correct penalty box entries for about 160 goals manually. About 35 of them were just forced to enter the penalty data manually, because any algorithm assigning the player in the box to the goal would be ambiguous. However I also discovered about 125 goals (120 pre 1999/00, when extra reports were introduced, and only five since) that should not even be marked as power play goals. There was no matching penalty. Of course, the mistake can be on the penalty data in the NHL report: the time of the penalty may be reported wrongly. But until further notice, these goals should not be considered PPG:

GameID P Time Scorer Team
198720125 3 9:19 BOB SWEENEY Boston Bruins
198720134 3 18:58 RICK TOCCHET Philadelphia Flyers
198720239 1 1:23 STEPHANE RICHER Montreal Canadiens
198720367 1 4:51 DALE HAWERCHUK Winnipeg Jets
198720388 1 17:46 TROY MURRAY Chicago Blackhawks
198720389 3 3:55 PAUL MACLEAN Winnipeg Jets
198720431 2 6:56 PETER TAGLIANETTI Winnipeg Jets
198720449 2 12:34 MIKKO MAKELA New York Islanders
198720471 3 10:51 ANTON STASTNY Quebec Nordiques
198720484 2 13:38 MARIO LEMIEUX Pittsburgh Penguins
198720528 1 6:32 CHARLIE SIMMER Pittsburgh Penguins
198720610 3 3:08 LAURIE BOSCHMAN Winnipeg Jets
198720735 3 8:10 MIKE FOLIGNO Buffalo Sabres
198720755 1 3:06 GARRY GALLEY Washington Capitals
198720755 2 0:29 GERALD DIDUCK New York Islanders
198720787 1 17:02 AARON BROTEN New Jersey Devils
198720799 2 0:49 JIMMY CARSON Los Angeles Kings
198720802 2 3:24 MIKE FOLIGNO Buffalo Sabres
198720804 1 18:03 PAT VERBEEK New Jersey Devils
198730134 1 7:52 BRUCE DRIVER New Jersey Devils
198730223 3 9:47 MARK JOHNSON New Jersey Devils
198730314 2 12:31 CAM NEELY Boston Bruins
198820088 2 6:17 RANDY MOLLER Quebec Nordiques
198820088 2 7:11 ANTON STASTNY Quebec Nordiques
198820147 1 15:58 JOHN CULLEN Pittsburgh Penguins
198820150 2 2:29 KEVIN DINEEN Hartford Whalers
198820203 3 12:45 JOE MULLEN Calgary Flames
198820241 2 18:53 DAN QUINN Pittsburgh Penguins
198820307 3 10:12 MARIO LEMIEUX Pittsburgh Penguins
198820318 2 5:24 GAETAN DUCHESNE Quebec Nordiques
198820331 3 7:36 PAUL GAGNE Toronto Maple Leafs
198820489 1 16:20 DALE HUNTER Washington Capitals
198820542 1 18:13 DOUG EVANS St. Louis Blues
198820727 3 7:49 PAUL MACLEAN Detroit Red Wings
198820803 2 6:58 DOUG SMITH Vancouver Canucks
198820821 3 17:43 BRENT FEDYK Detroit Red Wings
198920146 1 5:14 KEVIN DINEEN Hartford Whalers
198920158 1 5:26 TROY MURRAY Chicago Blackhawks
198920220 2 15:53 NEAL BROTEN Minnesota North Stars
198920238 1 2:39 GREG PASLAWSKI Winnipeg Jets
198920303 2 4:55 PAT ELYNUIK Winnipeg Jets
198920475 3 8:25 BRIAN MULLEN New York Rangers
198920543 3 18:46 AL MACINNIS Calgary Flames
198920667 1 3:04 JEREMY ROENICK Chicago Blackhawks
198920749 1 8:18 CRAIG JANNEY Boston Bruins
198920818 2 1:25 JOHN OGRODNICK New York Rangers
198930231 2 13:43 TRENT YAWNEY Chicago Blackhawks
198930322 2 18:01 JARI KURRI Edmonton Oilers
199020005 3 19:54 RAY SHEPPARD New York Rangers
199020056 1 15:44 DAVE TAYLOR Los Angeles Kings
199020262 2 11:20 BOBBY HOLIK Hartford Whalers
199020612 3 7:18 JOHN CHABOT Detroit Red Wings
199020636 1 15:02 BRIAN LEETCH New York Rangers
199020647 2 9:16 KENNETH JR HODGE Boston Bruins
199020704 2 12:47 KELLY KISIO New York Rangers
199020716 3 0:34 JOE SAKIC Quebec Nordiques
199020762 2 5:16 MARK RECCHI Pittsburgh Penguins
199020815 2 19:28 KEVIN STEVENS Pittsburgh Penguins
199030222 3 2:17 DINO CICCARELLI Washington Capitals
199030235 3 14:04 BRIAN PROPP Minnesota North Stars
199120059 3 2:20 DOUG GILMOUR Calgary Flames
199120070 2 10:26 DAVE GAGNER Minnesota North Stars
199120093 3 18:48 DARREN TURCOTTE New York Rangers
199120238 3 0:18 PAUL RANHEIM Calgary Flames
199120313 3 11:52 JEREMY ROENICK Chicago Blackhawks
199120407 1 10:39 BOBBY CARPENTER Boston Bruins
199120504 2 18:42 JIMMY CARSON Detroit Red Wings
199120617 2 16:43 MARTY MCSORLEY Los Angeles Kings
199120625 3 18:17 TODD ELIK Minnesota North Stars
199120638 1 13:15 GREG ADAMS Vancouver Canucks
199120755 3 10:48 DOUG GILMOUR Toronto Maple Leafs
199130143 3 13:57 AL IAFRATE Washington Capitals
199220002 2 5:17 SCOTT STEVENS New Jersey Devils
199220013 1 12:08 RICK TOCCHET Pittsburgh Penguins
199220023 2 17:32 MARIO LEMIEUX Pittsburgh Penguins
199220068 2 17:22 MIKE GARTNER New York Rangers
199220091 3 19:34 JOE JUNEAU Boston Bruins
199220121 1 6:14 MIKE GARTNER New York Rangers
199220149 2 18:44 CHRIS KONTOS Tampa Bay Lightning
199220181 3 6:21 ULF DAHLEN Minnesota North Stars
199220287 1 16:56 CHRIS KONTOS Tampa Bay Lightning
199220337 2 5:42 ALEXANDER MOGILNY Buffalo Sabres
199220388 1 15:45 GREG HAWGOOD Edmonton Oilers
199220401 2 12:48 JEFF NORTON New York Islanders
199220562 3 9:19 CHRIS KONTOS Tampa Bay Lightning
199220563 1 9:25 TEPPO NUMMINEN Winnipeg Jets
199220589 3 9:18 ROD BRIND'AMOUR Philadelphia Flyers
199220595 1 7:20 CRAIG JANNEY St. Louis Blues
199220908 2 16:28 VALERI KAMENSKY Quebec Nordiques
199220986 1 15:44 JIRI SLEGR Vancouver Canucks
199320065 1 15:37 DENIS SAVARD Tampa Bay Lightning
199320092 3 11:22 SERGEI FEDOROV Detroit Red Wings
199320636 1 16:40 TIM SWEENEY Mighty Ducks Of Anaheim
199320643 3 16:50 MARTIN LAPOINTE Detroit Red Wings
199320740 2 7:53 KEITH TKACHUK Winnipeg Jets
199320840 1 17:17 SERGEI ZUBOV New York Rangers
199320905 3 18:16 KEVIN STEVENS Pittsburgh Penguins
199420025 2 1:32 KELLY BUCHBERGER Edmonton Oilers
199420072 2 7:27 STEVE THOMAS New York Islanders
199420087 1 9:52 KEITH TKACHUK Winnipeg Jets
199420332 2 2:35 GRANT LEDYARD Dallas Stars
199420332 2 7:11 RAY SHEPPARD Detroit Red Wings
199520189 2 15:41 LUC ROBITAILLE New York Rangers
199520226 3 17:34 CHRIS GRATTON Tampa Bay Lightning
199520490 2 9:41 TODD BERTUZZI New York Islanders
199520539 3 13:25 MARK MESSIER New York Rangers
199520560 1 9:03 VYACHESLAV KOZLOV Detroit Red Wings
199520694 3 15:43 RON FRANCIS Pittsburgh Penguins
199520744 2 6:41 SCOTT MELLANBY Florida Panthers
199520750 2 9:05 NICKLAS LIDSTROM Detroit Red Wings
199520766 1 16:00 BENOIT HOGUE Dallas Stars
199520776 2 5:53 MARIO LEMIEUX Pittsburgh Penguins
199520809 1 12:47 ADAM GRAVES New York Rangers
199520847 2 16:40 KEITH PRIMEAU Detroit Red Wings
199620127 3 12:03 ALEXEI ZHAMNOV Chicago Blackhawks
199620211 2 13:08 GREG ADAMS Dallas Stars
199620466 3 14:50 JOZEF STUMPEL Boston Bruins
199620792 1 11:50 BRENDAN SHANAHAN Detroit Red Wings
199621058 2 1:41 MARTIN GELINAS Vancouver Canucks
199720028 2 18:01 TREVOR LINDEN Vancouver Canucks
199720067 3 16:29 TERRY YAKE St. Louis Blues
199920756 1 6:46 JAMIE LANGENBRUNNER Dallas Stars
200520486 1 17:28 ROB COLLINS New York Islanders
200620150 1 7:59 NATHAN HORTON Florida Panthers
200620627 1 5:00 RYANE CLOWE San Jose Sharks
200821010 1 16:44 MIKAEL SAMUELSSON Detroit Red Wings
201620276 2 12:03 JOHAN LARSSON Buffalo Sabres

The resulting penalty box data is available on our website, in the Request Analysis section.
Hopefully, tomorrow, I'll blog about another useful dataset the lemma research has produced.

Monday, February 5, 2018

The Website - A Page A Day, Part V - Rink Repairs

Part I
Part II
Part III
Part IV

Well, the pace didn't last long, but we're back with Part V - Rink Repair Statistics

Probably, this is the least hockey related page of the website, but hey, we can do it, and it's actually pretty easy, so why not?

The STOP events as listed in the Play-By-Play HTML summaries since the 2002/03 season on the NHL.com website contain the reason(s) for the stop. While most of them are game-based, such as ICING or OFFSIDE, one of the more rare ones caught our eye: RINK REPAIR. We decided to collect these stops and rank NHL home teams as well as NHL arenas by the amount of rink repairs that happened. We filter out the occasional venues, such as outdoor stadiums for NHL special events or the foreign arenas for the European showdown games.

Since we already parse practically all events from the Play-By-Play summaries (or PL), and classify them by types, we already have a collection of STOP events. And we also detect and catalog the reasons for the stoppages, so it is an easy Mongo query to extract all rink repairs incurred. We then aggregate them by locations and teams, and create SQL tables for easy quick display of the data.

And so we were able to assemble a nice set of tables displaying the level of maintenance in the rinks around the league. Here's a look at the 2016/17 season:

Arena Repairs
So the claims that the Islanders' current home has the worst ice has been substantial. For the last three years, actually, Barclays Center ranks among highest. Naturally, the old arenas like Canadian Tire Centre or Rexall Palace also seemed to get a lot of rink repairs during the games.
You can switch the year of the display or the mode between 'By Team' and 'By Arena'.
As with all the displayed tables on our site, there are links below it to see it in a pristine form, the direct link to the page for the selected season, and buttons to share it on Twitter and Facebook.
Once again, it doesn't seem like a highly meaningful piece of work, but we consider it fun, and it took about quarter an hour to implement altogether.
  • Aggregate show by a period rather than a single season
  • Include arena ages (requires manual input of construction years)

Friday, January 26, 2018

The Website - A Page A Day, Part IV - West vs. East

Part I
Part II
Part III

And now we're putting two in a row with West vs. East.


This page shows the results of games between Eastern and Western Conference teams. The data is available from the year 1993, when Western and Eastern Conference were formed, from the Boxscore files.

Shown from left to right:
  • Regular West wins
  • OT/SO West wins
  • Ties(up to year 2005)
  • OT/SO East wins
  • Regular East wins
  • Stanley Cup Winning Conference
A total tally is available as well. As of the date of this post the standings are:
WEST 2802 Reg. W - 595 OTW - 444 T - 541 Reg. W - 2570 Reg. W EAST
West holds a formidable lead which eroded a bit in the 2015/16 and 2016/17 seasons. Before that the last time East won the count was back in 1998/99! The 2009/10 was the most lopsided season with the final score of 155-115 in West's favor.
West won 14 times, East - 6. Once, in 2011/12 there was a tie with 134 wins apiece.

The Stanley Cup winners are divided more evenly, however, with West holding the edge 13-10.

There is no data for seasons 1994/95, 2004/05 and 2012/13 because of full or or partial season lockout. Also, the win-loss count from the Finals are not included.

If you are an experienced Webmaster, especially with Javascript and CSS we would greatly appreciate the potential tidy-up and enrichment you could provide to these graphs. Your work will be credited for future reference! Write to us, or get in touch with us on Twitter. Thanks!

Possible future additions:
  • Season aggregation
  • More compact design
  • Your ideas are welcome!

Thursday, January 25, 2018

The Website - A Page A Day, Part III - NHL's Yearly Tendencies

Part I
Part II

Despite all the delays we move on to League's Yearly Tendencies.


This view shows stacked bars of various event counts per season in the NHL.All the stats are presented per game, since the amount of games played varied every season.

For the first time we encounter the stat selection menu, on top of the graphs. On this page it features the following options:

  • Category of the stats
  • Stage of the games (Regular or Playoff)

Available stats are:
  • Shots
    • Goals (available since 1987, from Boxscore reports)
    • Shots on Goal (available since 1987, from Boxscore reports)
    • Misses (available since 2005, from PBP reports)
    • Blocks (avaliable since 2005, from PBP reports)
  • Icings (available since 2002, from PBP reports)
  • Margin of victory (available since 1987, from Boxscore reports)
  • Penalties
    • Minor
    • Major
    • Fighting
    • Misconduct
    • Match Penalty
  • Goals per Game
The stats are available for regular season, playoffs and both stages combined.

The PBP reports from the NHL dating before 2005 are wildly inconsistent, thus we didn't use them for MISSES and BLOCKS.

We are using the wonderful d3js library for producing these graphs.

If you are an experienced Webmaster, especially with Javascript and CSS we would greatly appreciate the potential tidy-up and enrichment you could provide to these graphs. Your work will be credited for future reference! Write to us, or get in touch with us on Twitter. Thanks!

Possible future additions:
  • PowerPlay success
  • Minor penalty breakdown
  • Aggregations and overlays
  • Mouse graph manipulations
  • Your ideas are welcome!

Tuesday, January 16, 2018

The Website - A Page A Day, Part II - The League section and the Daily Summary

Part I

It looks like it's time to resume our Website - A Page A Day series.


The first section available on our website is the League section. It contains pages either describe statistics applicable to the entire league, rather than to a specific team, player or coach, such as, for example, the West vs East account, or the statistics go across different categories, for instance, the Warm Welcome page that is applicable to the teams as we as the goaltenders.

We'll start with the first page of this first section - the Daily Summary.

This page looks like most of the data pages of this website:

  • A menu on the top (we remove the game ticker to lighten the pages)
  • A section navigation on the left
  • Main data pane on the right, featuring graphs and tables
  • A utility menu on the bottom.

This page features the summaries applicable for today's games. This page is planned very much like an ever going work in progress, but currently only two items are featured:

The historic tally of today's coaches against each other

Our database features games from the season 1987/88 through current. Our statistics account for these games in the last 30+ years. This is usually sufficient to cover all active coaches' encounters. However we plan to integrate the remaining seventy years, from 1917 to 1986, as they became available from NHL.

The predictions for today's games by our model

We display the matches for the day where we calculate the expected number of goals by each team against its opponent, and derive the probability of a win from these expected scores.

As the rosters become available for the upcoming games, we adjust our prediction by these rosters, otherwise best-scoring rosters are used. This may change in the future. The predictions by the published rosters are marked by asterisks.

Beneath the table there is a set of useful links:

  • 'Table' link that produces a pristine, unstyled table in a separate frame for easy re-use
  • 'Link' link that points at the table which is currently being displayed (this one is more useful for paged and/or filtered listings)
  • Tweet button that allows you to share this page on Twitter
  • Like button that allows you to like this page for Facebook
Possible future additions:
  • Historical browsing of previous predictions
  • Elaboration of the scoring components
  • Change in the win probability formula
  • Your ideas are welcome!

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!

Wednesday, January 10, 2018

The Website - A Page A Day, Part I - Home Page

The main page of the website shows the summary of all its features.

The site menu features the main statistical sections:

  • League - league-wide statistics
  • Teams - team-based statistics
  • Players - personal statistics
  • Coaches - statistics for the NHL coaches
  • Drafts - statistics for currently drafted players and the historical performance by draft
  • Fantasy - tools to help the fantasy player

On the top we have a ticker of the scores, as predicted by the model. The ticker is always scrolled to the current date, however you can navigate it back and forth using the two arrows at the edges. The away team is on the top, and the home team is on the bottom. The predicted score is in the Prdct column. The actual score is in the Act column. The projected winner is displayed in bold. If the prediction failed, the displayed teams will be painted red. We never adjust our predictions backwards. Only the scores for the current season are featured.

Then, on the top right we have three very important links that would help you with understanding the pages:

  • Learn More - about the methodology of the Website
  • Glossary - about the terms used in the pages
  • Blog - link to this blog which, as you see, also takes time to elaborate on the site.
We also display our latest addition to the website and the latest blog entry.

Then we have three random snippets in the columns. The snippets represent excerpts from the tables published elsewhere on the site and may change after each publication, which happens overnight. The snippets currently (hopefully they would become more diverse) are:
Only current season data is displayed in the snippets.
Below the random snippets we feature a permanent snippet that shows the best projected picks for the daily fantasy competitions. We provide a model-based evaluation of the expected score for players in the three most popular Daily Fantasy websites - Yahoo, FanDuel and DraftKings.

Below each snippet there is a link to the page with the full data.

At the bottom we have a collection of information links. Make sure you visit the Glossary and the About pages. The Links page has an ever-growing collection of hockey-related links. The Forum link leads to hockeyforums.net, the site we're partnering with - this blog is broadcast there as well. The Data section shows the software and the data sources this website is built with.

Hopefully this small introduction proves helpful and entices you to pay another visit to MoreHockeyStats, and to share this site with your friends. Follow us on Twitter, through the site or through this blog!

Tuesday, January 9, 2018

The Website - A Page A Day - Prologue

Hello, hockey world, from Mr. Van Winkle...

This prolonged silence was caused by a lot of factors, led, naturally, by REAL LIFE™. But I also made a fundamental mistake in the infrastructure setup, and so I had to roll out a hastily patched setup when the season was starting; I then went back and worked on this infrastructure fix, the work which continued over three months and is now complete! Unfortunately, all this work will not be visible to the visitor, with possible exception of a slightly faster page loading - all the changes belong to the back end.

But now, once again, with REAL LIFE™ limitations I am able to work on improving the website look, speed and features. I am being somewhat torn apart since I also need to hone the models I'm using, but I decided the models can wait with half of the hockey season gone by now. In addition I'll try to put an extra effort to promote the site and made it more visible on the Web.

One of the things I was not able to complete is to release my code as the open source. This has also been put into a bottom drawer. However, I still welcome cooperation very much and will gladly share the code with people who would want to contribute to the project. The areas I could really use some help are:
  • JavaScript/HTML/CSS
  • MongoDB query and database optimization
  • SEO optimization
So if you feel like helping - drop me a mail.

Also I will begin a series "Website - A Page A Day", where I plan to describe each and every statistical page on the site because I have a feeling I haven't been clear enough with the explanations until now; moreover it will help me discover errors and inconsistencies that probably crawled through.

So, stay tuned, here in this blog, on the website, and on Twitter!