mjdc.io Get in touch →
← Back to the notebook

Modelling

How to build an NRL prediction model with AI

How to rate NRL teams in points and turn that into win probabilities you can test, with an AI agent writing most of the code.

9 October 2026 · Michael Conroy

Rugby league is one of the nicer sports to model. There are 17 teams, and the final score tells you a lot more than who won. With an AI agent writing the code, you can have a working prediction model in a few days. This is how I’d build one.

The approach works for most sports scored in points. I’ll use the NRL because it’s the one I built. For the football version, with Elo ratings and draws, see my post on building Elo models.

Where the data comes from

You need results and prices. AusSportsBetting has a spreadsheet of every NRL game since 2009, with scores, head-to-head prices at open and close, and the line. That’s 3,421 games to the end of 2025. I scraped NRL.com for team lists and the current season, and used The Odds API for live prices.

Check what’s actually in the columns before you trust them. The spreadsheet has no venue column before 2021, and true closing prices only run from 2013 to April 2024. Grounds get renamed too, and Cronulla’s has had three names in three seasons. If you scrape fixtures, make sure unplayed games don’t sneak into your ratings as 0–0 draws.

Ratings in points, not wins

The method comes from Billy Walters’ book Gambler. Every team gets one number, how many points better or worse it is than an average side. Average is zero. A +6 team playing a −2 team at a neutral ground should win by about 8.

Points are the right unit because the margin carries far more information than the result. A 30-point win and a 2-point win both go down as one win, but they tell you very different things.

Start everyone at zero in your first season and let the games sort it out. Between seasons, halve every rating. Squads change over summer, and halving pulls everyone back towards average without throwing away what you know.

The update rule

After each game, move each team’s rating by 5% of the gap between what happened and what you predicted.

error = actual margin − predicted margin
home rating = home rating + 0.05 × error
away rating = away rating − 0.05 × error

Say you tipped a team by 10 and they won by 30. The error is 20 points and 5% of that is 1, so they go up a point and their opponent goes down a point.

5% is small on purpose. It takes about 13 games for a rating to absorb half of a real change in a team, so one freak result barely moves it.

Predicting a margin

Before each game, add it up.

predicted margin = home rating − away rating + home advantage + adjustments

Keep the adjustments few and boring. I use two. A team on a short turnaround (five days or less) loses 2 points, and a team on its third straight away game loses 1. Byes made no measurable difference, so I left them out.

The tempting next step is match stats like run metres. I pulled in 1,209 games of them, and one version looked 2.2 percentage points better at picking winners on 2025 alone. That was 180 games. Across six seasons it lost on every metric, because the final score already has the stats baked in.

From margin to probability

A margin isn’t something you can score against the bookies. For that you need a win probability, and an S-shaped logistic curve does the conversion.

P(home win) = 1 / (1 + exp(−k × predicted margin))

You fit k on past seasons by matching predicted margins to who actually won. Mine came out at about 0.12, which makes a 6-point favourite about a 67% chance and a 12-point favourite about 81%. Then plot predicted against actual win rates in buckets. If the points sit near the diagonal, you’re done.

Football needs a separate layer for draws, which is what the ordered logit in the Elo post is for. Rugby league barely has them, 15 draws in 3,633 games since 2009, so one curve does the job.

Home advantage

From 2009 to 2019 the average NRL home side won by 3.0 points. That’s a sensible default, but don’t treat it as a constant.

NRL, 2009 to 2026

How predictable each season was, and home advantage

Up top, how much better than a coin flip the bookies were each season. Underneath, what playing at home was worth.

The bookies were sharpest in 2021, 33% better than a coin flip. 2020–23 were four of the five most predictable seasons since 2009. In 2026 the bookies were only 9% better. Home advantage was worth about 3 points a game from 2009 to 2019. In 2026 it was +0.16, or +0.44 ± 1.38 once you adjust for team strength, when it’s usually worth about 3.

Skill is 1 − Brier ÷ 0.25 on de-vigged head-to-head prices. Home advantage is regular season only, adjusted for team strength, ±1 SE.Prices from AusSportsBetting for 2009–25, and a Tuesday bookie price for 2026.

The bottom panel is home advantage each season, with error bars. 2025 was worth 4.33 points. 2026 was 0.16, the lowest in 18 seasons, and 2017 got down to 0.35. Empty stadiums in 2020 barely dented it (2.36), while the 2021 Queensland hub season nearly wiped it out (0.89). Any single season can be 1 to 1.4 points out either way by pure chance, so don’t rebuild your home advantage from one season’s games.

Start with one number for the whole league. When I tested a flat 3.5 points against venue-by-venue numbers, the flat one had the smaller average error, 13.98 points against 14.28. A ground’s average home margin mostly measures how good its tenant is. AAMI Park comes out at +10.5. That’s the Storm being good, and the grass has nothing to do with it. Whatever you use, set it to zero for neutral games like Magic Round and Las Vegas.

Choosing seasons to fit on

The top panel shows how well the bookies’ prices predicted each season, which is a decent measure of how predictable the competition was.

The obvious move is to fit your curve on the last few seasons. In the NRL that would have meant 2020 to 2023, which were four of the market’s five most accurate seasons and the most predictable four-year stretch since 2009. In 2021 favourites won 75.6% of games and 59.7% were decided by 13 or more. Since 2024 the competition has tightened back up.

A curve learned while favourites were winning 70 to 76% of the time will be too sure of itself in a closer competition. Fit on a longer window that mixes close seasons with lopsided ones. In any sport, check how predictable each season was before you pick the ones that teach your model what confidence looks like.

NRL quirks worth knowing

Margins come in even numbers. Tries are worth 4, goals 2, and only the one-point field goal is odd, so 85% of margins are even. The most common winning margin is 2. A margin of exactly 13 happens 1.2% of the time, against 5.3% for 12 and 6.1% for 14. If you ever predict a band like “13 or more”, that hole matters.

State of Origin pulls players out mid-season. A ratings model has no idea who’s missing. When I tested it, teams did about 1.5 points worse per player missing from their best 13 than even the bookies’ line expected. Origin rounds as a whole are priced fine, so the fix is a points haircut for missing players rather than a blanket rule about Origin teams.

Team lists drop at 4pm on Tuesdays. That’s when the market learns who’s playing, so it’s the right time to run your predictions too.

Testing it properly

Test it walk-forward. Start your first season with every team at zero, run through the games in date order, and record each prediction before the model sees that game’s result. I only score games from round 5 each season, once the ratings have settled.

Then compare against floors you’d be embarrassed to lose to. The simplest is “home team, 55%” for every game, which is roughly how often home teams win.

Score everything with a Brier score. For each game, take the gap between your probability and what happened (1 if the home team won, 0 if not), square it, and average across all games. Lower is better. Saying 50-50 for every game gets you 0.25.

The toughest benchmark is the bookies. Their prices add up to more than 100% because of their margin, so convert each price to a probability (1 ÷ price) and divide by the total so the pair adds to 100%. That’s called de-vigging. The closing price, set just before kickoff with the team lists and the money in, is the hardest test. The opening price is an easier one.

For scale, across 2024 and 2025 the home-team floor scored 0.2467, my model 0.2339 and the bookies’ closing prices 0.2223. The differences look tiny. That’s normal.

As a sanity check, expect an average miss of about 14 points a game. If yours comes out much lower, look for leakage before you celebrate.

Working with the agent

My first version was a 4,812-line system, written in a day. The code arrives fast. Your job is to be the sceptic. The Elo post covers the general workflow, so these are the checks that matter most here.

Check nothing from the future leaks into a past prediction. Anything calculated over the whole dataset is a suspect. Venue home advantage is the classic. Work out each ground’s average home margin across every season, use it on a 2020 game, and your 2020 prediction already knows how that ground played in 2024. Use an expanding window, so each game only sees the games before it. A backtest that looks sensational is usually a bug report.

Make the live system load exactly what you tested. If the backtest refits the curve every run and the live system reads k from a config file, sooner or later they’ll drift apart. Have the live run load the fitted numbers straight from the backtest’s output, or refuse to start.

Count how many variants you tried. I tested 67 versions of the rating system and their average error only ran from 14.11 to 14.54 points. With gaps that small, the best of 67 is mostly the luckiest of 67. Write the count down next to any result you quote.

Write down what you’ll test before you test it. Before looking at Origin I wrote down 14 hypotheses, and several obvious ones fell over. Get the agent to keep a dated diary of what it tried and found, too.

If you want to try this

The agent will have the first version running before your coffee’s cold. Spend the rest of the week trying to break it.

More from the notebook.All writing →