File: discrete_bernoulli.rst

package info (click to toggle)
python-scipy 0.18.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 75,464 kB
  • ctags: 79,406
  • sloc: python: 143,495; cpp: 89,357; fortran: 81,650; ansic: 79,778; makefile: 364; sh: 265
file content (36 lines) | stat: -rw-r--r-- 1,214 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

.. _discrete-bernoulli:

Bernoulli Distribution
======================

A Bernoulli random variable of parameter :math:`p` takes one of only two values :math:`X=0` or :math:`X=1` . The probability of success ( :math:`X=1` ) is :math:`p` , and the probability of failure ( :math:`X=0` ) is :math:`1-p.` It can be thought of as a binomial random variable with :math:`n=1` . The PMF is :math:`p\left(k\right)=0` for :math:`k\neq0,1` and

.. math::
   :nowrap:

    \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*}

.. math::
   :nowrap:

    M\left(t\right) = 1-p\left(1-e^{t}\right)

.. math::
   :nowrap:

    \mu_{m}^{\prime}=p

.. math::
   :nowrap:

    h\left[X\right]=p\log p+\left(1-p\right)\log\left(1-p\right)

Implementation: `scipy.stats.bernoulli`