*by Alan Moghaddam*

Chances are if you’re into sports you’ve seen the famed charts from @NBA_Math that feature overlapping pictures of NBA players in a conventional Cartesian plot with a line plotted on it (*y*=-*x*). Anything above the line is good, anything below is bad, and average values will tend to walk the line. The graph is a visual attempt to quantify some mystery statistic known as **TPA**.

**What is TPA?**

This is something of a loaded question; the acronym TPA stands for “Total Points Added”. The basic idea behind it is that a player adds points on offense and defense. You then total these subsections to get TPA.

Unfortuantely, the definition above is rather incomplete. We now need to understand Offensive Points Added (**OPA**) and Defensive Points Saved (**DPS**), the components which make up TPA. The two subcategories are much more complex than TPA alone.

To get OPA and DPS, we need to use “Box Plus/Minus,” an all-in-one statistic created by Daniel Myers and hosted at basketball-reference.com. I promise we are almost at the bottom of the well here in terms of stat definitions. Box Plus/Minus is a relativistic stat that gauges a player’s impact on team performance when s/he is on the court. S/he again will have an impact on both defense and offense, so accordingly Box Plus/Minus can break down into two stats: Offensive Box Plus/Minus (OPBM) and Defensive Box Plus/Minus (DPBM). We can already see that TPA has the same structure as Box Plus Minus; both purport to measure a player’s impact on both ends of the floor. What is the difference between the two?

According to NBA Math, Offensive Points Added and Defensive Points Saved are the Box Plus/Minus (BPM) stats scaled by the number of possessions played by a player. Looking at their numbers, however, I am not totally convinced this is true. Maybe my math is off, but it appears that TPA is a function of the ** minutes** played by each player, and not exactly the possessions. However, if we assume all NBA teams play the same number of possessions, this works out.

Is that a fair assumption? *Does pace matter?*

### Impact of Pace

If we look at league Pace statistics (Figure 1, below), it is a reasonably safe assumption that teams play nearly the same amount of possessions (although I personally am not fond of this generalization). Pace is the amount of possessions played by each team per game or per 48 minutes. The average pace of the NBA is 101.74 possessions per game, so assuming that pace is consistent across the board is not that bad considering the relative standard deviation is only 2.50%.

Is Box Plus/Minus the best metric for individual performance? In my mind it is not the best metric, but it is a decent one. I will defer to others to produce a better model. For the purposes of the present study, however, we can move forward with a basic understanding of BPM as the grounding of Total Points Added.

Please, do not be fooled here, Box Plus/Minus is ** not** agnostic to team performance. This stat is a function of the individual and the team. The idea is that the individual’s performance is a much larger contributor, and with the varied lineups a player will play in, it all should average out. It is absolutely necessary to acknowledge that assumption and comprehend its implications before moving forward.

### Calculating TPA

Having these definitions ready to hand, we can now break down Offensive Points Added and Defensive Points Saved into terms of quantifiable quantities OBPM and DBPM. (To have complete transparency here, OBPM and DBPM also break down further into a host of other measurable stats as well (on which, cf. https://www.sports-reference.com/blog/2014/10/introducing-box-plusminus-bpm-2/).

We have a little math to do now:

*Equation 2(a and b). OPA and DPS functions*

Do not get scared away here, the hardest math here will be algebra, so do not fret! The payoff is coming. I have suffered with the math and made a trend-line to break down the function for OPA to be the following:

*Equation 3.* The fudge factors. These numbers, fudge factors as I like to call them, help massage the correlation between OPA and OBPM. This will help us ascertain the relationship a little better and allow us to get numbers similar to NBA Math’s numbers.

For those interested in the math, I plotted OPA/OPBM vs. Minutes played (for the Houston Rockets to keep Pace the same) and generated a best fit line to ascertain an equation for the standard line, where m= Fudge Factor1 and b= Fudge Factor2 . If you do not like math, or think there is a better way to generate your correlation skip forward and don’t give this any mind.

DPS is calculated with the same method **AND **it uses the same fudge factors! How convenient! This discovery exposes a flaw in the method, since the method assumes that teams play the same proportion of minutes on offensive possessions and defensive possessions. This is not always true. If we had more granularity we could break down time spent on offense and time spent on defense, then multiply by their respective box score statistics. I do not know if the impact is significant, but again, it is an assumption worth noting nonetheless.

### Checking our Solution

A general rule of thumb in science to check if an equation is correct is to check if the units balance out (I *told* you the units would be important later on). If I have an equation where meters = seconds, I might have done something wrong.

The units are as follows:

So now let’s do some algebra:

Since all the units marked in red cancel out, we are left with the following:

Cool. This is intuitive and it makes sense. Now we know how Total Points Added is derived. In the following posts I will outline how you too can make those NBA Math TPA charts in Excel, Python, and then R. You will notice the trend of automatibility, difficulty, and overall versatility follows the order listed above.

*About the author: My name is Alan Moghaddam and I am a chemist. I got my BS in Biochemistry and my Ph.D. in Chemistry. I’m not a true stats guy, even though I love math and numbers. My approach and my goal is to give anyone the tools they need to be able to understand what is being fed to them by sports writers and stat heads. So, if anything, my posts will be a journey for both of us, and I hope you enjoy it.*