About

The Margin is an independent sports analytics project, built by a data analyst to show the whole process: collecting data, modeling it, testing the model honestly, and publishing the results, including the misses.

Where the data comes from

Game results, schedules, and team and player box scores come from the public statistics on NBA.com, collected with the open-source nba_api library. Coverage starts in 1983-84, the earliest season with complete results, and includes the regular season, the Play-In, the playoffs and the NBA Cup final.

Every response is saved as it arrived, then cleaned and checked before anything uses it. Each game must have exactly two teams and one winner, the scores must agree with the result, and each season must have the expected number of games. If a check fails, the previous data stays in place and nothing new is published.

The source data has a few known problems, which are corrected the same way every time:

How the forecasts are made

Forecasts come from an Elo rating model. Every team has a rating; the gap between two ratings, plus a home-court edge, gives each team's chance of winning. After each game the winner takes rating points from the loser, more after an upset or a big margin. Ratings drift back toward average between seasons, and home court is taken from the previous three seasons, because it has shrunk a lot since the 1980s. The full explanation, with examples, is in How the forecasts work.

The data is updated once a day, early in the morning (US time). Forecasts cover the next seven days and change only when one of the teams plays in between.

How it was tested

The model's settings were chosen using only the 1984-85 to 2004-05 seasons. It was then scored on 2005-06 to 2025-26, seasons it had never seen, against two simple baselines: always picking the home team, and picking the team with the better record so far. Every prediction in that test uses only games played before it. Results are on Performance.

Keeping score honestly

Limitations

What is published

Data: NBA.com. This site publishes only its own derived outputs: forecasts, ratings, model scores, simulations, results as wins and losses, team records and names, and summary statistics behind the articles. It does not republish scores, box scores or other raw NBA statistics. It has no database and no server; every page is built ahead of time. The underlying data and code stay with the author.

Corrections and removal requests: if you hold rights in anything used here, or spot a mistake, email marginforecasts@proton.me and it will be changed or removed promptly.

Not affiliated with the NBA or any league or team. No logos or league branding are used.