O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

確率分布の成り立ちを理解してスポーツにあてはめてみる

Sports Analyst Meetup #5 LT発表
「確率分布の成り立ちを理解してスポーツにあてはめてみる」

Livros relacionados

Gratuito durante 30 dias do Scribd

Ver tudo
  • Seja o primeiro a comentar

確率分布の成り立ちを理解してスポーツにあてはめてみる

  1. 1. 4 5 2 09 4 S@ L M A # # / 21
  2. 2. 2 65 1 0 : 6 )) ( @kenmatsu4 21 4 801 01
  3. 3. - 1266: 1266: K G E 0?2 4 / ? . ! � 2 - :84 2? 2 86 2 )
  4. 4. Univariate Distribution Relationships Lawrence M. LEEMIS and Jacquelyn T. MCQUESTON http://www.math.wm.edu/~leemis/2008amstat.pdf
  5. 5. .2 2 2 1 1 1
  6. 6. # # p = 0.7 trial_size = 10000 rd.seed(71) # data = st.bernoulli.rvs(p, size=trial_size) # # p = 0.7 trial_size = 10000 rd.seed(71) # data = st.bernoulli.rvs(p, size=trial_size) h = plt.hist(data, normed=True, color=red, label="rvs", alpha=0.8) width = np.diff(h[1]).mean() # plt.bar([0.1, 0.9], [(1-p)/width, p/width], width=width, color="b", label="Theoretical", alpha=0.8) plt.legend(loc="best") plt.show()
  7. 7. 2 0 1 2 5 ( ( 0 . . 3 . . 7= % . . 3 . . . 7= % %
  8. 8. # def gen_bern_var(p, n): return(np.sum(st.bernoulli.rvs(p, size=n))) # p = 0.7 trial_size = 100000 set_size = 30 rd.seed(71) result = [gen_bern_var(p, set_size) for _ in range(trial_size)] hist_range = np.arange(np.min(result), np.max(result)+1) xx = np.arange(0, set_size) plt.figure(figsize=(10,6)) h = plt.hist(result, normed=True, bins=hist_range, color=red, label="rvs") plt.bar(xx+0.5, st.binom.pmf(xx, n=set_size, p=p), width=1, alpha=0.5, label="Theoretical") plt.legend(loc="best") plt.title(f"binomial distribution trial_size={trial_size}, set_size:{set_size}, p:{p}") plt.show() n_success: 4655, trial_size:100000 empirical:0.04655, theoretical:0.04644
  9. 9. https://www.kaggle.com/kenmatsu4/basket-shot-log-binom B A 2 2 N 2 0
  10. 10. 2 0 https://www.kaggle.com/dansbecker/nba-shot-logs
  11. 11. . 1 c 0 1 13
  12. 12. https://www.kaggle.com/kenmatsu4/basket-shot-log-poisson A B N
  13. 13. https://www.kaggle.com/dansbecker/nba-shot-logs
  14. 14. 0 0 . 0 0 1 5 2 ! ! 2 ! ?
  15. 15. # set_size = 20000 ; p = 0.1 trial_size = 50000 result = [gen_bern_var(p, set_size) for _ in range(trial_size)] xx = np.arange(np.percentile(result, 0.01), np.percentile(result, 99.99)) # confidence interval ci = st.norm.interval(0.95, loc=set_size*p, scale=np.sqrt(set_size*p*(1-p))) print(f"lower:{ci[0]}, upper:{ci[1]}") plt.figure(figsize=(10,6)) plt.plot(xx, st.norm.pdf(xx, set_size*p, np.sqrt(set_size*p*(1-p))), alpha=0.8, label="Theoretical") plt.hist(result, normed=True, bins=30, color=red, label="rvs", alpha=0.7) plt.title(f"normal distribution trial_size={trial_size}, set_size:{set_size}, p:{p}") plt.legend(loc="best") plt.show() 0.95 confidence interval lower:1916.8 upper:2083.2
  16. 16. https://www.slideshare.net/matsukenbook/rev012 75 31 9 2 6 0 8 4 .
  17. 17. !"
  18. 18. !"
  19. 19. EOF

×