4.6 - Beta distribution

Definition

  • The beta distribution is unique in that it is only non-zero for \(Y \in (0,1)\).
  • Often used to model proportions.
  • A random variable \(Y\) is said to have a \(BETA(\alpha,\beta)\) distribution for \(\alpha >0\) and \(\beta>0\), and we say \(Y\sim BETA(\alpha,\beta)\), if and only if the pdf of \(Y\) is:

\[f(y) = \left\{\begin{array} {ll} \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)} y^{\alpha-1}(1-y)^{\beta-1} & 0\leq y \leq 1\\ 0 & otherwise\\ \end{array}\right.\]

  • Special case: If \(\alpha=\beta=1\), then \(Y\sim UNIF(0,1)\).

Plots of pdf

Kernel

The kernel integrates to the reciprocal of the normalizing constant, which is sometimes written as \(B(\alpha,\beta)\):

\[\int_0^1 y^{\alpha-1}(1-y)^{\beta-1} dy = B(\alpha,\beta)\] where \(B(\alpha,\beta) = \frac{\Gamma(\alpha)\Gamma(\beta)}{\Gamma(\alpha+\beta)}\).

Mean

If \(Y\sim BETA(\alpha,\beta)\) then \(E(Y) = \frac{\alpha}{\alpha+\beta}\).

Proof:

\[E(Y) = \int_0^1 y\cdot \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)} y^{\alpha-1}(1-y)^{\beta-1} dy\]

\[ = \frac{1}{B(\alpha,\beta)}\int_0^1 y^{\alpha}(1-y)^{\beta-1} dy= \frac{1}{B(\alpha,\beta)}\int_0^1 y^{(\alpha+1)-1}(1-y)^{\beta-1} dy\]

\[ = \frac{1}{B(\alpha,\beta)}B(\alpha+1,\beta) = \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}\frac{\Gamma(\alpha+1)\Gamma(\beta)}{\Gamma(\alpha+1+\beta)} \]

\[=\frac{\Gamma(\alpha+\beta)\,\alpha\,\Gamma(\alpha)}{\Gamma(\alpha)(\alpha+\beta)\Gamma(\alpha+\beta)} = \frac{\alpha}{\alpha+\beta}\]

Variance

If \(Y\sim BETA(\alpha,\beta)\) then \(Var(Y) = \frac{\alpha\beta}{(\alpha+\beta)^2(\alpha+\beta+1)}\).

Proof: exercise

MGF

\[Y\sim BETA(\alpha,\beta) \iff M_Y(t) = 1+\sum_{k=1}^\infty\left(\prod_{r=0}^{k-1}\frac{\alpha+r}{\alpha+\beta+r}\right)\frac{t^k}{k!}\]

Beta in R

  • dbeta(y, shape1, shape2): evaluates \(f(y)\)
  • pbeta(y, shape1, shape2): evaluates \(F(y)\) (which does not have closed form)
  • qbeta(p, shape1, shape2): finds the \(p^{th}\) percentile
  • rbeta(N, shape1, shape2): simulates N random beta random variables