pymc.Binomial#

class pymc.Binomial(name, *args, **kwargs)[source]#

Binomial log-likelihood.

The discrete probability distribution of the number of successes in a sequence of n independent yes/no experiments, each of which yields success with probability p. The pmf of this distribution is

\[f(x \mid n, p) = \binom{n}{x} p^x (1-p)^{n-x}\]

(Source code, png, hires.png, pdf)

../../../_images/pymc-Binomial-1.png

Support

\(x \in \{0, 1, \ldots, n\}\)

Mean

\(n p\)

Variance

\(n p (1 - p)\)

Parameters
ntensor_like of int

Number of Bernoulli trials (n >= 0).

ptensor_like of float

Probability of success in each trial (0 < p < 1).

logit_ptensor_like of float

Alternative log odds for the probability of success.

Methods

Binomial.__init__(*args, **kwargs)

Binomial.dist(n[, p, logit_p])

Creates a tensor variable corresponding to the cls distribution.

Binomial.logcdf(n, p)

Compute the log of the cumulative distribution function for Binomial distribution at the specified value.

Binomial.logp(n, p)

Calculate log-probability of Binomial distribution at specified value.

Binomial.moment(size, n, p)

Attributes

rv_class

rv_op