Tuesday, December 3, 2019

Man vs Machine


Man versus Machine (Part I)

What the comparison of two annotation sources can tell us about SportVU and psychology

Preamble: I wrote this post in summer 2015. It never got published at Nylon Calculus, as we did not want to anger the NBA and SportsVU gods to take our data away. Alas, away they took. So, while there is a discussion about tracking data on Twitter right now, here's the article... (I'm sorry, links won't work and grammar errors will remain. Also, I think there is a figure missing in the beginning. I think it died with my hard drive.) (Also, Part II was about assists iirc. That's also gone.)

When you start scraping, analyzing and visualizing nba.com's tracking data, you feel like a kid in a candy store. But after the first sugar rushes start to go away, you realize that some of the candies may be dirty and you probably should gobble them a bit more carefully. Before you now start to mistrust everything that has ever been written on Nylon Calculus, let me assure you that the number of bad candies we are talking about is rather small and should not affect any of the previously done results. We are basically talking about one booger between a thousand bonbons. But obviously it would be nice to eliminate as much discrepancy between data and reality as possible.
The easiest extractable SportVU data is shot related. And the information that SportVU gives us about each shot is the shot distance, touch time and dribblings before the shot occurred. In the following I will first tackle the shot distance and then look at problems with touch time and dribblings. I will compare the manual annotation of assists with the information we have given by SportVU in a later article, as assists are a more philosophical question.
The data comprises all shots of the 2014-15 regular season (mandatory hat tip to Darryl). It might be that there are some hiccups that occurred outside of the SportVU data. But I re-checked several entries manually and always found the bizarre results to already exist in the nba.com database.

Shot distance

Shot distance exists already for the time before SportVU, as there have always been hardworking people that manually annotated every shot taking place on an NBA field. If we compare the shot distance given by those worker bees with the shot distance we receive from our new electronical overlord, we get the following picture:
At first sight, this might look worse to you than it actually is. You have to be aware that the color scale is a log scale, so everything that is between blue and yellow are only a fraction of the close to 200'000 shots. Almost all shots occur in the slightly skewed diagonal rectangle in the middle, which is also reflected in the histogram measuring the difference between manual annotated shot distance and SportVU distance.
So, as a batch measurement, SportVU seems to produce useful distances (Phew!). Yet, we can see two clear regions of artifacts in the 2D histogram, which I underlined red. The reason for the upper one seems obvious and a bit embarrassing: SportVu simply does not believe that somebody could shoot from the own side of the field. This explains the negative slope for shots that are manually declared as more than 50 feet away from the basket (with the length of an NBA court being 94 feet).

The problem we see on the lower right corner, where manual annotations estimate a distance of less than 5 feet and SportVu goes up to 30 becomes more obvious when we use an additional information given by or worker bees. Because they gave every shot an action type label, we can for example look at shots that are labeled as “Jump Shot” or shots labeled as “Dunk Shot”. In the following plot, I compare all shots for which the action type contains the words “Layup” or “Dunk” with all shots containing “Pullup”, “Fadeaway” or “Stepback”:
As you can see, we have a clear problem for Layups and Dunks. For the manual annotation, none of them where declared to be further away than 5 feet (Note: Actually, 3 of 10'000 were. One example is a miss by Young, followed by a missed put back http://stats.nba.com/cvp.html?GameID=0021400385&GameEventID=199# ; no idea what happens on the other two). In comparison, 30% of all dunks alone where apparently made from outside the charging area (4 feet circle), according to SportVU. That is an interesting definition of a dunk. Looking at some of the biggest offenders of dunk distance, we can get an idea what goes wrong: You often either have very straight drives to the basket (Noel, SportVU distance 23.9 feet: http://stats.nba.com/cvp.html?GameID=0021400043&GameEventID=388# ; Olynik, SportVU distance 23.8 feet), or alley hoops (Jordan, SportVU distance 24.5 http://stats.nba.com/cvp.html?GameID=0021400391&GameEventID=071#). But some of them just do not make any sense (like this 25 feet dunk from Gerald Henderson, where the ball is never further away from the basket than may 8 feet http://stats.nba.com/cvp.html?GameID=0021400742&GameEventID=049# ). Under these circumstances, it can of course lead to the problem that we inflate shooting percentages from shots that we think are from 3 to 5 feet.

In comparison, for shots for which we can expect motion that is not directed towards the basket seem to work quite well. An interesting observation is that for all jump shots we have a good agreement between manual and SportVU distance for those shots that are from 23 to 25 feet – basically all three pointer. For midrange jump shots on the other hand, SportVU sees the player a little bit further away from the basket.
There are two scenarios for this. The more likely one is that manual observations lack the precision when the 3 point line is not there to guide your estimation. The ugly alternative would be that SportVU has some kind of ridge regression, pulling shots that are likely 3 pointers towards the 3 point line. Let's not hope that that's the case...
For a few shots I looked at, where manual annotation and SportsVU strongly disagreed, the manual annotation was more often right than not.
As examples where the manual one is correct:
SportVU says 38.4 ft distance, manual 23 http://stats.nba.com/cvp.html?GameID=0021400714&GameEventID=157#
SportVU says 37.3 ft distance, manual 24 http://stats.nba.com/cvp.html?GameID=0021400946&GameEventID=197#
SportVU says 42.9 ft distance, manual 19 http://stats.nba.com/cvp.html?GameID=0021401154&GameEventID=323#
On the other hand I am pretty sure that this shot by is closer to 25.3 feet than to 31 feet
http://stats.nba.com/cvp.html?GameID=0021400108&GameEventID=085#

not a 31 footer
[1] http://stats.nba.com/cvp.html?GameID=0021400108&GameEventID=085#
[1] "player ID:2564; Scoring Player:Boris Diaw; ShotType: Pullup Jump shot; Touch time: 0.9; Shot clock: 2.6; Dribbles: 0; SHOT_DISTANCE: 31.0; SHOT_DIST: 25.3; Distance defender: 6.6; Game Clock: 2:23"

much closer manually
manual is right
[1] http://stats.nba.com/cvp.html?GameID=0021400714&GameEventID=157#
[1] "player ID:2045; Scoring Player:Hedo Turkoglu; ShotType: Jump Shot; Touch time: 0.0; Shot clock: 24.0; Dribbles: 0; SHOT_DISTANCE: 23.0; SHOT_DIST: 38.4; Distance defender: 21.0; Game Clock: 8:07"
[1] http://stats.nba.com/cvp.html?GameID=0021400946&GameEventID=197#
[1] "player ID:201228; Scoring Player:CJ Watson; ShotType: Jump Shot; Touch time: 4.4; Shot clock: 24.0; Dribbles: 0; SHOT_DISTANCE: 24.0; SHOT_DIST: 37.3; Distance defender: 7.4; Game Clock: 2:48"
[1] http://stats.nba.com/cvp.html?GameID=0021401154&GameEventID=323#
[1] "player ID:202339; Scoring Player:Eric Bledsoe; ShotType: Pullup Jump shot; Touch time: 5.6; Shot clock: 18.3; Dribbles: 6; SHOT_DISTANCE: 19.0; SHOT_DIST: 42.9; Distance defender: 20.8; Game Clock: 6:04"

closer automatic
[1] http://stats.nba.com/cvp.html?GameID=0021400058&GameEventID=313#
[1] "player ID:101112; Scoring Player:Channing Frye; ShotType: Jump Shot; Touch time: 0.0; Shot clock: 15.8; Dribbles: 0; SHOT_DISTANCE: 27.0; SHOT_DIST: 19.0; Distance defender: 9.4; Game Clock: 5:36"
[1] http://stats.nba.com/cvp.html?GameID=0021400301&GameEventID=391#
[1] "player ID:101139; Scoring Player:CJ Miles; ShotType: Jump Shot; Touch time: 0.0; Shot clock: 24.0; Dribbles: 0; SHOT_DISTANCE: 26.0; SHOT_DIST: 14.8; Distance defender: 11.2; Game Clock: 8:12"
[1] http://stats.nba.com/cvp.html?GameID=0021400394&GameEventID=162#
[1] "player ID:201583; Scoring Player:Ryan Anderson; ShotType: Jump Shot; Touch time: 0.0; Shot clock: 24.0; Dribbles: 0; SHOT_DISTANCE: 26.0; SHOT_DIST: 12.1; Distance defender: 4.2; Game Clock: 8:04"
[1] http://stats.nba.com/cvp.html?GameID=0021400606&GameEventID=499#
[1] "player ID:201163; Scoring Player:Wilson Chandler; ShotType: Jump Shot; Touch time: 0.0; Shot clock: 24.0; Dribbles: 0; SHOT_DISTANCE: 27.0; SHOT_DIST: 14.9; Distance defender: 11.3; Game Clock: 1:42"
[1] http://stats.nba.com/cvp.html?GameID=0021400668&GameEventID=289#
[1] "player ID:203081; Scoring Player:Damian Lillard; ShotType: Jump Shot; Touch time: 10.2; Shot clock: 14.0; Dribbles: 12; SHOT_DISTANCE: 25.0; SHOT_DIST: 19.9; Distance defender: 6.5; Game Clock: 8:44"
[1] http://stats.nba.com/cvp.html?GameID=0021400694&GameEventID=281#
[1] "player ID:201155; Scoring Player:Rodney Stuckey; ShotType: Jump Shot; Touch time: 2.8; Shot clock: 24.0; Dribbles: 0; SHOT_DISTANCE: 26.0; SHOT_DIST: 18.1; Distance defender: 6.1; Game Clock: 7:06"
[1] http://stats.nba.com/cvp.html?GameID=0021401137&GameEventID=207#
[1] "player ID:203496; Scoring Player:Robert Covington; ShotType: Jump Bank Shot; Touch time: 5.6; Shot clock: 17.7; Dribbles: 5; SHOT_DISTANCE: 25.0; SHOT_DIST: 17.1; Distance defender: 4.1; Game Clock: 6:01"
[1] http://stats.nba.com/cvp.html?GameID=0021401145&GameEventID=381#
[1] "player ID:204060; Scoring Player:Joe Ingles; ShotType: Jump Shot; Touch time: 2.0; Shot clock: 5.8; Dribbles: 1; SHOT_DISTANCE: 25.0; SHOT_DIST: 17.7; Distance defender: 5.9; Game Clock: 1:16"
[1] http://stats.nba.com/cvp.html?GameID=0021401158&GameEventID=087#
[1] "player ID:203897; Scoring Player:Zach LaVine; ShotType: Jump Shot; Touch time: 2.2; Shot clock: 10.1; Dribbles: 1; SHOT_DISTANCE: 25.0; SHOT_DIST: 17.0; Distance defender: 3.2; Game Clock: 2:27"



Distant dunks
Yes
[1] http://stats.nba.com/cvp.html?GameID=0021400043&GameEventID=388#
[1] "player ID:203457; Scoring Player:Nerlens Noel; ShotType: Dunk Shot; Touch time: 3.5; Shot clock: 21.6; Dribbles: 0; SHOT_DISTANCE: 0.0; SHOT_DIST: 23.9; Distance defender: 5.8; Game Clock: 11:02"
Tough
[1] http://stats.nba.com/cvp.html?GameID=0021400173&GameEventID=236#
[1] "player ID:203100; Scoring Player:Tony Wroten; ShotType: Dunk Shot; Touch time: 0.0; Shot clock: 14.9; Dribbles: 0; SHOT_DISTANCE: 0.0; SHOT_DIST: 24.9; Distance defender: 0.5; Game Clock: 2:56"
Yes
1] http://stats.nba.com/cvp.html?GameID=0021400371&GameEventID=353#
[1] "player ID:203482; Scoring Player:Kelly Olynyk; ShotType: Driving Dunk Shot; Touch time: 0.9; Shot clock: 18.7; Dribbles: 0; SHOT_DISTANCE: 0.0; SHOT_DIST: 23.8; Distance defender: 4.2; Game Clock: 11:28"
Yes
[1] http://stats.nba.com/cvp.html?GameID=0021400391&GameEventID=071#
[1] "player ID:201599; Scoring Player:DeAndre Jordan; ShotType: Alley Oop Dunk Shot; Touch time: 4.0; Shot clock: 20.6; Dribbles: 0; SHOT_DISTANCE: 0.0; SHOT_DIST: 24.5; Distance defender: 5.0; Game Clock: 5:50"
Tough
[1] http://stats.nba.com/cvp.html?GameID=0021400406&GameEventID=143#
[1] "player ID:101123; Scoring Player:Gerald Green; ShotType: Driving Dunk Shot; Touch time: 0.0; Shot clock: 24.0; Dribbles: 0; SHOT_DISTANCE: 0.0; SHOT_DIST: 24.0; Distance defender: 3.7; Game Clock: 12:00"
[1] http://stats.nba.com/cvp.html?GameID=0021400547&GameEventID=349#
[1] "player ID:203084; Scoring Player:Harrison Barnes; ShotType: Alley Oop Dunk Shot; Touch time: 4.8; Shot clock: 18.6; Dribbles: 0; SHOT_DISTANCE: 0.0; SHOT_DIST: 22.4; Distance defender: 4.4; Game Clock: 4:34"
[1] http://stats.nba.com/cvp.html?GameID=0021400691&GameEventID=189#
[1] "player ID:201148; Scoring Player:Brandan Wright; ShotType: Dunk Shot; Touch time: 3.4; Shot clock: 24.0; Dribbles: 1; SHOT_DISTANCE: 0.0; SHOT_DIST: 23.6; Distance defender: 7.6; Game Clock: 6:22"
[1] http://stats.nba.com/cvp.html?GameID=0021400742&GameEventID=049#
[1] "player ID:201945; Scoring Player:Gerald Henderson; ShotType: Alley Oop Dunk Shot; Touch time: 0.0; Shot clock: 9.3; Dribbles: 0; SHOT_DISTANCE: 0.0; SHOT_DIST: 25.0; Distance defender: 8.4; Game Clock: 6:42"
[1] http://stats.nba.com/cvp.html?GameID=0021401101&GameEventID=147#
[1] "player ID:202687; Scoring Player:Bismack Biyombo; ShotType: Dunk Shot; Touch time: 0.6; Shot clock: 9.1; Dribbles: 0; SHOT_DISTANCE: 0.0; SHOT_DIST: 24.6; Distance defender: 10.1; Game Clock: 7:41"




http://stats.nba.com/cvp.html?GameID=0021400189&GameEventID=537#
walking the dog
takes after shot clock reset
misses the skip pass
shot clock stops
http://stats.nba.com/cvp.html?GameID=0021400730&GameEventID=008#
momentarily unclear position


shot clock reset

no idea

Alley Hoops
"player ID:203500; Scoring Player:Steven Adams; ShotType: Alley Oop Dunk Shot; Touch time: 14.1; Shot clock: 24.0; Dribbles: 0; SHOT_DISTANCE: 0.0; SHOT_DIST: 5.6; Distance defender: 3.9; Game Clock: 8:10"
"player ID:202685; Scoring Player:Jonas Valanciunas; ShotType: Alley Oop Layup shot; Touch time: 9.8; Shot clock: 24.0; Dribbles: 0; SHOT_DISTANCE: 1.0; SHOT_DIST: 1.5; Distance defender: 0.8; Game Clock: 4:25"

Dribble Alley Hoops
[1] http://stats.nba.com/cvp.html?GameID=0021400456&GameEventID=239#
[1] "player ID:203081; Scoring Player:Damian Lillard; ShotType: Alley Oop Layup shot; Touch time: 11.3; Shot clock: 12.8; Dribbles: 9; SHOT_DISTANCE: 2.0; SHOT_DIST: 4.1; Distance defender: 3.9; Game Clock: 11:49"
[1] http://stats.nba.com/cvp.html?GameID=0021400500&GameEventID=415#
[1] "player ID:201163; Scoring Player:Wilson Chandler; ShotType: Alley Oop Dunk Shot; Touch time: 7.8; Shot clock: 16.9; Dribbles: 6; SHOT_DISTANCE: 0.0; SHOT_DIST: 3.1; Distance defender: 1.9; Game Clock: 7:52"
[1] http://stats.nba.com/cvp.html?GameID=0021400909&GameEventID=406#
[1] "player ID:201566; Scoring Player:Russell Westbrook; ShotType: Alley Oop Layup shot; Touch time: 12.2; Shot clock: 12.0; Dribbles: 10; SHOT_DISTANCE: 1.0; SHOT_DIST: 4.3; Distance defender: 3.4; Game Clock: 6:59"

[1] http://stats.nba.com/cvp.html?GameID=0021400031&GameEventID=327#

Thursday, July 23, 2015

Small list of ggplot2 examples

Hello everybody,

I didn't use ggplot2 that much until 2 weeks ago. Which in my opinion was a big mistake on my behalf. I think my train of thought shifted from
"I just want to plot something, I don't directly get what's going on with this ggplot2 thing. I'll just find a quick solution"
to
"Wow! Once you get the basic idea, the world becomes your oyster!"
Personally, I blame Matlab. I'm just so used to use a different function for calling each plot (do a specific thing with Input data), that I did not directly realize that a plot is basically (Input data) + (do something with it)
Once you get a hang for it, it get's really fun, because you often just have to change a geom_point() to a geom_smooth() to get a completely different thing - or simply put them both in a row!
Anyhow, without further ado, here is my tutorial-like pdf:

Cheers,
Hannes

Thursday, July 9, 2015

Links I favorited about data science

I had a few weeks on where I used Twitter mostly on my phone. So I started blindly favoriting tweets that could be usefull. This blog post is mostly for me to curate all these data related links. If it comes in handy for others the better. I try to sort them a bit after topics... hat tips go to all the data scientists that show an immigrant like me some interesting things (too lazy to list them right now...)

General Methods and algorithms


R

  • R introduction plus text mining course -  @StatsInTheWild is probably my favorite twitter handle
  • dplyr tutorial - I still live in a dplyr less world. Which I guess I should regret every time I write df[df[,'Stat1']>0 & df [,'Stat2']>2,] - people might call that dumb, I call it oldschool
  • ggrepel: I finally can use the ggplot package for messy textplots 

Python

Other languages



Thursday, March 19, 2015

NBA players are creatures of habit

Hello everybody,

this is a follow-up to my last post on 'distancology' – the science of turning all shot charts into one colorful picture. You can find a half-way clean code in my github account. If you run MakeHeatMap.R, you should actually be able to reproduce the result.

One question that one naturally can ask, when comparing the shot distribution of players, is how consistent or reliable those shot distributions are. For example, in my last article I sorted around 200 players into 10 distinguishable groups, using a (vague) cutoff. But I could as well have used 5 or 20 groups. Now, the question regarding reliability is: If you compare year to year, how many players would remain inside the same shot cluster?
Because, if I would label somebody as a 'corner three guy' due to his shot distance distribution in one year, but the next year there is a 50% chance that he's actually a 'typical wing player' guy – that would be pretty useless.1

Long story short, what I did is to combine the distance distributions for two years – and the result is pretty mindblowing2. The following plot works very similar to the one that I used in my previous article. I just changed the column on the left, so that it indicates the effective field goal percentage instead of the shot attempts. This way it is easier for people to be in awe about Stephen Curry. It shows both seasons for every player that had at least 600 attempts (data is from the 3rd of March) during this and the last season – and here it is3:

Monday, March 2, 2015

Before this probable nonsense about 'fouling while leading' gets spread

Hi everyone,

I thought about letting it slip, but then I read this quite from an SI.com article:
"28. The most staggering NBA stat from Sloan? Fouling when winning can increase your chances by 11 percent, according to a paper written by Franklin Kenter of Rice University. The paper shows that fouling near the end of games pretty much makes sense in every situation, whether you’re trailing or leading. When behind, it advises fouling one minute out for every six points you are behind. When leading, it suggests fouling one minute out for every three points you lead."
Side note here: 'The paper shows that fouling...' is a typical case of 'reporter overstates what scientist says'. I guess 'The paper says that their model indicates...' would be more realistic.

But more or less, that's what the paper said. Their reasoning was the following:
"The concept of fouling when ahead may be counterintuitive. However, toward the end of the game, the main goal of the trailing team is to increase the total variance in order to widen the window of possibilities that win the game. One main component in this wider variance is the riskier 3-point shot. The trailing team can limit this variance by fouling. the leading team may give up points, on average, but limit the trailing team to 2 points per possession. This decreases the total variance and, with a sufficient lead, increases the leading team’s chances of winning."
Now, I could go on a very lengthy statistical rant about this. I tried to figure out where they made the mistake in their model, but the paper was too vague in terms of their methods.
The point is this:

Thursday, February 19, 2015

Data dump:Isolation is a meritocracy, miscellaneous is something you should avoid

Hi everybody,

this is mostly a data dump after I looked at the new nba.com Synergy Sports data (next stop tracking data!). Feel free to use the plots.
For players I always show those that have enough attempts

One personal note: The Synergy data can be easily wrongly interpreted. For example, a cut is mostly not a play itself. If you look at the players that attempt a lot of cuts, you find mainly center that most probably are beneficiaries from other stuff that is going on (cue to Blake Griffin throwing a lob to DeAndre Jordan).
Even though cuts have a high value for Points per possession, cutting all the time is not the solution. (This is a very personal note, as my last rec league team had a disastrous knack of cutting into whatever real playtype was going on at that moment...)

Cheers,
Hannes





































Friday, January 30, 2015

Revisiting Stats stabilization

Revisiting Stats stabilization

a warning before you start reading this. You can find a more polished version at Nylon Calculus (memo to myself: add link here as soon as you got it). They also published another piece of mine and have a lot of other great stuff. But if I would draw a Venn Diagram of people that read my blog and people that read Nylon Calculus, I am pretty sure that you know all this already...
This version has a bit more (probably boring) details on why I find previously used methods impractical. It also has a bit more shiny plots, which in the end where not helpful for understanding. So, if you are here for the shiny plots scroll down to the end. There is also an R script so that you can produce shiny plots yourself. You can find a github for the R function that I wrote here.
Side note: One reason for this blog entry is that I'm starting to move from Matlab to R. If you find technical flaws in it let me know. :)

Hello everybody,
over the last years there seems to be one main way to estimate the stabilization of a stat, ( http://nyloncalculus.com/2014/08/29/long-take-three-point-shooting-stabilize/ , http://www.fangraphs.com/blogs/stabilizing-statistics-interpreting-early-season-results/ , http://www.baseballprospectus.com/article.php?articleid=17659 ) based on the work of Prof. Dr. Pizza Cutter. While the work itself is technically sound, it has in my opinion several drawbacks. In short, the method is in my opinion unnecessarily complicated, can be easily misleading and is as a result impractical to use. In the following, I will explain these three points of critique, while introducing a simpler and more practical method that works perfectly well for a certain kind of commonly measured data.

Thursday, January 8, 2015

Scatter Plot Data

Hi everyone,

I decided to release the code that I am using for my scatter plots. Mostly because I am not using it often enough to keep it for myself, so I hope that it is useful for somebody else. Use it at your own risk. Feel free to remove my name or change anything. And so on (we all know these proclamations...).

In my opinion, the output is pretty cool, especially if you combine it with Inkscape or Illustrator (which works well if you save the plots as pdf)
As an example, take the plot I have here: http://sportstribution.blogspot.de/2014/03/three-quick-points-on-kyle-korver-and.html
You just have to use the same axes settings and different filter or data points and you get two plots that you can easily merge (and color differently).

Especially for those of you that have the data readily at hand (I'm looking at you, Nylon guys!) it could be worth to give it a try.
This code was my first try in learning Python and it is therefore far from perfect. It is only 400 lines and not so many packages, so it might also be interesting for those of you that are as well interested in learning Python.

The code should work with Python2.7 and the right packages. If someone knows how to update this, I am glad to listen.

Oh, I almost forgot to add the github:  

Cheers,
Hannes

Tuesday, December 9, 2014

Catch & Shoot vs Pull Up and the risk of binning

Hi everyone,
a short note as I observed several articles making use of data binning. I am not saying that binning is automatically wrong, but it has at least one important potential flaw.

Let's use the catch & shoot vs pull up shooting percentage as an example. It is shown that catch and shoots are generally more open than pull ups. Furthermore, let us say that we define an uncontested shot as any shot where no defender is in a distance of 6 feet (that is binning).
Now, a study might find that uncontested catch and shoot attempts have a higher FG% than uncontested pull ups. But, if we now compare hypothetical distributions for both shot types
we can clearly see that the mean weight is not the same for catch & shoot and pull ups. 
Both for contested and uncontested shots, hypothetical pull up shots are clearly more contested.

That's it for right now. Don't say I didn't warn you.
Hannes

Update: I only mentioned the problem, but didn't offer any solution. I never had to work with a problem like this myself, but @neuteufel mentioned Propensity score. I guess there are probably a few more standard procedures, but the most important is that you are aware that open is not necessarily open (that sounds weird...)

Tuesday, December 2, 2014

Looking for soulmates (even though I don't believe in them...)

Hi everyone,

I was using hierarchical clustering quite a bit over the last month.
And two days ago I found this nice R-script, so I combined the data with my clustering.
Short info before it gets self-explanatory:
- Used all players that had at least 10 games and 12 minutes per game
- as the list is too long to show all the names, I will use subclusters where you can find the names
- tried to use minute normalized data (per 36)
- the effective field goal column is not used for clustering. I did not include any FG percentages in the end (for no real reason...)
- If a value is green, that means that there was a division by zero (mostly because the player never drove)
- If you have other interesting data, feel free to send it to me and I'll send you the figures back. Or if you have Matlab I can give you the code as well (probably should clean it beforehand...)

Without further ado (click on the figures to enlarge):

Monday, October 27, 2014

The 42 of the NBA lottery

Hello everybody,

I think I just found the perfect (albeit crazy) solution how we can fix several things that are wrong about the NBA: Let us support the mediocre teams instead of the incompetent!

Before I explain my idea, first the status quo:

  • The goal of every team is to win a title. Therefore, you need to get good players, small markets are the most likely to get good players at the draft. Therefore it is good to be bad.
  • The problem with one good player is, that he is usually not good enough to give you a title. Unless his name is LeBron or Tim Duncan, your typical number one pick does not necessarily lead to being a title contender. Therefore, you need to be bad for several years. Which is not easy if you just drafted a good player
  • Let's face it: A general number one pick cannot make you a title contender. It makes you at best an eighth seed, aka 'the place where you do not want to be'
  • For an eighth seed on the other hand, a number one pick could be exactly what the team needs to make it a title contender
  • Over the last years, I have heard several times that a team is dumb for trying to be a number 8 seed. Examples are the Bucks of the last years, or the Hawks every year. Or the Pacers this year. 'This is a lost year, the team should just give up!' and the likes
  • Last year I heard several times 'these scrappy Suns should deserve the number one pick for trying so hard!'
  • I think that every smart basketball organization can become mediocre in 3 years. Even if the team would play in the depth of hell or any other place in North Dakota (hell actually might give you a huge home court advantage)
  • Furthermore, the lottery system leads to 30% of teams waving the white flag after less than half of the season. Hell, 30% of teams probably even wave the white flag before the season
  • This does not happen in European leagues, du to relegation. The last teams are even the one that fight the hardest to win. I know, this is not possible in the US system that in general likes to have neither poor nor rich people - sorry, I'll stop my bad jokes now...

Wednesday, October 22, 2014

why you do not want to be stuck in the middle

Hi everybody,
just a quickie. Hope it speaks for itself.
Seth Partnow (I'm never sure if that's a spelling mistake), collected some data https://t.co/3hrprry8vR
It's pretty awesome, because it means that I can make interesting plots without an hour-long copy and paste job. Just ask if you feel like looking at a certain aspect of the data.
Back to Morey ball: Morey ball tells us that it makes sense to shot only from the rim or from behind the three point line if possible (sounds intuitive? Ask Byron Scott).
Short side note: I'll try to post something longer about this topic, as it is not as simple as it sounds to get open shots at the rim or from three point land (duh)
Interestingly, there is even a positive correlation for the Morey Ball shots (more shots from 3 or rim means higher effective field goal percentage from there) and a negative correlation for midrange shots (more shots from midrange means lower effective field goal percentage from there). Both with a small but existent correlation of around 0.4 (or -0.4).
Click on me
Cheers,
Hannes

Wednesday, October 8, 2014

Good cops - bad cops in the NBA

Hi everybody,

just a quicky as I stumbled over plus minus data. There are a lot of adjusted Plus Minus (PM) stats, but the idea is always similar: A players PM is obviously related to a teams point differential. So I took all players that had during the season a PM of more than 100 or less than -100 and plotted their PM per minute against the Team +/- per game. I leave the analysis to you.
Enjoy,
Hannes
All Cops

Thursday, October 2, 2014

Why shooting only one free throw would not increase the average value - but slightly change the game

Hi,

just a short one regarding an idea that was first mentioned here:
http://espn.go.com/blog/truehoop/post/_/id/70581/hoopidea-is-one-trip-to-the-free-throw-line-enough
The idea is to change the free throw concept to speed things up. Instead of two free throws that are worth two points, we could as well shoot one free throw worth one point. Or three points, if it's for a three-point foul and so on...
The always amazing Nylon Calculus crew spun it a little further
http://nyloncalculus.com/2014/10/02/shooting-one-free-throw-offense/
calculating that the expected points per free throw attempt would not change (so basically the mean), but the variance would increase (due to less attempts).
My first reaction was to say 'but what about offensive rebounds!? You cannot rebound the first shot!'
This is true, but it doesn't change the math (too bad, I love to be a nitpicker...)

FT% - Free throw percentage of a player
OR% - Offensive rebound percentage
POR - Points we expect after an offensive rebound
Expected points two free throw situation (resulting points multiplied with their probability):
1       *(1-FT%)*FT% +
1       *FT%*(1-FT%)*(1-OR%) +
2       *FT%*FT% +
(1+POR) *FT%*(1-FT%)*OR% +
POR     *(1-FT%)*(1-FT%)*OR%
0       *(1-FT%)*(1-FT%)*(1-OR%)
=2*FT%+OR%*POR-FT%*OR%*POR

Expected points one free throw situation (resulting points multiplied with their probability):
2       *FT% +
POR     *(1-FT%)*OR% +
0       *(1-FT%)*(1-OR%)
=2*FT%+OR%*POR-FT%*OR%*POR

So, even this doesn't change.
The aspect of the game that it would really influence is the 'it is late in the game and we lead by three points' situation.
Because the opponent would not be able to make the first shot and intentionally miss the second shot - as there would be no second shot...

Monday, July 14, 2014

(Part of) How the world cup was won

Hello World,
I haven't written anything in a while (there is this thing called thesis looming...). But today for some reason I do not feel like working (I feel more like drinking Krombacher or something like that). After seeing everybody on the German team running his ass off yesterday (either that or getting punched in the face), I wanted to show a plot related to this. It shows all field players that played in at least 5 games (so you needed to at least reach the quarter finals). The x-axis is minutes per game and the  y-axis kilometer per 90 minutes (as always, click on the image to enlarge).
 
As you can see, there is a clear negative correlation between minutes per game and average speed. But if you focus on those players that played more than 80 minutes per game, you can see that all of Germany's offensive players and full-backs are running a lot. And Boateng and Hummels are also running quite much for centre-backs. (Note: In German full-back and centre-back is simply outside and inside defender - makes way more sense in my opinion...)
Now, I do not want to imply that this is the best way to play. After all, the Finals were super close and Argentina could have won as well. And if your strategy is to defend deep and then try to strike quickly, your offense doesn't need to run that much (so, if you want to bash Messi or brazilian one syllable strikers do it somewhere else please).
BUT, I wanted to show that a big part of the German game style is to run as much as possible as a team.
So, thanks to Schweinsteiger, Müller, Lahm and everybody else for playing great football the last 10 years (Klose since 2002!). I appreciate that you are running your asses off.

Cheers,
Hannes