伯努利分布#

参数为 \(p\) 的伯努利随机变量只取两个值中的一个 \(X=0\)\(X=1\) 。成功的概率(\(X=1\))为 \(p\) ,而失败的概率(\(X=0\))为 \(1-p.\) 可以将其视为二项式随机变量,其中 \(n=1\) 。PMF 为 \(p\left(k\right)=0\),当 \(k\neq0,1\) 时,并且

\begin{eqnarray*} p\left(k;p\right) & = & \begin{cases} 1-p & k=0\\ p & k=1\end{cases}\\ F\left(x;p\right) & = & \begin{cases} 0 & x<0\\ 1-p & 0\le x<1\\ 1 & 1\leq x\end{cases}\\ G\left(q;p\right) & = & \begin{cases} 0 & 0\leq q<1-p\\ 1 & 1-p\leq q\leq1\end{cases}\\ \mu & = & p\\ \mu_{2} & = & p\left(1-p\right)\\ \gamma_{3} & = & \frac{1-2p}{\sqrt{p\left(1-p\right)}}\\ \gamma_{4} & = & \frac{1-6p\left(1-p\right)}{p\left(1-p\right)} \end{eqnarray*}
\[M\left(t\right) = 1-p\left(1-e^{t}\right)\]
\[\mu_{m}^{\prime}=p\]
\[h\left[X\right]=p\log p+\left(1-p\right)\log\left(1-p\right)\]

实现:scipy.stats.bernoulli