\[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.\]
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)}\).
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}\]
If \(Y\sim BETA(\alpha,\beta)\) then \(Var(Y) = \frac{\alpha\beta}{(\alpha+\beta)^2(\alpha+\beta+1)}\).
Proof: exercise
\[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!}\]
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}\) percentilerbeta(N, shape1, shape2)
: simulates N
random beta random variables