Page 1 of 7

Help with calculating WARP (from basketball-prospectus)

Posted: Sun Jul 28, 2013 3:45 am
by AcrossTheCourt
I recently tried to calculate WARP because I wanted to compare it to other metrics in predicting team wins in the 2013 (and because I think it's an interesting metric with what it does with usage and spacing.)

Online guide to calculating it.

The defensive component is mostly correct according to this sample of Miami players.

But I'm completely wrong on the offensive side. I think it's this step:
Teammate eFG% = ((TeammateOffRat/100) - (LgFT/LgPoss)) / TeammateFGA

Is that TeammateFGA% or total TeammateFGA's? The teammate eFG% should be around .45ish, I assume.

And I assume PlayerRebOpp% = (FGA - FGM) + .56*(FTA - FTM) / (FGA + (.44*FTA) + TO) is actually:
PlayerRebOpp% = ( (FGA - FGM) + .56*(FTA - FTM) ) / (FGA + (.44*FTA) + TO)

Here's a sample calculation line for LeBron James:

EDIT: I updated the numbers because I think I fixed a couple things.

Code: Select all

  PC   	Pos     OffRat  Usage  TmOffRatMinor	TmOReb%	PlayerRebOpp%	TmteOffRat
1799.3	1661.005	108.3	0.331	   99.5	     0.255	    0.431	     107.0

Code: Select all

TmteFGA% Tmte eFG% TmteFG% TmteRebOpp% TmRebOpp% TmOffRat  3A%	Tm3A%	TmOffRat3
 0.770    0.511	  0.470	   0.392	  0.402   	109.4   0.09   0.15  	113.6
LeBron's actual Offensive Rating: 115.6. I'm closer on LeBron's rating than the others. This seems to be more with big guys. I calculated Joel Anthony as 108.3 instead of 102.9, for example,

Notes:
-TmOffRatMinor: the usage component was not in terms of 100 possessions, so I changed .25 to 25 in the formula:
TmOffRatMinor = OffRat*Pos% + ((1-Pos%)*(LgOffRat + (.25*(Pos% - 0.2))))
-The formula for TmOReb% seems off because you're adding the league average and the player's OReb%, so I multiplied the team factor by 4/5.
-PlayerRebOpp%: in the formula, are those individual or team totals (FT, FTA, etc)?
-Multiplied the usage factor by 100 so it's in terms of 100 possessions for this formula:
TeammateOffRat = LgOffRat + (.25*(Pos% - 0.2))
-I didn't understand what was in the Teammate eFG% denominator, so I tweaked the formula and got results close to the league average for eFG%.
Teammate eFG% = ((TeammateOffRat/100) - (LgFT/LgPoss)*.56/2) / 2
(That's probably wrong....)

Can anyone help? Thanks.

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Sun Jul 28, 2013 4:19 am
by nbacouchside
I was actually doing much the same exercise with the Bulls (mostly out of my own curiosity) and came up with the same frustrations. Also, Kevin often switches between using "Usage" as a term and then other times uses "Pos %" or "Poss %" and it's all very confusing.

The question I had (which I just tweeted at him) was how he calculates LgPoss in doing the calculations regarding Teammate FGA%, eFG%, etc. I'm not even coming close to getting accurate readings and yes, I also had the same Q re: whether it is supposed to be Teammate FGA% or Teammate FGA (and if it's the latter, how to calculate it).

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Mon Jul 29, 2013 3:54 am
by nbacouchside
All these views and no one else has tried to do this either?

Too bad Kevin's not around to chime in.

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Mon Jul 29, 2013 1:32 pm
by Mike G
I don't know that this WARP has ever been debated here.
As such, it may be that nobody here is really familiar with it at all.

It would be excellent if another Wins-attributing system were available for use, or at least for comparison to others. But I think open discussion is always essential to the final product. Every system has its quirks, and no creator of such a system will see every angle.

I'd always thought WARP was a generic term for such systems. If you changed it, you could call it WORP ("over" instead of "above"), if you don't want to encroach on someone's name.

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Mon Jul 29, 2013 5:18 pm
by v-zero
Any metric on the +/- scale (e.g. RAPM) or a similar per-minute scale can be trivially converted to wins.

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Mon Jul 29, 2013 6:08 pm
by nbacouchside
v-zero wrote:Any metric on the +/- scale (e.g. RAPM) or a similar per-minute scale can be trivially converted to wins.
Right. I wasn't trying to get Pelton's WARP for any reason other than to see what it had to say about certain players. I'm generally curious about these different statistics in general. So I wanted to try to calculate his WARP for the different teams that I'm most interested in, but I couldn't follow his calculations and I got tripped up in basically the same spots as AcrossTheCourt. Maybe I will just e-mail Kevin directly and ask him about this stuff.

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Tue Jul 30, 2013 10:00 pm
by AcrossTheCourt
Perhaps someone here could contact Pelton for some clarifications?

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Wed Jul 31, 2013 3:34 am
by Kevin Pelton
Hey guys, I can take a look at your calculations and compare them to mine next week if you hold tight. This week is not good for me.

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Wed Jul 31, 2013 3:56 am
by AcrossTheCourt
Thanks. Good luck with wrangling the crazy off-season for ESPN.

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Thu Aug 08, 2013 2:57 am
by AcrossTheCourt
Kevin Pelton wrote:Hey guys, I can take a look at your calculations and compare them to mine next week if you hold tight. This week is not good for me.
Alright do you have any time now?

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Fri Aug 09, 2013 1:28 am
by Kevin Pelton
In the sample calculations, are those for 2010-11 or another season? Assuming it's 2010-11, they're generally similar but not quite the same to what I have:

Code: Select all

Points1000  TO1000   FGA1000   FG%   TmmteRebPs   PlRebPs   TmRebPs
   975       121       778    0.472    0.441       0.396     0.426
As you can see, the teammate stats are all expressed per 1000 plays in my spreadsheet to make them a little easier to understand -- that's part of what I'm losing in translation to explaining online.

You are correct that when we're doing these all as percentages, it should be FGA% and not FG%.

League Possessions should just be FGA + .44*FTA + TO for the entire league.

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Fri Aug 09, 2013 3:34 am
by AcrossTheCourt
Kevin Pelton wrote:In the sample calculations, are those for 2010-11 or another season? Assuming it's 2010-11, they're generally similar but not quite the same to what I have:

Code: Select all

Points1000  TO1000   FGA1000   FG%   TmmteRebPs   PlRebPs   TmRebPs
   975       121       778    0.472    0.441       0.396     0.426
As you can see, the teammate stats are all expressed per 1000 plays in my spreadsheet to make them a little easier to understand -- that's part of what I'm losing in translation to explaining online.

You are correct that when we're doing these all as percentages, it should be FGA% and not FG%.

League Possessions should just be FGA + .44*FTA + TO for the entire league.
Oh no it's the 2012 season. I found a guide to the 2013 Miami Heat. It lists every player's WARP in the previous season. In 2012, for example, it listed LeBron with an oRTG of 115.6 and a dRTG of 104.3.

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Fri Aug 09, 2013 6:32 am
by Kevin Pelton
In that case our numbers are actually less close. Here is what I have:

Code: Select all

Points1000  TO1000   FGA1000   FG%   TmmteRebPs   PlRebPs   TmRebPs
  946        124       782    0.462    0.451       0.382     0.428
One big possible discrepancy: Are you including non-player team turnovers?

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Fri Aug 09, 2013 8:33 am
by AcrossTheCourt
I don't think I am. I checked the calculations and I don't think they are in there. That was one question I had. Should team TOVs be used anywhere and if so, where?

Re: Help with calculating WARP (from basketball-prospectus)

Posted: Fri Aug 09, 2013 3:32 pm
by Kevin Pelton
Nope. That would be the right way to do it. Do you want to maybe send me your spreadsheet and I can compare?