Processing math: 100%
SciPy

This is documentation for an old release of SciPy (version 0.17.0). Search for this page in the documentation of the latest stable release (version 1.15.1).

Bernoulli Distribution

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

p(k;p)={1pk=0pk=1F(x;p)={0x<01p0x<111xG(q;p)={00q<1p11pq1μ=pμ2=p(1p)γ3=12pp(1p)γ4=16p(1p)p(1p)
M(t)=1p(1et)
μm=p
h[X]=plogp+(1p)log(1p)

Implementation: scipy.stats.bernoulli