Simulating the 2017 AFL Mens season: Pre-season edition!

As I’ve indicated previously, I’ve finally cleared some time to get back into blogging! Sparked largely by a tweet from the fantastic The Arc blog, I’ve got some very preliminary season simulations together.

Continue reading “Simulating the 2017 AFL Mens season: Pre-season edition!”

Finals Week 2

Following a cracking weekend of finals football, I haven’t had the time I’d like to get this weeks results and predictions up. I also did find out that my simulation of finals script, that I’d hurriedly written back in about round 13 actually couldn’t handle real finals data being thrown at it. Nonetheless, the simulations of the remainder of the finals series are in, and I’ll combine it with my predictions later on in this post!

Continue reading “Finals Week 2”

Round 21 Ratings and Simulations – Hawks back to the pack

With a big upset loss on the weekend, the Hawks is the biggest loser from the weekend results. They have dropped back into the pack of clustered teams below our clear leaders and now face a possibility of losing top spot before the season is out.

New ratings

In fact – despite having a relatively good week for head to head tipping, our ELO model has shown some considerable adjustment to the rankings this week. This relates to some big upsets and misses in the margin, which we ultimately use to reassess our team ratings. We’ve seen 12 teams change places on our table (although only 5 of our top 8). The biggest changes come out of the Hawthorn/Melbourne and St Kilda/Carlton games.

In our top 8 race, Sydney and Adelaide have consolidated their grip as the clearly the two best rated teams. They have both opened up their lead on the remainder of the top 9 ranked teams apart from West Coast. In fact, Sydney would now start favourite against any team other than Adelaide regardless of the home ground advantage (HGA) boost (nominally set at 35 rating points). Adelaide is approaching that status, sitting 30 rating points above the next best side in Geelong.

plot of chunk unnamed-chunk-1

In the race for the worst team for the season, the Bombers have jumped above the Lions. The Lions have in fact edged close dropping below 1300 mark, which is almost 8 goals worse than an average team. In fact, only 12 teams in history have dropped below that ELO rating within a season. I promise I’ll write a post before the season is out about these two teams and where they sit in historical seasons but depending on how we measure ‘worst’ seasons by a team, they are on track to both finish within the worst 20.

Simulations

Onto our simulations, and I’ve finally got around to adding in some finals sims!

Firstly to our finals race, and we know have 5 teams that have clinched a finals spot. Two more teams (Bulldogs and WCE) will likely add to that list with a win this week, with only North Melbourne any realistic chance of dropping out. St Kilda improved their chances to jumping into the 8 to 17%, to be the most likely. They need to make up 2 games and percentage from the remaining 3 games to do that, but based on the relative strengths of the teams involved, we’d expect it to occur almost 1 in 5 times, so the excitement continues!
simTableR21
The top 4 race remains likely to come from 5 teams. The Hawks unexpected loss on the weekend sees their chances drop considerably but still remain at around 3 in every 4 sims. We actually give Geelong and Sydney more chances of making it, despite sitting 1 game behind the Hawks.

We see a similar distribution in top 2 chances, however interestingly  the Hawks are still our favourite to clinch the Minor Premiership, although their chances dropped from 67% down to 29% this week.

Finals Sims!

Our first set of finals simulations and we are again favouring the same 5 teams as our most likely premiers. Our predictions for the Prelim are very similar to our top 4 chances, with only GWS having less than a 64% chance of making it that far. In terms of the grand final, Sydney are our favourites to make it, reaching the final weekend in almost half of all simulations. They also win that match in about 1/4 of simulations, making them our premiership favourites.

It will be interesting to see how these finals simulations progress – as Hawks showed last week, an unexpected loss could change the picture dramatically!

plot of chunk unnamed-chunk-2

Round 20 ELO Simulations – almost set

ELO Ratings

After seeing Hawthorn take back top stop in our ELO ratings, they’ve quickly lost that due to a relatively poor result against Carlton. The loss of 10 rating points, combined with Sydney’s much larger than expected win, sees those two teams sway places. Combined with Adelaide, these three teams have emerged ahead of the pack. In a distant second tier we see GWS and Geelong, who also swapped places this week. Remarkably, Port Adelaide has climbed to 6th spot in our rankings despite almost being out of finals contention. Following Port, our remaining ‘above average’ teams are all struggling for various reasons in West Coast, North Melbourne and the Bulldogs.

plot of chunk unnamed-chunk-3

In our bottom 9 ‘below average’ sides, we don’t see too much movement as our order late in the season seems to have stabilised. Perhaps the biggest point of interest is just how bad the Brisbane Lions and Essendon are, with the relative gap between themselves and the 3rd worst team in Carlton widening after the weekend. I’ll likely write a post after the season comparing how bad these two teams are to historical ones, but to put it in perspective, the relative difference between the Lions and the 3rd worst (!) team is worth 6 goals (106 rating points). That is larger than the gap between the best team in Sydney and any other team in the top 9!

Simulations

We discussed last week in our round preview about how important the week was for both Port Adelaide and St Kilda to win to improve their chances of making the 8. Unfortunately for the interest in the race for the final 8, they both lost. Running our AFL Simulations for the final 4 rounds of the season and show that the Saints top 8 chances have dropped to 7.8% while Port is sitting at 11%. We’ve also seen three more teams mathematically ruled out of contention 1 in Carlton, Richmond and Gold Coast. Melbourne and Collingwood still have a glimmer of hope, although they only make finals in <1% of our simulations.

simTableR20

At the other end of the table, Hawthorn and Geelong both appear to have locked up top 4 spots after wins on the weekend. They are both the two most likely to claim the vital top 2 positions, with the Hawks still a 2 in 3 chance to win the minor premiership. The last 2 spots in our top 4 race is narrowing down to 3 teams in Adelaide, Sydney and GWS. While the race for the top 8 might be all but over, the tightness within the top 8 is sure to lead to some important games!

plot of chunk unnamed-chunk-4

Notes:

  1. at least in our 10k simulations

Beyond the 8 point game – estimating match importance in the AFL

As I was watching an enthralling match between Western Bulldogs and Port Adelaide over the weekend, there was a lot of discussion about how important the match was – the Bulldogs needed to win to cement their spot in the top 8, while Port needed to win to have any chance of jumping up. It’s also not uncommon for commentators to discuss the notion of an “8 point game“, typically when two teams close on the ladder play each other.

It got me to thinking about whether ‘match importance’ was an empirical measure that we could define? I stumbled upon an article entitled “The Importance of a match in a tournament“, which tried to answer this question in the context of the Premier League. While I confess I don’t understand a lot of the maths in the paper, a lot of which actually dealt with their predictions of matches, the general idea of measuring ‘importance’ was pretty simple. By looking at the change in the probability of a team winning the premier league based upon the result of the match, we gain a relative measure of importance for that particular team, in that particular match in the context of their season. In slightly more technical terms, we can use the difference in conditional probability of winning the league between the conditions of winning or losing a particular match to estimate the relative importance of that match.

Importance(X_{team,match}) = Pr(X_{team}|Win_{team,match}) - Pr(X_{team}|Loss_{team,match})

The above can read as the Importance of a particular match, for a particular team achieving outcome X (e.g. winning the league) is given by the probability of that team achieving X given (the “|” symbol) they win the particular match minus the probability that they achieve X given they loss the particular match. So if winning a particular match gives Team A a probability of winning the league of 40%, while losing the match gives them a probability of winning the league of 10%, the relative importance of that match is 0.3.

While estimating these specific probabilities over such a long time period is difficult (e.g. what is the probability that Hawthron will finish 1st as of round 12, 2016?) – our ELO simulations that we run each week give us pretty good starting point. In fact, that specific question yields an estimate of 23%, based upon running a Monte Carlo simulation of the 10 000 seasons and using the proportion of times that result was achieved as our probability estimate. We can use these simulations with the above formula by simply splitting them into two groups for each team – ones where they win the match in question and ones where they lose it, and then use the proportion of times our measure of interest (notionally X in our formula) occurred as our probabilities.

This measure is something I’ll report each week but to explore it in this post, I’ll use Round 12, 2016 as an example. This round was a round that saw some very close and difficult to predict matches, each of which felt quite important in the scheme of the league. In particular, close matches between top 8 teams occurred such as North Melbourne v Geelong, Adelaide v West Coast, GWS v Sydney and even Western Bulldogs v Port Adelaide (the latter of which is trying to beat the odds and jump into the 8 this year).

The table below shows the Importance measure for each team ahead of round 12 for the range of outcomes I typically report in my simulations.

round12Importance

Taking the Bulldogs v Port game as an example last week – from the Bulldogs perspective, in simulations where they won that match, they finished top four 64.8% of the time, while in simulations where they lost that match, they finished top four 37.4% of the time. Thus, the relative importance (for top four) for the Bulldogs is 27.5. For Port Adelaide, the match didn’t have a big bearing on their top 4 chances (influence score of 8.6), mostly because their chances of making the top 4 are so low anyway, but did have a big bearing on their top 8 chances (influence score of 29).

You’ll see from that table that In order to pick an ‘influence’ score for an actual game, I need to decide which X I choose in my calculation – essentially my output measure for the season. I could choose Top 1, as in the Scarf et al paper, but we don’t have as high of an importance on finishing on top of the ladder as the Premier League since we have a finals series. However, choosing just a Top 8 for instance may also not be that interesting, particularly if we expect the Top 8 to not change from here.

At least for me, I feel that subjectively, matches that can also have an influence of the make up of the 8 are quite important. As such, I’ve decided 1 to take the maximum importance measure for each team across the values in the table above (Top 8, Top 4, Top 2 and Top 1) to give an idea of the maximum effect this result of this match might have on that teams change in position. I’ll then add these two values together for the teams taking place to give an idea of the overall match importance.

round12MatchImportance

Not surprisingly, the importance of matches is much higher for the better teams in the competition, so it will be interesting to explore how this measure changes over the course of the season. I may also revisit round 12 as, at least the general feeling I had while watching and reading about it, it seemed like quite an important one!

Notes:

  1. at least for now, I may end up using ‘sum’ as we progress through the season

Leaping Kangaroos

The Kangaroos, often considered ‘un-sexy’, are putting together a pretty nice season. I’ve discussed previously that early wins in a season is strongly related to wins by seasons end and, although my current ELO rating for North Melbourne only ranks them as the 8th best team 1, their current bank of 7 wins gives them a good base to work off for the rest of the year. Indeed, simulating the season from here on in gives them around a 50% chance of making the top 4.

They are also a good chance to extend their ‘perfect’ start to the season 2 given they play Essendon and Carlton in the next two weeks, who occupy the last and 3rd last spots on my rankings ladder, respectively. Given the strong possibility of a team being on 9 wins and 0 losses, I thought I’d explore where this season fits historically to the ‘best starts to a season’ conversation.

Firstly, I’ve plotted below the distribution of games before we have a team that ‘loses’ its perfect record. In other words, how many rounds did it take until we had no more undefeated teams left in the season. As we can see, for most seasons, this falls within the range of around 4-6 wins.

LastManStanding

In fact, across 119 seasons of VFL/AFL, only 26 teams have started the season with a better record than North Melbourne’s current streak of 7. They are shown below.

Clearly, there are three standouts –

  • Essendon’s 2000 campaign, where their only loss came against the 6th placed Bulldogs
  • St Kilda’s 2009 season, eventually losing to 8th place Essendon and,
  • Collingwood’s 1929 season, still the only “perfect” season in VLF/AFL history, albeit from an 18 game season.

bestStarts

Given North Melbournes two lowly upcoming opponents, they should certainly be confident of continuing this run. This week we give them a 73% chance of winning. The biggest stumbling block is obviously Sydney in round 10 (currently rank 3rd on my rankings). You can see the rest of season simulations here.

If they can get over Sydney (and Essendon/Carlton) to get to 10 wins without losing, that will be the equal 8th best start to the season in VFL/AFL history. No-one will be complaining about “unsexy” football then!

Notes:

  1. I suspect this is largely due to winning games by less than expected
  2. At least in teams of Win/Loss

Simulating the season

As I’ve promised for a few weeks, my ELO rating system allows me to simulate the season from points in time to assess the chances of various teams finishing positions, based on information we have gathered during the start of the season.

Below, I’ve taken each teams current ELO rating, with their current record, and simulated the season 20000 times. For each match, I use the expected result estimated from the ELO difference between the two teams to draw from a probability distribution around that expected result 1. These simulations are “hot” in the sense that after each simulated match, I update the ELO rankings. I’ll probably write a seperate post 2 on that, but here is FiveThirtyEight’s reasoning on why this is a good idea, which is good enough for me. The nice part about this methodology is that it takes into account a teams draw, their current rating and their current record.

I’m hoping to potentially turn this into an interactive table 3. For now, I’ll update each week with a static image.

finalR7to23_2016C

One interesting point is the big drop-off in percentages for finishing in the top 8 between 8th placed West Coast and 9th placed Port. It seems, as I wrote about previously, that the final 8 is taking shape already this early on. In fact, this seems quite common amongst those generating rating systems.

If the top 8 stays this tight, then we could be in for a super interesting finals series. That’s if we can get through the dullness of the top eight being set already.

Notes:

  1. I believe this is formally known as Monte Carlo Simulation
  2. with my ELO system explainer
  3. anyone with advice? ShinyApps is something I’ve considered)