putting some math to the problem of shot selection

Home for all your discussion of basketball statistical analysis.
Post Reply
gravityandlevity
Posts: 20
Joined: Sun Sep 25, 2011 6:56 am

putting some math to the problem of shot selection

Post by gravityandlevity »

Hi everyone,

I recently wrote a paper called "The problem of shot selection in basketball", in which I tried to create a theoretical model of the shot selection process and solve for the optimal time to take a shot. I hate to use this forum for self-promotion, but I would be very eager for the comments of anyone here. The paper is published in the open access journal PloS ONE, here. If you find the formatting a little annoying (I did), you might prefer the version on the arxiv.

My approach was to model the problem as an optimal stopping problem, similar to the more famous Secretary problem. The math gets a little dense, I'm afraid, but I'd be glad for anyone's opinion. You can also leave comments at the website for the paper itself at PLoS ONE.

There are also some pretty decent writeups of the paper at the Huffington Post and in the Toronto Star, which is worth checking out.

I should also mention that I was inspired to work on this problem by Matt Goldman and Justin Rao's talk at last years Sloan Sports Conference.

Thanks.
Crow
Posts: 10536
Joined: Thu Apr 14, 2011 11:10 pm

Re: putting some math to the problem of shot selection

Post by Crow »

Took a quick look; here are some high-level (non-math detail) comments:

A complex model that included offensive rebounding might be preferable, especially if one looked at offensive rebounding by part of the shot clock. Toward the end of the shot clock, offensive players probably are thinking of where to go for offensive rebounding opportunities and probably quicker to act on it- anticipatorily or at the shot- than earlier on given the general trend to use half or more of most shot clocks if it is not a fast break. Maybe they are more successful? That might make some difference in the optimal strategy.

It probably would be helpful to try to do a small study of "looks" and "defensive breakdowns".
I think a 10 game study of "looks" or "good looks" would probably give pretty good guidance on average opportunity rates. Counting "defensive breakdowns" would be important and would probably counterbalance the turnover rate to a fairly large degree. I think the average shot opportunity is probably one level for awhile and then goes up significantly after a breakdown for a second or maybe 2-3 and then goes back down if that breakdown isn't exploited or strung out and maybe turned into a worse breakdown. A good offense will pick away for a some defensive mistake that might be small and then they try to build on it. There are good teams who probably should try to pick a defense apart for a good long while and probably others who should realize they just aren't good enough at it to do it as much. It will partly depend on the team's very end of shot clock efficiency.

Looking at expected value it seems one should take a fastbreak inside shot or foul, a clean 3 pt look, an inside shot that isn't forced or a drive and maybe a really uncontested mid-range shot if you are a good shooter (anything with an expected yield above 1.2 pts) but they should still avoid anything average to well-contested.

One may also want to look at the impact of "working a defense" in terms of how it holds up over a game.
It also may be worth more than enough to pay time and expected value for probing for strategic miscalculations by a defense if you can say exploit it 5-10 times... after investing the time to find the strategic miscalculations.

Probably also need to think of how much effort needs to go into forcing enough fouls to win the bonus. That is also worth something, potentially a lot. The optimal shot clock strategy probably does change within quarters and between quarters. Referee behavior is a factor that would shade optimal behavior. Do the refs call more borderline fouls later in the shot clock? Maybe. Getting someone in particular in foul trouble may also pay good dividends.

General game strategy based on whether the score is close or you are well ahead or well behind should also inform your shot clock use strategy.

Game endurance and wear n tear on starters over a season are other factors that might justify playing slower than optimal shot strategy. From the coaches standpoint or the player's personal / selfish behavior.
DSMok1
Posts: 1119
Joined: Thu Apr 14, 2011 11:18 pm
Location: Maine
Contact:

Re: putting some math to the problem of shot selection

Post by DSMok1 »

Excellent work, Gravityandlevity!

The math is a little dense for me to critique, but the results seem intriguing. You noted that players seemed to be "undershooting" early in the shot clock--did you account for the time necessary to run the court and start looking for a shot? If the possession started with a steal, there is a much greater opportunity at the beginning of the shot clock than if it came off a made basket or dead ball, with defensive rebounds in between the two extremes. I don't believe that you controlled for possession start type at all? Do you know of any way to incorporate that? Also--the odds of a turnover when "pushing the ball" early in the shot clock seem to be higher than in the normal flow of the offense.

Those are the only things I noticed as potential areas for improvement/consideration when I read the article.
Developer of Box Plus/Minus
APBRmetrics Forum Administrator
Twitter.com/DSMok1
EvanZ
Posts: 912
Joined: Thu Apr 14, 2011 10:41 pm
Location: The City
Contact:

Re: putting some math to the problem of shot selection

Post by EvanZ »

Ryan Parker did some work a few years ago on that sort of stuff, Daniel:

http://www.basketballgeek.com/2009/06/2 ... n-the-nba/


Brian, looks very interesting. And congrats on getting it into PLoS One. That's a nice journal. (In fact, there was another bball article just last year - maybe it's the go-to journal right now?) Right now it's one of those tl;dr kind of things, but I'm going to give it some time over the weekend.

I'm thinking of incorporating the shot clock in my pbp code. Here are the rules for re-setting the clock:
c. The 24-second clock shall be reset to 24 seconds anytime the following occurs:
(1) Change of possession
(2) Ball contacting the basket ring of the team which is in possession
(3) Personal foul where ball is being inbounded in backcourt
(4) Violation where ball is being inbounded in backcourt
(5) Jump balls which are not the result of a held ball caused by the defense
d. The 24-second clock shall remain the same as when play was interrupted or reset to 14 seconds, whichever is greater, anytime the following occurs:
(1) Personal foul by the defense where ball is being inbounded in frontcourt
(2) Defensive three-second violation
(3) Technical fouls and/or delay-of-game warnings on the defensive team
(4) Kicked or punched ball by the defensive team with the ball being inbounded in the offensive team's front-court
(5) Infection control
(6) Jump balls retained by the offensive team as the result of a held ball caused by the defense
(7) All flagrant and punching fouls
Some of these are not so easy to parse. For example, whether the ball in inbounded in the backcourt of frontcourt is not explicitly stated in the pbp code. Were all these events actually accounted for in your study or were some of them deemed negligible?
gravityandlevity
Posts: 20
Joined: Sun Sep 25, 2011 6:56 am

Re: putting some math to the problem of shot selection

Post by gravityandlevity »

Thanks for the suggestions, everyone. Crow, your suggestion to take into account offensive rebound rates by shot clock time at which the shot was taken is particularly useful. I tried to be general in this paper, talking only about "quality of a given shot opportunity", without breaking down all the million factors that go into that.

DSMok1, I didn't make any effort to break things down by how the possession started. I lumped them all together, and threw out possessions for which I couldn't infer the shot clock time. As EvanZ noted, though, Ryan Parker has done some great preliminary work on that. Again, my study is pretty preliminary, and I was just trying to establish a theoretical formulation of the question "when is a shot good enough to take?"

Lumping all possessions together, my tentative conclusion is that players are overly reluctant to shoot early in the clock. This come from looking at shooting rates after the first 7 seconds or so of the clock. Shots taken during the first 7 seconds are dominated by fast breaks, and they look very different from the rest of the data. After 7 seconds, my assumption is that the offense is "set up" and shot opportunities arise randomly in time with some uniform rate. This is the most questionable assumption of my theory, and it very likely could use some refining.

The paper is a little daunting, but if you're just interested to see how the theory compares to NBA data, then skip to Figure 2. Figure 2 shows the average shot quality and shooting rate as a function of shot clock time. The theory that I developed suggests that the shooting rate is too low early in the shot clock.

Finally, for those who are interested in the journal, I can say that my experience submitting to PLoS ONE was very positive. I got a great editor, a very helpful referee review, and the whole thing was extremely quick. I went from initial submission to acceptance, with two rounds of review in between, in less than 4 weeks, which is pretty phenomenal. PLoS ONE requests a large publication fee to help pay for their service (about $1400), but I told them that I didn't have any funding and they gave me a complete fee waiver. They also prepared a press release for the paper once it was accepted. Plus, the paper is publicly accessible now, rather than behind some pay wall.

So if any of you are considering publishing any of your work, I would highly encourage giving PLoS ONE a try.
EvanZ
Posts: 912
Joined: Thu Apr 14, 2011 10:41 pm
Location: The City
Contact:

Re: putting some math to the problem of shot selection

Post by EvanZ »

I have a paper in PLoS Biology. Took about 7 months to get accepted. It was worth it though. Great journal. Not basketball related at all, but I'll put the link anyway:

http://www.plosbiology.org/article/info ... io.0060247
Guy
Posts: 75
Joined: Wed Jan 18, 2012 6:15 pm

Re: putting some math to the problem of shot selection

Post by Guy »

G&L: how did you arrive at the estimate of a 4.5 point gain for a team that shot optimally (i.e. more aggressively)? Do you apply the optimal shooting rate while keeping the average shot quality (fig. 2b) the same as it is in today's game?
gravityandlevity
Posts: 20
Joined: Sun Sep 25, 2011 6:56 am

Re: putting some math to the problem of shot selection

Post by gravityandlevity »

Guy: Yes, I applied the optimal shooting rate from the theory, given by equation (18), using the observed shot quality that I saw for NBA players, Fig. 2b. The average number of points per possession follows from the shooting rate R(t) according to the equation (22)
Guy
Posts: 75
Joined: Wed Jan 18, 2012 6:15 pm

Re: putting some math to the problem of shot selection

Post by Guy »

Perhaps I'm thinking about this incorrectly, but that seems like a problematic assumption. Right now, teams are shooting about 4% of the time at 15 seconds, and you're suggesting they take three times as many shots then (approx). Does it seem realistic that teams could do that with zero falloff in efficiency? After all, these are not randomly selected shots -- players are choosing whether or not to take them. You're hypothesizing that the players will do just as well shooting in 15-second situations in which they currently choose NOT to shoot, as in those 15-second situations in which they currently decide to shoot. That doesn't seem plausible to me. Surely the overall quality of shots at 15 minutes would decline if players were compelled to take shots they now feel are sub-optimal.

Another way to say this is that you are assuming that in the possessions that now produce a shot at 20 seconds, teams passed up a superior shooting opportunity (on average). But doesn't it seem more likely that those possessions that result in 20-second shots did not, in fact, have an average distribution of opportunities over the prior 19 seconds?

It seems logical to me that PPS will be higher earlier in the clock. Teams probably feel there is a minimal-quality shot (say, .9 points) that they can nearly always get off before time expires. They spend the time up to that attempting to get a higher-probability shot. At 18 seconds, you only take a good shot. As the clock winds down, you demand a lesser premium (and eventually, of course, you take what you can get). Is that a flawed strategy?
EvanZ
Posts: 912
Joined: Thu Apr 14, 2011 10:41 pm
Location: The City
Contact:

Re: putting some math to the problem of shot selection

Post by EvanZ »

It might be best to ignore shots taken after rebounds. And just focus on shots after a field goal is made.
mtamada
Posts: 163
Joined: Thu Apr 14, 2011 11:35 pm

Re: putting some math to the problem of shot selection

Post by mtamada »

EvanZ wrote:It might be best to ignore shots taken after rebounds. And just focus on shots after a field goal is made.
Right, that's my reaction. Possessions can begin in hopelessly heterogeneous ways: grabbing a defensive rebound may trigger a cripple lay-in, or alternatively you may find the opponent already has its defense set up. Steals are probably less heterogeneous, but are clearly way different possessions from the others, resulting in higher and quicker scoring opportunities than other types of possessions. Mixing all those possessions together is lumping apples and oranges together and hoping to make an apple pie.

Best to start with just apples, and do what EvanZ suggests.
EvanZ
Posts: 912
Joined: Thu Apr 14, 2011 10:41 pm
Location: The City
Contact:

Re: putting some math to the problem of shot selection

Post by EvanZ »

BTW, I used shot clock data from 82games for last season, and I could not find any correlation between average shot time and offensive rating or eFG%. I found a very slight correlation (R^2 ~0.05) for defense. I thought there would be a bigger relationship. Or I should say, I thought there would be some relationship.
EvanZ
Posts: 912
Joined: Thu Apr 14, 2011 10:41 pm
Location: The City
Contact:

Re: putting some math to the problem of shot selection

Post by EvanZ »

It's interesting in light of the other thread going on about refereed journals.

It would be interesting to know the background of the reviewers they found for this one (obviously, they are anonymous). This is a case where basketball (or basketball stats) expertise might change the review. Not that it would have prevented the paper from being accepted, but my guess is that some of these suggestions would have been made to Brian.
Crow
Posts: 10536
Joined: Thu Apr 14, 2011 11:10 pm

Re: putting some math to the problem of shot selection

Post by Crow »

EvanZ wrote:I have a paper in PLoS Biology. Took about 7 months to get accepted. It was worth it though. Great journal. Not basketball related at all, but I'll put the link anyway:

http://www.plosbiology.org/article/info ... io.0060247
"Not basketball related at all..."

Are you sure?

In your article you said:

"A century of scientific articles has advanced the concept that embryonic cells move (“migrate”) in an autonomous fashion such that, as time progresses, the cells and their progeny assemble an embryo. In sharp contrast, the motion of the surrounding extracellular matrix scaffold has been largely ignored/overlooked. We developed computational/optical methods that measure the extent embryonic cells move relative to the extracellular matrix. Our time-lapse data show that epiblastic cells largely move in concert with a sub-epiblastic extracellular matrix during stages 2 and 3 in primitive streak quail embryos. In other words, there is little cellular motion relative to the extracellular matrix scaffold—both components move together as a tissue. The extracellular matrix displacements exhibit bilateral vortical motion, convergence to the midline, and extension along the presumptive vertebral axis—all patterns previously attributed solely to cellular “migration.” Our time-resolved data pose new challenges for understanding how extracellular chemical (morphogen) gradients, widely hypothesized to guide cellular trajectories at early gastrulation stages, are maintained in this dynamic extracellular environment. We conclude that models describing primitive streak cellular guidance mechanisms must be able to account for sub-epiblastic extracellular matrix displacements."


I substitute in the terms basketball "players" and "team" for "embryonic cells" and "the surrounding extracellular matrix scaffold" respectively on a speculative basis to yield this new passage:

"... articles has advanced the concept that (players) move (“migrate”) in an autonomous fashion... In sharp contrast, the motion of the (team) scaffold has been largely ignored/overlooked. We (might want to develop) computational/optical methods that measure the extent (players) move relative to the (team). Our time-lapse data (might) show that (players) largely move in concert with a (team). In other words, there is (less) (player movement) relative to the (team) scaffold—both components move together as a tissue.

and soon on...


Does this construct sound at all interesting, coherent / intelligent or suggest further research? Maybe looking at year to year performance change at player level (by whatever metric) to year to year stat change for teams? Obviously the sum of the first should be equivalent to the team data if the metrics are the same at player and team level but what is the correlation for indvidual players vs the team? This is half-baked at best but I thought I'd at least juxtapose your "non-basketball" article with a basketball query / theory in case it might spur you to think of some opportunity to use your field of knowledge expertise in a new way on basketball.
EvanZ
Posts: 912
Joined: Thu Apr 14, 2011 10:41 pm
Location: The City
Contact:

Re: putting some math to the problem of shot selection

Post by EvanZ »

Crow, I am admittedly biased here, but that is one of the best comments I've ever read! :lol:

I can't even believe you essentially grasped the entire concept of the article. Do you have a bio background?

Maybe you're onto something there (or I am?).
Post Reply