James’ NHL Playoff Simulator

This is a NHL playoff simulation that is based upon the ELO method. I have several reservations about the ELO method, but nevertheless I thought it’d be fun to use it for a quick simulation. One way in which it is quite useful is that the absolute difference in the ELO ratings between two teams is related to their win probabilities when they play.

I previously wrote a shiny app for evaluate the change over the course of the regular season in ELO ratings. I took the final season ELO ratings from this app as the starting point of my simulation. The logical steps are as follows:


  1. Get initial ELO ratings based on regular season

  2. For each matchup get the win probability for each team based upon the difference in ELO ratings between the two teams

  3. Simulate each game, record the winner/loser, and update the ELO ratings of each team.

  4. Repeat steps 2-3 until one team in each matchup has four victories.

  5. Move on to the next rounds’ matchups repeating steps 2-4 for each matchup.


I then ran the above steps 1,000 times to be able to calculate the win probabilities of each team, how many games they would take to win the cup, etc. I could have run it for more simulations, but given the innacuracies that already exist in this method, and the slowness of the code I wrote (it was in a hurry) - 1000 is sufficient.


Code

The code for the simulation is on github.

Results


Win percentages



Number of Playoff Games Per Team





I had a quick look at the maximum games played by any teams in the playoffs. The Rangers had two instances of playing 27 games, 1 game short of four 7 game series. In the first simulation of this kind, they would beat Pittsburgh 4-3, then Washington 4-3, then Ottawa 4-3 and finally Winnipeg 4-2. In the other the results were the same but the teams were Pittsburgh, Islanders, Detroit, Chicago.



Last things

There are a few other things I’d like to do with this - particularly most common paths to the cup for each team. Also, if I could optimize the code, then I could run it each day following ‘known’ results to get updates on the predictions. If I was very keen, I could redo the simulations for different values of ‘kfac’ the constant in the ELO formula. I have set it at 15, but if it were higher it might represent ‘momentum’ or ‘volatility’. There is a suggestion that increasing it might well be more meaningful for the playoffs.