확률분포와 스토리: 이항분포

Python으로 하는 Statistical Thinking (파트 1)

Justin Bois

Teaching Professor at the California Institute of Technology

확률질량함수(PMF)

  • 이산 결과들의 확률 집합
Python으로 하는 Statistical Thinking (파트 1)

이산 균등 PMF

ch3-3.004.png

Python으로 하는 Statistical Thinking (파트 1)

확률분포

  • 결과를 수학적으로 설명
Python으로 하는 Statistical Thinking (파트 1)

이산 균등분포: 스토리

공정한 주사위를 한 번 굴린 결과는

  • 이산형이며
  • 균등하게 분포함.
Python으로 하는 Statistical Thinking (파트 1)

이항분포: 스토리

  • 성공 확률 p인 베르누이 시행 n번에서 성공 횟수 r은 이항분포를 따름
  • 동전 앞면 확률 0.5인 4번 던지기에서 앞면 횟수 r은 이항분포를 따름
Python으로 하는 Statistical Thinking (파트 1)

이항분포에서의 표본추출

rng.binomial(4, 0.5)
2
rng.binomial(4, 0.5, size=10)
array([4, 3, 2, 1, 1, 0, 3, 2, 3, 0])
Python으로 하는 Statistical Thinking (파트 1)

이항분포 PMF

samples = rng.binomial(60, 0.1, size=10000)
n = 60
p = 0.1

ch3-3.019.png

Python으로 하는 Statistical Thinking (파트 1)

이항분포 CDF

import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
x, y = ecdf(samples)
_ = plt.plot(x, y, marker='.', linestyle='none')
plt.margins(0.02)
_ = plt.xlabel('number of successes')
_ = plt.ylabel('CDF')
plt.show()
Python으로 하는 Statistical Thinking (파트 1)

이항분포 CDF

ch3-3.022.png

Python으로 하는 Statistical Thinking (파트 1)

연습해 봅시다!

Python으로 하는 Statistical Thinking (파트 1)

Preparing Video For Download...