Loading [MathJax]/jax/output/HTML-CSS/jax.js
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.0).

Binomial Distribution

A binomial random variable with parameters (n,p) can be described as the sum of n independent Bernoulli random variables of parameter p;

Y=ni=1Xi.

Therefore, this random variable counts the number of successes in n independent trials of a random experiment where the probability of success is p.

p(k;n,p)=(nk)pk(1p)nkk{0,1,n},F(x;n,p)=kx(nk)pk(1p)nk=I1p(nx,x+1)x0

where the incomplete beta integral is

Ix(a,b)=Γ(a+b)Γ(a)Γ(b)x0ta1(1t)b1dt.

Now

μ=npμ2=np(1p)γ1=12pnp(1p)γ2=16p(1p)np(1p).
M(t)=[1p(1et)]n

Implementation: scipy.stats.binom