pymc.DiscreteUniform#

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

Discrete uniform distribution. The pmf of this distribution is

\[f(x \mid lower, upper) = \frac{1}{upper-lower+1}\]

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

../../../_images/pymc-DiscreteUniform-1.png

Support

\(x \in {lower, lower + 1, \ldots, upper}\)

Mean

\(\dfrac{lower + upper}{2}\)

Variance

\(\dfrac{(upper - lower)^2}{12}\)

Parameters
lower: int

Lower limit.

upper: int

Upper limit (upper > lower).

Methods

DiscreteUniform.__init__(*args, **kwargs)

DiscreteUniform.dist(lower, upper, *args, ...)

Creates a tensor variable corresponding to the cls distribution.

DiscreteUniform.logcdf(lower, upper)

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

DiscreteUniform.logp(lower, upper)

Calculate log-probability of DiscreteUniform distribution at specified value.

DiscreteUniform.moment(size, lower, upper)

Attributes

rv_op