Multinomial distribution,多項分佈
n次試驗,有k種現象,其出現機率 $p_i$,$i=1,2,\cdots k$。(二項分布只有兩種)
$P(x_1,x_2,\cdots ,x_{k-1})=\cfrac{n!}{x_1!x_2! \cdots x_k!}p_1^{x_1} \cdots p_{k-1}^{x_{k-1}}\ p_{k}^{x_{k}}\ ,\ \ where\ \ x_{k}=n- x_1-\cdots-x_{k-1}$
三項分布
joint pdf
$f(x,y)=\cfrac{n!}{x!y!(n-x-y)!}p_1^{x}p_2^{y}(1-p_1-p_2)^{n-x-y}$ $x,y,x+y=0,1,2,\cdots,n$
marginal pdf
$f(x)=\displaystyle\sum_{y=0}^{n-x}\cfrac{n!}{x!y!(n-x-y)!}p_1^{x}p_2^{y}(1-p_1-p_2)^{n-x-y}\\=\cfrac{n!\ p_1^{x}}{x!(n-x)!}\displaystyle\sum_{y=0}^{n-x}\cfrac{(n-x)!}{y!(n-x-y)!}p_2^{y}(1-p_1-p_2)^{n-x-y}\\=\cfrac{n!\ p_1^{x}}{x!(n-x)!}(p_2+1-p_1-p_2)^{n-x}=\dbinom{n}{x}p_1^{x}(1-p_1)^{n-x}\implies\ X\sim B(n,p_1)$
,同理 $Y\sim B(n,p_2)$。
conditional pdf
$f(x\vert Y=y)=\cfrac{f(x,y)}{f(y)}=\cfrac{\cfrac{n!}{x!y!(n-x-y)!}p_1^{x}p_2^{y}(1-p_1-p_2)^{n-x-y}}{\dbinom{n}{y}p_2^y(1-p)^{n-y}}\\=\cfrac{(n-y)!}{x!(n-x-y)!}(\cfrac{p_1}{1-p_2})^x(\cfrac{1-p_1-p_2}{1-p_2})^{n-x-y}\implies\ (X\vert Y=y)\sim B(n-y,\cfrac{p_1}{1-p_2})$
$(Y\vert X=x)\sim B(n-x,\cfrac{p_2}{1-p_1})$
由上可知,$E(Y\vert X)=(n-x)\cfrac{p_2}{1-p_1}$,斜率$=\cfrac{-p_2}{1-p_1}=\rho\cfrac{\sigma_y}{\sigma_x}\implies \rho=-\sqrt{\cfrac{p_1p_2}{(1-p_1)(1-p_2)}}$ ($\rho\ 和斜率同號$)
留言
張貼留言