A Bayesian marked spatial point processes model for basketball shot chart - De Gruyter

Page created by Randall Washington
 
CONTINUE READING
A Bayesian marked spatial point processes model for basketball shot chart - De Gruyter
J. Quant. Anal. Sports 2021; 17(2): 77–90

Research article

Jieying Jiao*, Guanyu Hu and Jun Yan

A Bayesian marked spatial point processes model
for basketball shot chart
https://doi.org/10.1515/jqas-2019-0106                              Good defense strategies depend on good understandings of
Received October 16, 2019; accepted November 29, 2020;              the offense players’ tendencies to shoot and abilities to
published online December 24, 2020                                  score. Reich et al. (2006) proposed hierarchical spatial
                                                                    models with spatially-varying covariates for shot attempt
Abstract: The success rate of a basketball shot may be
                                                                    frequencies over a grid on the court and for shot success
higher at locations where a player makes more shots. For a
                                                                    with shot locations fixed. Spatial point processes are
marked spatial point process, this means that the mark and
                                                                    commonly used to model random locations (e.g., Cressie
the intensity are associated. We propose a Bayesian joint
                                                                    2015; Diggle 2013). Miller et al. (2014) used a low dimen-
model for the mark and the intensity of marked point
                                                                    sional representation of related point processes to analyze
processes, where the intensity is incorporated in the mark
                                                                    shot attempt locations. Franks et al. (2015) combined
model as a covariate. Inferences are done with a Markov
                                                                    spatial and spatio-temporal processes, matrix factorization
chain Monte Carlo algorithm. Two Bayesian model com-
                                                                    techniques, and hierarchical regression models to analyze
parison criteria, the Deviance Information Criterion and the
                                                                    defensive skill. Many parametric models for spatial point
Logarithm of the Pseudo-Marginal Likelihood, were used
                                                                    process have been proposed in the literature, such as the
to assess the model. The performances of the proposed
                                                                    Poisson process (Geyer 1999), the Gibbs process (Møller
methods were examined in extensive simulation studies.
                                                                    and Waagepetersen 2003), and the log Gaussian Cox pro-
The proposed methods were applied to the shot charts of
                                                                    cess (LGCP) (Møller et al. 1998). When each point in a point
four players (Curry, Harden, Durant, and James) in the
                                                                    process is companied with a random variable or vector
2017–2018 regular season of the National Basketball As-
                                                                    known as mark, the resulting process is a marked point
sociation to analyze their shot intensity in the field and the
                                                                    process (e.g., Banerjee, Carlin, and Gelfand 2014, Ch. 8). A
field goal percentage in detail. Application to the top 50
                                                                    shot chart can be modeled by a spatial marked point pro-
most frequent shooters in the season suggests that the field
                                                                    cess with a binary mark showing the shot results.
goal percentage and the shot intensity are positively
                                                                         The frequency of successful shots may be higher at
associated for a majority of the players. The fitted param-
                                                                    locations where a player makes more shot attempts. This
eters were used as inputs in a secondary analysis to cluster
                                                                    positive association is expected from different angles. More
the players into different groups.
                                                                    frequent shots suggests higher competence level and,
Keywords: MCMC; model selection; sports analytic.                   hence, higher shooting accuracy. Higher accuracy also
                                                                    encourages more shooting since it means higher reward. In
                                                                    behavioral science, the matching law states that in-
                                                                    dividuals will allocate their behavior according to the
1 Introduction                                                      relative rates of reinforcement available for each option
                                                                    (Baum 1974; Staddon 1978). It predicts higher proportion of
Shot charts are important summaries for basketball
                                                                    three-point shots taken relative to all shots to be associated
players. A shot chart is a spatial representation of the
                                                                    with higher proportion of three-point shots scored relative
location and the result of each shot attempt by one player.
                                                                    to all shots scored (Alferink et al. 2009; Vollmer and
                                                                    Bourret 2000). The association might be more obvious for
                                                                    players who get fewer minutes and may be more selective
*Corresponding author: Jieying Jiao, Department of Statistics,      to “prove their worth”. It might be less so for players who
University of Connecticut, Storrs, CT, 06269, USA,
                                                                    have possession more often and may be less selective.
E-mail: jieying.jiao@uconn.edu. https://orcid.org/0000-0001-8585-
9938
                                                                    Team strategies could affect the association in two oppo-
Guanyu Hu and Jun Yan, Department of Statistics, University of      site directions. Players with high three-point shot accuracy
Connecticut, Storrs, CT, 06269, USA                                 are more likely to be arranged in areas beyond the
A Bayesian marked spatial point processes model for basketball shot chart - De Gruyter
78        J. Jiao et al.: A Bayesian marked spatial point processes model

three-point line. This is in favor of the positive association.       Section 4, including the MCMC algorithm and the two
On the other hand, optimal shot selection strategy requires           model selection criteria. Extensive simulation studies are
all shot locations to have the same marginal shot efficiency           summarized in Section 5 to investigate empirical perfor-
for the whole team (Skinner and Goldman 2015), which                  mance of the proposed methods. Applications of the pro-
may not be consistent with shot selections for individual             posed methods to four NBA players are reported in Section
players. A quantitative measure of the association for a              6. Section 7 concludes with a discussion.
player will be helpful for understanding the player’s per-
formance and suggesting directions for improvement at
both player level and team strategies level.                          2 Shot charts of NBA players
     We consider marked spatial point processes where the
mark distributions depend on the point pattern. There are             We focus on the 2017–2018 regular NBA season here. The
two approaches to model this dependence. Location                     website NBAsavant.com provides a convenient tool to
dependent models (Mrkvička et al. 2011) are observation               search for shot data of NBA players, and the original data
driven, where the observed point pattern is incorporated              are a consolidation between the NBA statistics (https://
into characterizing the spatially varying distribution of the         stats.nba.com) and ESPN’s shot tracking (https://
mark. Intensity dependent models (Ho and Stoyan 2008)                 shottracker.com). For each player, the available data con-
are parameter driven, where the intensity instead of the              tains information about each of his shots in this season
observed point pattern characterizes the distribution of the          including game date, opponent team, game period when
mark at each point in the spatial domain. For basketball              the shot was made (four quarters and a fifth period repre-
shot charts, no work has jointly modeled the intensity of             senting extra time), minutes and seconds left to the end of
the shot attempts and the results of the attempts.                    that period, success indicator or mark (0 for missed and 1
     The contribution of this paper is twofold. First, we             for made), shot type (two-point or three-point shot), shot
propose a Bayesian joint model for marked spatial point               distance, and shot location coordinates, among others.
processes to study the association between shot intensity             Euclidean shot distances were rounded to foot.
and shot accuracy. In particular, we use a non-                            We chose four famous players with quite different
homogeneous Poisson point process to model the spatial                styles: Stephen Curry, Kevin Durant, James Harden and
pattern of the shot attempts and incorporate the shot in-             LeBron James. Figure 1 shows Curry’s shot locations with
tensity as a covariate in the model of shot accuracy.                 the shot success indicators as a demonstration. The total
Inferences are made with Markov chain Monte Carlo                     number of shots was in the range of 740 (Curry) to 1409
(MCMC). The deviance information criterion (DIC) and the              (James). Curry has the highest proportion of three-point
logarithm of the pseudo-marginal likelihood (LPML) are                shots (57%) while James made the highest proportion of
used to assess the fitness of our proposed model. Our                 two-point shots (75%). The field goal percentage ranged
second contribution is the analyses of four representative            from 45 (Harden) to 52% (James). As shown in Figure 1,
players and the top 50 most frequent shooters in the 2017–            most of the shots were made close to the rim or out of but
2018 regular season of the National Basketball Association            close to the three-point line. This is expected since shorter
(NBA). The shot intensity of each player is captured by a set         distance should give higher shot accuracy for either two-
of intensity basis constructed from historical data which             point or three-point shots.
represents different shot types such as long two-pointers                  The shot chart of each player can be modeled by a
and corner threes, among others (Miller et al. 2014). For a           marked point process that captures the dependence be-
majority (about 80%) of the these players, the results                tween the binary mark and the intensity of the shots.
support a significant positive association between the shot            Through analyses of the selected NBA players, we address
accuracy and shot intensity. The fitted coefficients are then           the following questions: How to characterize the shot
used as input for a clustering analysis to group the top 50           pattern of individual players? What are the factors, such as
most frequent shooters in the season, which provides in-              shot location, time remaining, period of the game, and the
sights for game strategies and training management.                   level of the opponent, that may affect the shot accuracy? Is
     The rest of the paper is organized as follows. In Section        there a positive association between shot accuracy and
2, the shot charts of selected players from the 2017–2018             shot intensity of some players? How often is the positive
NBA regular season, along with research questions that                association seen among the most frequent shooters? Is this
such data can help answer, are introduced. In Section 3, we           positive association different between two-point versus
develop the Bayesian joint model of marked point process.             three-point shots? Can the players be grouped by their
Details of the Bayesian computation are presented in                  shooting styles? These questions may not be completely
J. Jiao et al.: A Bayesian marked spatial point processes model         79

                                                                      Curry
       missed
       made

                                                                                         Figure 1: Shot charts of Curry in the
                                                                                         2017–2018 regular NBA season.

answered, but even partial answers would shed lights on        function of the process. The likelihood of the observed
understanding the game and the players for better game         locations S is
strategies and training management.
                                                                                   N
                                                                                   ∏ λ(si )exp( − ∫λ(s)ds).
                                                                                   i=1                B

3 Bayesian marked spatial point                                     Covariates can be incorporated into the intensity by
                                                               setting
  process model
                                                                                   λ(si ) = λ0 exp(X⊤ (si )β),                   (1)
The observed shot chart of a player can be represented by
                                                               where λ0 is a baseline intensity, X(si ) is a p × 1 spatially
(S, M), where S is the collection of the locations of shot
                                                               varying covariate vector, and β is the corresponding coef-
attempts (x and y coordinates) and M is the vector of the
                                                               ficient vector.
corresponding marks (1 means success and 0 means fail-
                                                                   Next we consider modeling the success indicator
ure). Assuming that N shots were observed, we have S =
                                                               (mark). It is natural to suspect that the success rate of shot
(s1 , s2 , …, sN ) and M = (m(s1 ), m(s2 ), …, m(sN )).
                                                               attempts is higher at locations with higher shot intensity,
                                                               suggesting an intensity dependent mark model. In partic-
                                                               ular, the success indicator is modeled by a logistic
3.1 Marked spatial point process                               regression

We propose to model (S, M) by a marked spatial point                           m(si )|Z(si ) ∼ Bernoulli(θ(si )),
                                                                                                                                 (2)
process. The shot locations S are modeled by a non-                            log it(θ(si )) = ξ λ(si ) + Z⊤ (si )α ,
homogeneous Poisson point process (e.g., Diggle 2013).
                                                               where λ(si ) is the intensity defined in (1) with a scalar co-
Let B ⊂ R2 be a subset of the half basketball court on
                                                               efficient ξ, Z(si ) is a q × 1 covariate vector evaluated at ith
which we are interested in modeling the shot intensity. A
                                                               data point (Z does not need to be spatial, like period
Poisson point process is defined such that N(A) =               covariates), and α is a q × 1 vector of coefficient.
∑Ni=1 1(si ∈ A) for any A ⊂ B follows a Poisson distribution       With Θ = (λ0 , β, ξ , α), the joint likelihood for the
with mean λ(A) = ∫A λ(s)ds, where λ(⋅) defines an intensity     observed marked spatial point process (S, M) is
80          J. Jiao et al.: A Bayesian marked spatial point processes model

                         N
          L(Θ|S, M)∝ ∏ θ(si )m(si ) (1 − θ(si ))1−m(si )                 4.2 Bayesian model comparison
                         i=1
                               N
                                                                  (3)
                        ×( ∏ λ(si ))exp( − ∫λ(s)ds).                     To assess whether the intensity term is necessary in the mark
                               i=1               B                       model (2), model comparison criteria is needed. Within the
                                                                         Bayesian framework, DIC (Spiegelhalter et al. 2002) and
                                                                         LPML (LPML; Geisser and Eddy 1979; Gelfand and Dey 1994)
                                                                         are two well-known Bayesian criteria for model comparison.
3.2 Prior specification                                                  Using the method of Zhang et al. (2017), each criterion for
                                                                         the proposed joint model can be decomposed into one
Vague priors are specified for model parameters. For λ0, the
                                                                         for the intensity model and one for the mark model condi-
gamma distribution is conjugate prior (e.g., Leininger et al.
                                                                         tioning on the point pattern for more insight on the model
2017). For β, ξ, or α, there is no conjugate prior and we
                                                                         comparison.
specify a vague, independent normal prior. In summary,
                                                                              The DIC for the joint model is
we have                                                                                           ⃒⃒
                                                                                     DIC = Dev(Θ⃒⃒S, M) + 2pD ,
                               λ0 ∼ G(a, b),                                                                      ⃒⃒               (6)
                                                                                      pD = Dev(Θ|S, M) − Dev(Θ⃒S,  ⃒ M),
                             β ∼ MVN(0, σ 2β Ip ),
                                                                  (4)
                             ξ ∼ N(0, σ 2ξ ),                            where the deviance Dev is the negated loglikelihood
                                                                         function in Equation (3), Dev is the mean of the deviance
                             α ∼ MVN(0, σ 2α Iq ),                       evaluated at each posterior draw of the parameters, Θ is the
where G(a, b) represents a Gamma distribution with shape                 posterior mean of Θ, and pD is known as the effective
a and rate b, respectively, MVN(0, Σ) is a multivariate                  number of parameters. For the intensity model and the
normal distribution with mean vector 0 and variance ma-                  conditional mark model, the DIC can be computed with
trix Σ, (a, b, σ2β , σ2ξ , σ 2α ) are hyper-parameters to be specified,   deviance, respectively,
and Ik is the k-dimensional identity matrix.                                                    ⃒⃒        N
                                                                           Devintensity (λ0 , β⃒⃒S) = −2( ∑ log λ(si ) − ∫λ(s)ds),
                                                                                                          i=1               B
                                                                                           ⃒⃒          N
                                                                         Devmark (λ, α, ξ ⃒⃒M, S) = −2 ∑ log f (m(si )|S ; λ(si ), α, ξ , Z(si )),
4 Bayesian computation                                                                                  i=1

                                                                                                                                               (7)
4.1 The MCMC sampling schemes
                                                                         where λ = (λ(s1 ), λ(s2 ), …, λ(sN )), and f (m(si )|λ(si ),
                                                                         α, ξ , Z(si )) is the conditional probability mass function of
The posterior distribution of Θ is
                                                                         m(si) given (λ(si ), α, ξ , Z(si )). Clearly, the DIC for joint
                 π(Θ|S, M) ∝ L(Θ|S, M)π(Θ),                       (5)    model is the summation of the DIC for the intensity model
                                                                         and the DIC for the conditional mark model. Models with
where π(Θ) = π(λ0 )π(β)π(ξ )π(α) is the joint prior density
                                                                         smaller DIC are better models.
as specified in (4). In practice, we used vague priors
                                                                                Calculation of the LPML for point process models is
with hyper-parameters σ2β = σ2ξ = σ 2α = 100 and a = b = 0.01
                                                                         challenging because the usual conditional predictive
in (4).
                                                                         ordinate (CPO) based on the leaving-one-out assessment is
     To sample from the posterior distribution of Θ in (5), an
                                                                         not applicable where the number of points N is random. Hu
Metropolis–Hasting within Gibbs algorithm is facilitated
                                                                         et al. (2019) recently suggested a Monte Carlo method to
by R package nimble (de Valpine et al. 2017). The loglike-
                                                                         approximate the LPML for the intensity model as
lihood function of the joint model used in the MCMC iter-
ation is directly defined using the RW_llFunction()                                                       N
                                                                                       ̂ intensity = ∑ logλ̃(si ) − ∫λ(s)ds ,
                                                                                      LPML                                                     (8)
sampler. The integration in the likelihood function (3) does                                            i=1             B
not have a closed-form. It needs to be computed with a                                                          −1
Riemann approximation by partitioning B into a grid with a               where λ̃(si ) = (K1 ∑Kk=1 λ(k) (si )−1 ) , λ(s) = K1 ∑Kk=1 λ(k) (s), and
sufficiently fine resolution. Within each grid box, the                    {λ(k) (si ) : k = 1, 2, …, K} is a posterior sample of size K of the
integrand λ(s) is approximated by a constant. Then the                   parameters from the MCMC. The LPML for the conditional
integration of λ(s) becomes a summation over all of the grid             mark model can be calculated as usual (Chen, Shao, and
boxes.                                                                   Ibrahim 2000, Ch. 10). For the ith data point, define
J. Jiao et al.: A Bayesian marked spatial point processes model   81

       ̂ −1 = 1 ∑                       1
                 K
                                                                           each data set, a MCMC was run for 20,000 iterations with
       CPO                                                      ,
          i
              K b=1 f (m(si )|λ(K) (si ), α(K) , ξ (K) , Z(si ))           the first 10,000 treated as burn-in period. For each
                                                                           parameter, the posterior mean was used as the point esti-
where {α(K) , ξ (K) : k = 1, 2, …, K} is a posterior sample of size
                                                                           mate and the 95% credible interval was constructed with
K of the parameters from the MCMC. Then the LPML on
                                                                           the 2.5% lower and upper quantiles of the posterior sample.
mark model is
                                                                                Tables 3 and 4 in Appendix summarize the simulation
                                    N
                                    ̂ i) .
                     ̂ mark = ∑ log(CPO                                    results for the scenarios of standard normal Z2 and Ber-
                    LPML                                             (9)
                                   i=1                                     noulli Z2, respectively. The empirical bias for all the set-
                                                                           tings are close to zero. The average posterior standard
   The LPML for the joint model is then calculated as the
                                                                           deviation from the 200 replicates is very close to the
sum of (8) and (9). Models with higher LPML are better
                                                                           empirical standard deviation of the 200 point estimates for
models.
                                                                           all the parameters, suggesting that the uncertainty of the
                                                                           estimator are estimated well. Consequently, the empirical
                                                                           coverage rates of the credible intervals are close to the
                                                                           nominal level 0.95. As α1 increases, the variation increases
5 Simulation studies
                                                                           in the mark parameter estimates but does not change in the
                                                                           intensity parameter estimates. As λ0 increases, the varia-
To investigate the performance of the estimation, we
                                                                           tions of the estimates for both intensity and mark param-
generated data from a non-homogeneous Poisson point
                                                                           eters get lower. Between the continuous and binary cases
process defined on a square B = [ −1, 1] × [ −1, 1] with in-
                                                                           of Z2, the variation in the estimates is higher in the latter
tensity λ(si ) = 100λ0 exp(β1 xi + β2 yi ), where si = (xi , yi ) ∈ B
                                                                           case, especially for the coefficient of Z2.
is the location for every data point. For each si, i = 1, …, N,
the mark m(si) follows a logistic model with two covariates
in addition to λ and intercept:
                                                                           6 NBA players shot chart analysis
                         m(si ) ∼ Bern(pi ),
                                                                    (10)
            log it(pi ) = ξ λ(si ) + α0 + α1 Z 1i + α2 Z 2i .              6.1 Covariates construction
    The parameters of the model were designed to give                      To capture the shot styles of individual players in their shot
point counts that are comparable to the basketball shot                    intensity model, we follow Miller et al. (2014) to construct
chart data. We fixed (β1 , β2 ) = (2, 1), ξ = 0.5, α0 = 0.5, and           basis covariates that are interpreted as archetypal in-
α2 = 1. Three levels of α1 were considered, α1 ∈ {0.8, 1, 2}, in           tensities or “shot types” used by the players. The focus is on
order to compare the performance of the estimation pro-                    the 35 ft by 50 ft rectangle on the side of the backboard in
cedure under different magnitudes of the coefficients in the                the offensive half court. The origin of the Cartesian co-
mark model. Two levels of λ0 were considered, λ0 ∈ {0.5, 1},               ordinates (x, y) is replaced at the bottom left corner so that
which controls the mean of the number of points on B. It is                x ∈ [0, 50] and y ∈ [0, 35]. The rectangle was evenly parti-
easy to integrate in this case the intensity function over B to            tioned into 50 × 35 grid boxes of 1 ft by 1 ft. Our bases
get the average number of points being 850 and 1700,                       construction is slightly different from that of Miller et al.
respectively, for λ0 = 0.5 and 1. The numbers are approxi-                 (2014) in the preparation for the Nonnegative matrix
mately in the range of the NBA basketball shot charts in                   factorization (NMF). First, we used a kernel estimation
Section 2. In the mark model, covariate Z1 was generated                   instead of an LGCP model to estimate the 50 × 35 intensity
from the standard normal distribution; two types of Z2 were                matrix of each individual players, which is easier to
considered, standard normal distribution or Bernoulli with                 compute and more accurate in the sense of intensity fitting
rate 0.5. The resulting range of the Bernoulli rate of the                 accuracy. Second, we used historical data instead of the
marks was within (0.55, 0.78) for all the scenarios.                       current season data. In particular, a kernel estimate of the
    For each setting, 200 data sets were generated. R                      50 × 35 intensity matrix for each of the 407 players in the
package spatstat (Baddeley et al. 2005) was used to                        previous season (2016–2017) who had made over 50 shots
generate the Poisson point process data with the given                     was used as input for the NMF. As in Miller et al. (2014), we
intensity function. The priors for the model parameters                    obtained 10 bases using R package NMF (Gaujoux and
were set to be (4) with the hyper-parameters σ 2β = σ2ξ = σ2α =            Seoighe 2010).
100 and a = b = 0.01. The grid used to calculate the inte-                      Figure 2 displays the 10 nonnegative matrix bases that
gration in likelihood function had resolution 100 × 100. For               can be used as covariates for the intensity matrix fitting.
82          J. Jiao et al.: A Bayesian marked spatial point processes model

Figure 2: Intensity matrix bases heat plots.

They are similar to those in the literature (Franks et al. 2015;        and non-spatial covariates such as seconds left to the end
Miller et al. 2014). Each basis is nicely interpreted as a              of the period, dummy variables for five different periods
certain shot type. For example, basis 1 is long two-points,             with first period as reference, and the indicator of opponent
bases 2–3 are left/right wing threes, bases 4–5 are left/               made to the playoff in the last season.
right/center restricted area two-points, basis 7 is top of key
threes, basis 8 is center threes, basis 9 is corner threes, and
basis 10 is mid-range twos. When used as covariates in                  6.2 Model comparison
modeling individual shot intensity, their coefficients
characterize the shooting style of each player.                         The joint model (1)–(2) was fitted for each player with the
     The influence of intensity on shot accuracy might be               hyper-parameters in (4) set as σ2β = σ 2ξ = σ 2α = 100 and
different for different shot type. Players’ shot selection may          a = b = 0.01. The numerical integration in evaluating the
be biased towards three point shot for higher reward                    joint log-likelihood (3) was based on the same 50 × 35 grid
(Alferink et al. 2009; Skinner and Goldman 2015). This can              as that used in constructing the basis shot styles from NMF.
result in higher intensity for three-point shot at locations            To check the importance of intensity as covariate in the
with not high accuracy. To capture this tendency, an                    mark component, we also fitted the model with the
interaction term between the intensity and the shot type is             restriction ξ = 0. For each model fitting, 60,000 MCMC it-
introduced to the mark model. In addition to intensity and              erations were run. The first 20,000 were discarded as the
interaction term between intensity and shot type, other                 burn-in period and the rest were thinned by 10, which led to
covariates in the mark model include distance to the basket             an MCMC sample of size 4000. The trace plots of the MCMC
J. Jiao et al.: A Bayesian marked spatial point processes model       83

were checked and the convergence of all the parameters               all four players, which are intensity independent model for
were confirmed. The reported results were obtained from a             Curry and intensity dependent model for other three
second run after insignificant covariates were removed to             players, can reduce the MSE by 2.7, 1.3, 2.0, and 7.0%.
avoid possible collinearity among some variables; for
example, basis 6 (restricted area two-points) appears to be
well approximated by a combination of basis 4 (left                  6.3 Fitted results
restricted area two-points) and basis 5 (right restricted area
two-points).                                                         Table 2 summarizes the posterior mean, posterior standard
     Table 1 summarizes the DIC and LPML for the full joint          deviation, and the 95% highest posterior density (HPD)
model and its two components. The smallest absolute                  credible intervals for the regression coefficients in the
difference is 8.6 in DIC and 4.2 in LPML for Durant; the             models for Curry, Durant, Harden, and James as selected by
largest absolute difference is 41.2 in DIC and 20.4 in LPML          the DIC and LPML. Only significant covariates are dis-
for James. The DIC has a rule of thumb similar to AIC in             played as determined by whether or not the 95% HPD
decision making (Spiegelhalter et al. 2002, p. 613): a dif-          credible intervals cover zero in the first run. The reported
ference larger than 10 is substantial and a difference               results were from the second run after insignificant cova-
about 2–3 does not give an evidence to support one model             riates were removed.
over the other. For LPML, a difference less than 0.5 is “not              The coefficients of the 10 basis shot styles in the
worth more than to mention” and larger than 4.5 can be               intensity model describe the composition of each indi-
considered “very strong” (Kass and Raftery 1995). With               vidual player’s shot style. After being exponentiated,
these guidelines applied to DIC and LPML, the mark                   they represent a multiplicative effect on the baseline
model with shot intensity included as a covariate has a              intensity. So they are comparable across players as a
clear advantage relative to the model without it for                 relative scale. The four players are quite different in the
Durant, Harden, and James, but not for Curry, an inter-              coefficients of a few well-interpreted bases. Curry’s rate
esting result which will be discussed in the next subsec-            of corner threes was the highest among the four. Durant
tion. The difference in DIC and LPML between the models              has the least rate of corner threes and highest rate of
with and without ξ = 0 comes from the mark component.                long/mid-range two-pointers. Harden had the least rate
The two criteria for the intensity component are almost              of long two-pointers and highest rate of top of key threes.
the same with and without ξ = 0. This is expected because            Curry and Harden had less two point shots but more
the marks may contain little information about the in-               three point shots than Durant and James. James seemed
tensities, and intensity fitting results are not influenced by         to prefer to shot on the left side of court for three point
the mark model significantly.                                         shots more than the other three players. All four had high
     In order to have a direct comparison of improvement of          rate of center threes. Figure 3 (upper) shows the fitted
mark model by using the preferred model, we calculate the            intensity surfaces of the four players. These results echo
mean squared error (MSE) of fitted mark models with and              the findings in earlier works (Franks et al. 2015; Miller
without intensity as a covariate. The preferred models for           et al. 2014).

Table : Summaries of DIC and LPML for the models for Curry, Durant, Harden, and James with and without ξ = .

                                                                 Curry                Durant               Harden                  James

Joint model             DIC                ξ ≠                .                .                .                  .
                                           ξ=                 .                .                .                  .
                        LPML               ξ ≠               −.               −.                −.                 −.
                                           ξ=                −.               −.                −.                 −.
Intensity               DIC                ξ ≠                .                .                  .                −.
                                           ξ=                 .                .                  .                −.
                        LPML               ξ ≠                −.                −.                  −.                  .
                                           ξ=                 −.                −.                  −.                  .
Mark                    DIC                ξ ≠                .                .                .                 .
                                           ξ=                 .                .                .                 .
                        LPML               ξ ≠                −.                −.                −.                 −.
                                           ξ=                 −.                −.                −.                 −.
84         J. Jiao et al.: A Bayesian marked spatial point processes model

Table : Estimated coefficients in the joint models for Curry, Durant, Harden, and James.

Player          Model             Covariates                           Posterior mean      Posterior SD       % Credible Interval

Curry           Intensity         Baseline (λ)                                 .            .              (., .)
                                  Basis  (long two-pointers)                   .            .              (., .)
                                  Basis  (right wing threes)                   .            .              (., .)
                                  Basis  (left wing threes)                    .            .              (., .)
                                  Basis  (left restricted area)                .            .              (., .)
                                  Basis  (top of key threes)                   .            .              (., .)
                                  Basis  (center threes)                       .            .              (., .)
                                  Basis  (corner threes)                       .            .              (., .)
                Mark              Intercept                                    −.            .             (−., .)
                                  Distance                                     −.            .            (−., −.)
Durant          Intensity         Baseline (λ)                                 .            .              (., .)
                                  Basis  (long two-pointers)                   .            .              (., .)
                                  Basis  (right wing threes)                   .            .              (., .)
                                  Basis  (left wing threes)                    .            .              (., .)
                                  Basis  (left restricted area)                .            .              (., .)
                                  Basis  (restricted area)                    −.            .            (−., −.)
                                  Basis  (top of key threes)                   .            .              (., .)
                                  Basis  (center threes)                       .            .              (., .)
                                  Basis  (corner threes)                      −.            .            (−., −.)
                                  Basis  (mid-range twos)                     .            .              (., .)
                Mark              Intercept                                    −.            .            (−., −.)
                                  Intensity (λ)                                 .            .              (., .)
                                  Distance                                     −.            .            (−., −.)
Harden          Intensity         Baseline (λ)                                 .            .              (., .)
                                  Basis  (long two-pointers)                  −.            .            (−., −.)
                                  Basis  (right wing threes)                   .            .              (., .)
                                  Basis  (left wing threes)                    .            .              (., .)
                                  Basis  (left restricted area)                .            .              (., .)
                                  Basis  (restricted area)                     .            .              (., .)
                                  Basis  (top of key threes)                   .            .              (., .)
                                  Basis  (center threes)                       .            .              (., .)
                                  Basis  (mid-range twos)                     .            .              (., .)
                Mark              Intercept                                    −.            .            (−., −.)
                                  Intensity (λ)                                 .            .              (., .)
James           Intensity         Baseline (λ)                                 .            .              (., .)
                                  Basis  (long two-pointers)                   .            .              (., .)
                                  Basis  (left wing threes)                    .            .              (., .)
                                  Basis  (left restricted area)                .            .              (., .)
                                  Basis  (restricted area)                     .            .              (., .)
                                  Basis  (top of key threes)                   .            .              (., .)
                                  Basis  (center threes)                       .            .              (., .)
                                  Basis  (corner threes)                       .            .              (., .)
                                  Basis  (mid-range twos)                     .            .              (., .)
                Mark              Intercept                                    −.            .            (−., −.)
                                  Intensity (λ)                                 .            .              (., .)
                                  Distance                                     −.            .            (−., −.)

    The results from the mark model conditioning on the                players excluding Curry, shot accuracy was higher where
intensity are the major contribution of this work. All non-            they shot more frequently. The interaction between the
spatial covariates were insignificant and were dropped                 intensity of shot type (two- vs. three-point) was not sig-
from the model, except shot distance. The coefficient of the           nificant for any player, suggesting that, for those whose
intensity was found to be significantly positive for Durant,           shot frequency and shot accuracy were positively associ-
Harden, and James, but not for Curry. That is, for the                 ated, the association was not influenced directly by shot
J. Jiao et al.: A Bayesian marked spatial point processes model        85

                                                                                        Figure 3: Fitted shot intensity surfaces
                                                                                        (upper) and expected score surfaces (lower)
                                                                                        of Curry, Durant, Harden and James on the
                                                                                        same scale. Redder means higher.

rewards. The magnitude of coefficient of the intensity          Harden’s model, he could make more three-point shots for
shows how strong this dependence is. The association is         higher rewards.
much weaker (about a half) for James compared to Durant             Curry’s mark model only included a single covariate
and Harden. Shot distance was found to have a signifi-          shot distance with a significantly negative coefficient. At
cantly negative effect on shot accuracy for Curry, Durant,      shot locations with the same shot distance, Curry’s shot
and James, but not for Harden. The presence of both shot        accuracy was not affected by his shot frequency, which
distance and intensity in the shot accuracy model means         makes him hard to guard against for a defense team. From
that among locations with the same accuracy but different       an alternative direction of reasoning, Curry’s results sug-
rewards (two- vs. three-point), three-point locations tend to   gest that he did not shoot more often at locations where his
have higher intensities. This reflects the bias of shooting     shot accuracy was higher, which might not be optimal from
intensity to three-point shot due to higher rewards (Alfer-     the team strategy point of view. The might be due to his
ink et al. 2009). Since shot distance was not significant in     injury in that season and reduced time on court. He could
86        J. Jiao et al.: A Bayesian marked spatial point processes model

make more shots where his accuracy is higher to improve               distance was found to be significantly negative in every
scoring efficiency.                                                   model.
     The fitted mark model allows combining shot accu-                     The estimated coefficients in the joint model can be
racy and shot frequency to construct an expected score                used as features to cluster the players into groups. With
map for each player; see Figure 3 (lower). This plot is more          Curry added in, estimates from a total of 51 players were
informative than a shooting accuracy plot because the                 used as inputs to a cluster analysis. Both clustering for shot
latter would contain no value at locations where there                patterns based on the estimated coefficients in the intensity
were few or no shots. Curry had a more obvious scoring                model and clustering for the accuracy–intensity relation-
pattern of corner threes among the four. Durant and James             ship based on the mark model given intensity were
had more two point scores and less three point scores than            considered. For the shot pattern clustering, only 10 co-
Curry and Harden. Curry and Harden’s two point scores                 efficients of the basis styles, with the baseline intensity
were more concentrated in the restricted area than Durant             excluded, were used to focus on the distribution of the
and James.                                                            pattern instead of the total count of shots. The clustering of
     To get an idea about the intensity dependent effect              the accuracy–intensity relationship clustering only used
on shot accuracy averaged over top players, we analyzed               the coefficients of intensity and shot distance in addition to
all shots attempted by the top 20 most frequent shooters,             the intercept because the other coefficients were found to
which cover Harden and James, but not Curry and                       be insignificant for most of the players. We used the hier-
Durant. The 20 players’ data were pooled and treated as               archical clustering method using the minimum variance
one virtual player. Due to computational feasibility, we              criterion of Ward (1963) as implemented in R (Murtagh and
could not include more players in the pool. The fitted                Legendre 2014).
coefficient of the intensity divided by 20 gives an “elite                 Figure 4a displays the results of clustering the 51
average” of the intensity dependent effect, which is                  players by their shot patterns into five groups. The first
1.023. Compared with the results in Table 2, Harden and               group only contains three players who made mostly two-
Durant’s fitted coefficients were above the average,                    point shots. The second group includes, interestingly,
while James and Curry’s were below the average (Curry’s               Curry, Harden, and James. The closest players to Curry,
fitted coefficient can be treated as 0 since his result fa-             Durant, and James were, respectively, Kyrie Irving, Kyle
vors intensity independent model). The ranking relative               Lowry, and Damian Lillard. Players in this group had
to the elite average could be a measure in assessing the              relative small coefficients for bases 1 and 10, and large
players’ efficiency in shot location selection. Players                coefficients for bases 3 and 8. That is, they had less long/
with a fitted coefficient below the elite average might                 mid-range twos and more threes, especially left wing
have room to improve their score efficiency through shot               threes. Players in the third group, which includes Durant,
selection.                                                            had large coefficients for bases 1 and 10, showing that they
                                                                      had more long/mid-range two-pointers. The closest player
                                                                      to Durant was Kemba Walker. Group four includes players
6.4 Application to top 50 most frequent                               with small coefficient for basis 6 and large coefficient for
    shooters                                                          basis 9, which means that they had less two-pointers from
                                                                      the restricted area and more corner threes. The last group
We further applied the same analysis to each of the top 50            contains to players with small coefficients for bases 3 and
most frequent shooters in the 2017–2018 regular season.               9, and large coefficient for basis 10, indicating less left wing
The number of shots of the 50 players ranged from 813                 threes and corner threes, but more mid-range twos.
(Andre Drummond) to 1,517 (Russell Westbrook). Among                       The clustering results of the 51 players by the charac-
them, 40 players’ data favored the intensity dependent                teristics of their shot accuracy in relation to their shot in-
model (ξ ≠ 0) in terms of DIC and LPML. Their estimated               tensity are shown in Figure 4b. Group two has Harden and
coefficients of the intensity in the mark model were all               other players whose mark model contained the shot in-
positive; the interactions between the intensity and the              tensity but not distance. Group four, which includes Curry,
shot type (two- vs. three-point) were all not significantly            contains half of the players whose shot intensity was
different from zero. That is, 80% of the most frequent                insignificant in their mark model. Group five is the largest
shooters in that season had positive association between              group, which includes Durant and James. The players in
shot intensity and shot accuracy, and the association did             this group had significant shot distance effect on their ac-
not vary with shot rewards. For the 10 players who had                curacy. Most of them had intensity in the mark model with
intensity independent mark models similar to Curry, shot              a relatively small coefficients, and five of them had
J. Jiao et al.: A Bayesian marked spatial point processes model          87

Figure 4: Hierarchical clustering of 51 NBA players into five groups based on fitted coefficients in the intensity model and the mark model.

intensity insignificant. The first group includes players                 the shot intensity and shot accuracy was reported. The
with intensity but not distance in the mark model, which                association did not vary significantly according to the
is similar to Group two, but the magnitude of the coef-                 shot rewards. Players whose shot intensity was not found
ficient for the intensity was the largest among all the                  to affect their shot accuracy (e.g., Curry) may be hard to
players, suggesting the strongest dependence between                    defend against. From the offense perspective, these
shot intensity and shot accuracy. Players here were more                players could score more by making more shots where
likely to shoot at locations with higher accuracy rates.                they shot more frequently. The cluster analyses based on
The third group has only two players, Simmons and                       the fitted coefficients characterizing the shot pattern and
Drummond, whose coefficients for shot distance were                      shot accuracy are quite unique. Unlike other cluster an-
much larger than others’ in magnitude, which was ex-                    alyses, (e.g., Zhang et al. 2018), the data input here are not
pected because the two players shot mostly in the                       directly observed but estimated from fitting a model to the
restricted area.                                                        shot charts. Consequently, less obvious insights could be
                                                                        discovered.
                                                                            A few directions of further work are worth investi-
7 Discussion                                                            gating. Our proposed model is univariate in the sense that
                                                                        each player is modeled separately. A full hierarchical
We proposed a Bayesian marked spatial point process to                  model for pooled data from multiple players in one season
model both the shot locations and shot outcomes in NBA                  may be useful with a random effect at the player level for
players’ shot charts. Basis shot styles constructed from                certain parameters. The number of basis shot styles was set
the NMF method (Miller et al. 2014) were included as                    to 10 as suggested by Miller et al. (2014). It would be
covariates in the intensity for the Poisson point process               interesting to find an optimal number of basis through
model and the logistic model for shot outcomes. For a                   model comparison criteria like DIC and LPML. An impor-
majority of the top players, a positive association between             tant factor for shot accuracy is the shot clock time
88         J. Jiao et al.: A Bayesian marked spatial point processes model

remaining (Skinner 2012), but it is not available in the               Author contribution: All the authors have accepted
dataset we obtained. It should be added to the mark model              responsibility for the entire content of this submitted
if available. Our spatial Poisson process model formulates             manuscript and approved submission.
a linear relationship between the spatial covariates and the           Research funding: None declared.
log intensity, which cannot capture more complicated                   Conflict of interest statement: The authors declare no
spatial trend of the intensity of spatial point pattern.               conflicts of interest regarding this article.
Including some Bayesian non-parametric methods like
finite mixture model (Miller and Harrison 2018) may help                Appendix
increase the accuracy of the estimation of spatial point
pattern.                                                               This section shows the tables of simulation results.

                                                                                              ̂ and coverage rate (CR) of % credible
Table : Summaries of the bias, standard deviation (SD), average of the Bayesian SD estimate (SD),
intervals when Z is continuous: ξ = α = ., α = , (β, β) = (, ) and Z  ∼ N(, ).

                                                                             λ = .                                             λ = 

α           Model          Para          Bias           SD           c
                                                                      SD          CR          Bias          SD           c
                                                                                                                         SD           CR

.        Intensity        λ            .         .         .        .         .         .         .         .
                            β           −.         .         .        .        −.         .         .         .
                            β           −.         .         .        .        −.         .         .         .
           Mark             ξ             .         .         .        .         .         .         .         .
                            α            .         .         .        .         .         .         .         .
                            α            .         .         .        .         .         .         .         .
                            α            .         .         .        .         .         .         .         .
          Intensity        λ            .         .         .        .         .         .         .         .
                            β           −.         .         .        .        −.         .         .         .
                            β           −.         .         .        .        −.         .         .         .
           Mark             ξ             .         .         .        .         .         .         .         .
                            α            .         .         .        .        −.         .         .         .
                            α            .         .         .        .         .         .         .         .
                            α            .         .         .        .         .         .         .         .
          Intensity        λ            .         .         .        .         .         .         .         .
                            β           −.         .         .        .        −.         .         .         .
                            β           −.         .         .        .        −.         .         .         .
           Mark             ξ             .         .         .        .         .         .         .         .
                            α            .         .         .        .        −.         .         .         .
                            α            .         .         .        .         .         .         .         .
                            α            .         .         .        .         .         .         .         .

                                                                                               ̂ and coverage rate (CR) of % credible
Table : Summaries of the bias, standard deviation (SD), average of the Bayesian SD estimate (SD),
intervals when Z is binary: ξ = α = ., α = , (β, β) = (, ) and Z  ∼ Bernoulli(.).

                                                                             λ = .                                             λ = 

α           Model          Para          Bias           SD           c
                                                                      SD          CR          Bias          SD           c
                                                                                                                         SD           CR

.        Intensity        λ            .         .         .        .         .         .         .         .
                            β           −.         .         .        .        −.         .         .         .
                            β           −.         .         .        .        −.         .         .         .
           Mark             ξ             .         .         .        .         .         .         .         .
                            α            .         .         .        .         .         .         .         .
                            α            .         .         .        .         .         .         .         .
                            α            .         .         .        .         .         .         .         .
          Intensity        λ            .         .         .        .         .         .         .         .
                            β           −.         .         .        .        −.         .         .         .
                            β           −.         .         .        .        −.         .         .         .
           Mark             ξ             .         .         .        .         .         .         .         .
J. Jiao et al.: A Bayesian marked spatial point processes model                 89

Table : (continued)

                                                                                      λ = .                                                     λ = 

α             Model           Para           Bias            SD              c
                                                                              SD            CR            Bias            SD            c
                                                                                                                                        SD             CR

                               α             .          .             .         .          −.           .          .          .
                               α             .          .             .         .           .           .          .          .
                               α             .          .             .         .           .           .          .          .
           Intensity          λ             .          .             .         .           .           .          .          .
                               β            −.          .             .         .          −.           .          .          .
                               β            −.          .             .         .          −.           .          .          .
            Mark               ξ              .          .             .         .           .           .          .          .
                               α             .          .             .         .          −.           .          .          .
                               α             .          .             .         .           .           .          .          .
                               α             .          .             .         .           .           .          .          .

                                                                               Ho, L. P., and D. Stoyan. 2008. “Modelling Marked Point Patterns by
References                                                                          Intensity-Marked Cox Processes.” Statistics & Probability Letters
                                                                                    78 (10): 1194–9.
Alferink, L. A., T. S. Critchfield, J. L. Hitt, and W. J. Higgins. 2009.
                                                                               Hu, G., F. Huffer, and M.-H. Chen. 2019. “New Development of
      “Generality of the Matching Law as a Descriptor of Shot Selection             Bayesian Variable Selection Criteria for Spatial Point Process
      in Basketball.” Journal of Applied Behavior Analysis 42 (3):                  with Applications.” e-prints 1910.06870, arXiv.
      595–608.                                                                 Kass, R. E., and A. E. Raftery. 1995. “Bayes Factors.” Journal of the
Baddeley, A., and R. Turner. 2005. “Spatstat: An R Package for                      American Statistical Association 90 (430): 773–95.
      Analyzing Spatial Point Patterns.” Journal of Statistical Software       Leininger, T. J., and A. E. Gelfand. 2017. “Bayesian Inference and
      12 (6): 1–42.                                                                 Model Assessment for Spatial Point Patterns Using Posterior
Banerjee, S., B. P. Carlin, and A. E. Gelfand. 2014. Hierarchical                   Predictive Samples.” Bayesian Analysis 12 (1): 1–30.
      Modeling and Analysis for Spatial Data. Boca Raton, Florida:             Miller, A., L. Bornn, R. Adams, and K. Goldsberry. 2014. “Factorized
      Chapman and Hall/CRC.                                                         Point Process Intensities: A Spatial Analysis of Professional
Baum, W. M. 1974. “On Two Types of Deviation from the Matching Law:                 Basketball.” In Proceedings of the 31st International Conference
      Bias and Undermatching.” Journal of the Experimental Analysis of              on Machine Learning — Volume 32, ICML’14, 235–43.
      Behavior 22 (1): 231–42.                                                 Miller, J. W., and M. T. Harrison. 2018. “Mixture Models with a Prior on
Chen, M.-H., Q.-M. Shao, and J. G. Ibrahim. 2000. Monte Carlo                       the Number of Components.” Journal of the American Statistical
      Methods in Bayesian Computation. Berlin/Heidelberg, Germany:                  Association 113 (521): 340–56.
      Springer Science & Business Media.                                       Møller, J., A. R. Syversveen, and R. P. Waagepetersen. 1998. “Log
Cressie, N. 2015. Statistics for Spatial Data. Hoboken, New Jersey: John            Gaussian Cox Processes.” Scandinavian Journal of Statistics 25
      Wiley & Sons.                                                                 (3): 451–82.
de Valpine, P., D. Turek, C. J. Paciorek, C. Anderson-Bergman, D. T. Lang,     Møller, J., and R. P. Waagepetersen. 2003. Statistical Inference and
      and R. Bodik. 2017. “Programming with Models: Writing Statistical             Simulation for Spatial Point Processes. Boca Raton, Florida:
      Algorithms for General Model Structures with NIMBLE.” Journal of              Chapman and Hall/CRC.
      Computational and Graphical Statistics 26 (2): 403–13.                   Mrkvička, T., F. Goreaud, and J. Chadœuf. 2011. “Spatial Prediction of
Diggle, P. J. 2013. Statistical Analysis of Spatial and Spatio-Temporal             the Mark of a Location-Dependent Marked Point Process: How
      Point Patterns. Boca Raton, Florida: Chapman and Hall/CRC.                    the Use of a Parametric Model May Improve Prediction.”
Franks, A., A. Miller, L. Bornn, K. Goldsberry. 2015. “Characterizing the           Kybernetika 47 (5): 696–714.
      Spatial Structure of Defensive Skill in Professional Basketball.”        Murtagh, F., and P. Legendre. 2014. “Wards Hierarchical
      The Annals of Applied Statistics 9 (1): 94–121.                               Agglomerative Clustering Method: Which Algorithms Implement
Gaujoux, R., and C. Seoighe. 2010. “A Flexible R Package for                        Wards Criterion?” Journal of Classification 31 (3): 274–95.
      Nonnegative Matrix Factorization.” BMC Bioinformatics 11 (1): 367.       Reich, B. J., J. S. Hodges, B. P. Carlin, and A. M. Reich. 2006. “A Spatial
Geisser, S., and W. F. Eddy. 1979. “A Predictive Approach to Model                  Analysis of Basketball Shot Chart Data.” The American
      Selection.” Journal of the American Statistical Association 74                Statistician 60 (1): 3–12.
      (365): 153–60.                                                           Skinner, B. 2012. “The Problem of Shot Selection in Basketball.” PLoS
Gelfand, A. E., and D. K. Dey. 1994. “Bayesian Model Choice:                        One 7 (1): e30776.
      Asymptotics and Exact Calculations.” Journal of the Royal                Skinner, B., and M. Goldman. 2015. “Optimal Strategy in Basketball.”
      Statistical Society. Series B (Methodological) 56 (3): 501–14.                e-prints 1512.05652, arXiv.
Geyer, C. J. 1999. “Likelihood Inference for Spatial Point Processes.”         Spiegelhalter, D. J., N. G. Best, B. P. Carlin, and A. Van Der Linde. 2002.
      In Stochastic Geometry: Likelihood and Computation, 80, edited                “Bayesian Measures of Model Complexity and Fit.” Journal of the
      by O. Barndorff-Nielsen, W. Kendall, and M. van Lieshout,                     Royal Statistical Society: Series B (Statistical Methodology) 64
      79–140. Boca Raton, Florida: CRC Press.                                       (4): 583–639.
90          J. Jiao et al.: A Bayesian marked spatial point processes model

Staddon, J. 1978. “Theory of Behavioral Power Functions.”                Zhang, D., M.-H. Chen, J. G. Ibrahim, M. E. Boye, and W. Shen. 2017.
     Psychological Review 85 (4): 305–20.                                    “Bayesian Model Assessment in Joint Modeling of Longitudinal
Vollmer, T. R., and J. Bourret. 2000. “An Application of the Matching        and Survival Data with Applications to Cancer Clinical Trials.”
     Law to Evaluate the Allocation of Two- and Three-point Shots by         Journal of Computational and Graphical Statistics 26 (1):
     College Basketball Players.” Journal of Applied Behavior Analysis       121–33.
     33 (2): 137–50.                                                     Zhang, S., A. Lorenzo, M.-A. Gómez, N. Mateus, B. Gonçalves, and
Ward, J. H., Jr. 1963. “Hierarchical Grouping to Optimize an Objective       J. Sampaio. 2018. “Clustering Performances in the NBA
     Function.” Journal of the American Statistical Association 58           According to Players Anthropometric Attributes and Playing
     (301): 236–44.                                                          Experience.” Journal of Sports Sciences 36 (22): 2511–20.
You can also read