Probability Distributions and their Stories
Continuous distributions
Uniform distribution
- Story. Any outcome in a given range has equal probability.
- Example. Anything in which all possibilities are equally likely. This is, perhaps surprisingly, rarely encountered.
- Parameters. The Uniform distribution is not defined on an infinite or semi-infinite domain, so lower and upper bounds, \(α\) and \(β\), respectively, are necessary parameters.
- Support. The Uniform distribution is supported on the interval \([α,β]\).
- Probability density function.
\(\begin{align}
f(y;\alpha, \beta) = \left\{ \begin{array}{ccc}
\frac{1}{\beta - \alpha} & & \alpha \le y \le \beta \\(0.5em]
0 & & \text{otherwise}
\end{array}
\right.
\end{align}\)
- Usage
- Related distributions.
- The Uniform distribution on the interval [0, 1] (i.e., \(α=0\) and \(β=1\)) is a special case of the Beta distribution where the parameters for the Beta distribution are \(α=β=1\) (not to be confused with the \(α\) and \(β\) used to parametrize the Uniform distribution).
Package | Syntax |
---|---|
NumPy | np.random.uniform(alpha, beta) |
SciPy | scipy.stats.uniform(alpha, beta) |
Stan | uniform(alpha, beta) |
params = [dict(name='α', start=-2, end=3, value=0, step=0.01),
dict(name='β', start=-2, end=3, value=1, step=0.01)]
app = distribution_plot_app(x_min=-2,
x_max=3,
scipy_dist=st.uniform,
params=params,
title='Uniform')
bokeh.io.show(app, notebook_url=notebook_url)