Hot Hands

Our investigation will focus on the performance of one player: Kobe Bryant of the Los Angeles Lakers. His performance against the Orlando Magic in the 2009 NBA finals earned him the title Most Valuable Player and many spectators commented on how he appeared to show a hot hand. Let’s load some data from those games and look at the first several rows.

load("more/kobe.RData")
head(kobe)
##    vs game quarter time
## 1 ORL    1       1 9:47
## 2 ORL    1       1 9:07
## 3 ORL    1       1 8:11
## 4 ORL    1       1 7:41
## 5 ORL    1       1 7:03
## 6 ORL    1       1 6:01
##                                               description basket
## 1                 Kobe Bryant makes 4-foot two point shot      H
## 2                               Kobe Bryant misses jumper      M
## 3                        Kobe Bryant misses 7-foot jumper      M
## 4 Kobe Bryant makes 16-foot jumper (Derek Fisher assists)      H
## 5                         Kobe Bryant makes driving layup      H
## 6                               Kobe Bryant misses jumper      M

To verify this use the following command:

kobe$basket[1:9]
## [1] "H" "M" "M" "H" "H" "M" "M" "M" "M"
  1. What does a streak length of 1 mean, i.e. how many hits and misses are in a streak of 1? What about a streak length of 0?

Answer: A streak length of 1 means “one hit of consecutive baskets made until a miss occurs. 1 means”Hit" and 0 means “miss”.

kobe_streak <- calc_streak(kobe$basket)
barplot(table(kobe_streak))

  1. Describe the distribution of Kobe’s streak lengths from the 2009 NBA finals. What was his typical streak length? How long was his longest streak of baskets?

Answer:Base on the recode, kobe’s highest number of hit in a steak length was 4, which his longest streak of baskets; and lowest number was 0, which is his typical streak length.

Simulations in R

  1. In your simulation of flipping the unfair coin 100 times, how many flips came up heads? ###Answer: every time the sample results there are probability to get “head” is around 20%, and “tail” is around 80%.
outcomes <- c("heads", "tails")
sim_unfair_coin <- sample(outcomes, size = 100, replace = TRUE, prob = c(0.2, 0.8))
table(sim_unfair_coin)
## sim_unfair_coin
## heads tails 
##    23    77

Simulating the Independent Shooter

  1. What change needs to be made to the sample function so that it reflects a shooting percentage of 45%? Make this adjustment, then run a simulation to sample 133 shots. Assign the output of this simulation to a new object calledsim_basket.
outcomes <- c("H", "M")
sim_basket <- sample(outcomes, size = 133, replace = TRUE, prob = c(0.45, 0.55))
table(sim_basket)
## sim_basket
##  H  M 
## 63 70

On your own

Comparing Kobe Bryant to the Independent Shooter

Using calc_streak, compute the streak lengths of sim_basket.

  • Describe the distribution of streak lengths. What is the typical streak length for this simulated independent shooter with a 45% shooting percentage?How long is the player’s longest streak of baskets in 133 shots?

Answer: The player’s longest streak of baskets is 5 in 133 shots.

outcomes <- c("H", "M")
sim_basket1 <- sample(outcomes, size = 133, replace = TRUE, prob = c(0.45, 0.55))
table(sim_basket1)
## sim_basket1
##  H  M 
## 67 66
sim_kobe1 <- calc_streak(sim_basket1)
barplot(table(sim_kobe1))

  • If you were to run the simulation of the independent shooter a second time, how would you expect its streak distribution to compare to the distribution from the question above? Exactly the same? Somewhat similar? Totally different? Explain your reasoning.

Answer:It is similar to the period one result since the simulation generated data by following the same probability.

outcomes <- c("H", "M")
sim_basket2 <- sample(outcomes, size = 133, replace = TRUE, prob = c(0.45, 0.55))
table(sim_basket2)
## sim_basket2
##  H  M 
## 66 67
sim_kobe2 <- calc_streak(sim_basket2)
barplot(table(sim_kobe2))

  • How does Kobe Bryant’s distribution of streak lengths compare to the distribution of streak lengths for the simulated shooter? Using this comparison, do you have evidence that the hot hand model fits Kobe’s shooting patterns? Explain.

Answer:Kobe doesn’t have hot hand since his distribution of streak lengths is similar to the result generated by independent outcome. since the independent outcome has only two results - hit or miss with fair probabilites, this fit Kobe’s shooting patterns.