====== 이항분포 (Binomial Distribution) ======
===== 정의 =====
성공률이 $p$인 [[베르누이 시행]]을 [[독립]]적으로 $n$번 반복할 때 성공횟수를 $X$라 하면. $X$는 [[모수]]가 $n$과 $p$인 [[이항분포]]를 따른다.
===== 표기 =====
이항분포는 [[베르누이 실험]]의 연속적인 시행횟수 $n$과 그 실험의 성공 확률인 $p$를 이용해 표기 한다.
* $$ X \sim b(n , p)$$
* $$ n \in \{ \ 1 \ , \ 2 \ , \ \cdots \ \} $$
* $$ p \in [[ \ 0 \ , \ 1 \ ]] $$
===== 받침 =====
$$ x \in \{ \ 0 \ , \ 1 \ , \ ... \ , \ n \} $$
===== 확률질량함수 =====
$$ p(x)=\begin{pmatrix}n\\x\end{pmatrix}p^{x}(1-p)^{n-x} $$
set title "Binomial Distribution PMF (1)"
set size 1.0
set yrange [0:0.3]
set xrange [0:20.5]
set format y "%.2f"
set xlabel "x"
set ylabel "p(x)"
set key
f(x,n,p) = (n!)/((int(x)!)*((n-int(x))!))*(p**(int(x)))*((1-p)**(n-int(x)))
plot f(x+0.5,20,0.1) title "b(20,0.1)" with steps, \
f(x+0.5,20,0.5) title "b(20,0.5)" with steps, \
f(x+0.5,20,0.9) title "b(20,0.9)" with steps
set title "Binomial Distribution PMF (2)"
set size 1.0
set yrange [0:0.09]
set xrange [0:100.5]
set boxwidth 1
set format y "%.2f"
set xlabel "x"
set ylabel "p(x)"
f(x,n,p) = (n!)/((int(x)!)*((n-int(x))!))*(p**(int(x)))*((1-p)**(n-int(x)))
plot f(x+0.5,100,0.5) title "b(100,0.5)" with steps
===== 누적분포함수 =====
$$ F(x) = \sum_{k=0}^{x} \begin{pmatrix} n \\ k \end{pmatrix} p^{k} (1-p)^{n-k} $$
set title "Binomial Distribution CDF"
set size 1.0
set yrange [0:1.2]
set xrange [-0.5:19.5]
set xlabel "x"
set ylabel "F(x)"
set key left
set format y "%.2f"
set xlabel "x"
set ylabel "F(x)"
f(x,n,p) = ibeta(n-int(x),int(x)+1.0,1.0-p)
plot f(x+0.5,20,0.1) title "b(20,0.1)" with steps, \
f(x+0.5,20,0.5) title "b(20,0.5)" with steps, \
f(x+0.5,20,0.9) title "b(20,0.9)" with steps
===== 기대값 =====
$$E(X)=np$$
set title "Binomial Distribution Expected Value By n (1)"
set size 1.0
set yrange [0:11]
set xrange [-0.5:20.5]
set format y "%.2f"
set xlabel "n"
set ylabel "E(X)"
set key
f(x,p) = (int(x))*p
plot f(x+0.5,0.5) title "b(n,0.5)" with steps
set title "Binomial Distribution Expected Value By p (2)"
set size 1.0
set yrange [0:20]
set xrange [0:1]
set format y "%.2f"
set format x "%.2f"
set xlabel "p"
set ylabel "E(X)"
set key
f(x,n) = n*x
plot f(x,20) title "b(20,p)"
set title "Binomial Distribution Expected Value By n,p (3)"
set size 1.0
set zrange [0:20]
set yrange [0:1]
set xrange [-0.5:20.5]
set xlabel "n"
set ylabel "p"
set zlabel "E(X)"
f(x,y) = int(x)*y
splot f(x+0.5,y) title "b(n,p)"
===== 분산 =====
$$Var(X)=np(1-p)$$
set title "Binomial Distribution Variance By n (1)"
set size 1.0
set yrange [0:5.5]
set xrange [-0.5:20.5]
set format y "%.2f"
set xlabel "n"
set ylabel "Var(X)"
set key
f(x,p) = (int(x))*p*(1-p)
plot f(x+0.5,0.5) title "b(n,0.5)" with steps
set title "Binomial Distribution Variance By p (2)"
set size 1.0
set yrange [0:5.5]
set xrange [0:1]
set format y "%.2f"
set format x "%.2f"
set xlabel "p"
set ylabel "Var(X)"
set key
f(x,n) = n*x*(1-x)
plot f(x,20) title "b(20,p)"
set title "Binomial Distribution Variance By n,p (3)"
set size 1.0
set zrange [0:5]
set yrange [0:1]
set xrange [-0.5:20.5]
set xlabel "n"
set ylabel "p"
set zlabel "Var(X)"
f(x,y) = int(x)*y*(1-y)
splot f(x+0.5,y) title "b(n,p)"
===== 왜도 =====
$$ \gamma_{ \ 1} = \frac{1 - 2p}{\sqrt{np(1 - p)}} = \frac{q-p}{\sqrt{npq}} $$
set title "Binomial Distribution Skewness By n (1)"
set size 1.0
set yrange [-3:3]
set xrange [0.5:20.5]
set xlabel "n"
set ylabel "Skewness"
f(x,p) = (1-2*p)/(sqrt(int(x)*p*(1-p)))
plot f(x+0.5,0.1) title "b(n,0.1)" with steps, \
f(x+0.5,0.5) title "b(n,0.5)" with steps, \
f(x+0.5,0.9) title "b(n,0.9)" with steps
set title "Binomial Distribution Skewness By p (2)"
set size 1.0
set yrange [-3:3]
set xrange [0:1]
set xlabel "p"
set ylabel "Skewness"
f(x,n) = (1-2*x)/(sqrt(n*x*(1-x)))
plot f(x,20) title "b(20,p)"
set title "Binomial Distribution Skewness By n,p (3)"
set size 1.0
set zrange [-6:6]
set yrange [0:1]
set xrange [0.5:20.5]
set xlabel "n"
set ylabel "p"
set zlabel "Skewness"
f(x,y) = (1-2*y)/(sqrt(int(x)*y*(1-y)))
splot f(x+0.5,y) title "b(n,p)"
===== 첨도 =====
$$ \gamma_{ \ 2} = \frac{6p^{2} - 6p + 1}{np(1-p)} = \frac{1 - 6pq}{npq} $$
set title "Binomial Distribution Kurtosis By n (1)"
set size 1.0
set yrange [-3:6]
set xrange [0.5:20.5]
set xlabel "n"
set ylabel "Kurtosis"
f(x,p) = (1-6*p*(1-p))/(int(x)*p*(1-p))
plot f(x+0.5,0.1) title "b(n,0.1)" with steps, \
f(x+0.5,0.2) title "b(n,0.2)" with steps, \
f(x+0.5,0.3) title "b(n,0.3)" with steps, \
f(x+0.5,0.4) title "b(n,0.4)" with steps, \
f(x+0.5,0.5) title "b(n,0.5)" with steps
set title "Binomial Distribution Kurtosis By p (2)"
set size 1.0
set yrange [-1:5]
set xrange [0:1]
set xlabel "p"
set ylabel "Kurtosis"
f(x,n) = (1-6*x*(1-x))/(n*x*(1-x))
plot f(x,20) title "b(20,p)"
set title "Binomial Distribution Kurtosis By n,p (3)"
set size 1.0
set zrange [-2:10]
set yrange [0:1]
set xrange [0.5:20.5]
set xlabel "n"
set ylabel "p"
set zlabel "Kurtosis"
f(x,y) = (1-6*y*(1-y))/(int(x)*y*(1-y))
splot f(x+0.5,y) title "b(n,p)"
===== 특성함수 =====
$$ \phi \ (t) = (q + p e^{it})^{n} $$
===== 적률생성함수 =====
* $$ M(t) = [[ \ pe^{t}+(1-p) \ ]]^{n}$$
* $$ M'(t) = n [[ pe^{t} + (1-p)]]^{n-1} (pe^{t}) $$
* $$ M''(t) = n (n - 1) [[ pe^{t} + (1 - p) ]]^{n-2} + n [[ pe^{t} + (1-p)]]^{n-1} (pe^{t}) $$
===== 원적률 =====
- $$ \mu'_{1} = np $$
- $$ \mu'_{2} = np(1 - p + np) $$
- $$ \mu'_{3} = np(1 - 3p + 3np + 2p^{2} - 3np^{2} + n^{2} p^{2}) $$
- $$ \mu'_{4} = np(1 - 7p + 7np + 12p^{2} - 18np^{2} + 6n^{2} p^{2} - 6p^{3} + 11np^{3} -6n^{2} p^{3} + n^{3} p^{3}) $$
===== 중심적률 =====
- $$ \mu_{2} = np(1 - p) = npq $$
- $$ \mu_{3} = np(1 - p)(1 - 2p) = npq(q-p) $$
- $$ \mu_{4} = np(1 - p)[[ 3p^{2} (2-n) + 3p(n-2) + 1 ]] $$
===== 특징 =====
- [[재생성]]을 가진다.
* $X_{i} \sim b(n_{i},p)$이면 $\sum X_{i} \sim b(\sum n_{i} , p)$이 성립한다.
===== 타 분포와의 관계 =====
- [[초기하분포를 이항분포로 근사]]
- [[이항분포를 포아송분포로 근사]]
- [[이항분포를 정규분포로 근사]]
----
* [[이항분포표]]