]> The Beta Distribution

## 8. The Beta Distribution

In this section, we will study a two-parameter family of distributions that has special importance in probability and statistics.

#### The Beta Function

The beta function, first introduced by Leonhard Euler, is defined as follows:

$a b u 0 1 u a 1 1 u b 1 ; a 0 , b 0$

Show that the beta function is well-defined, that is, $a b$ for any $a 0$ and $b 0$, using these steps:

1. Break the integral into two parts, from 0 to $12$ and from $12$ to 1.
2. If $0 a 1$, the integral is improper at $u 0$, but $1 u b 1$ is bounded on $0 12$.
3. If $0 b 1$, the integral is improper at $u 1$, but $u a 1$ is bounded on $12 1$.

Show that

1. $a b b a$
2. $a 1 1 a$

Show that the beta function can be written in terms of the gamma function as follows:

$a b a b a b , a 0 , b 0$
1. Express $a b a b$ as a double integral with respect to $x$ and $y$ where $x 0$ and $0 y 1$.
2. Use the transformation $w x y$, $z x x y$ and the change of variables theorem for multiple integrals.
3. The transformation maps the $x y$ region in (a) one-to-one and onto the region $z 0$, $w 0$.
4. The Jacobian of the inverse transformation has magnitude $1 z w$.
5. Show that the transformed integral is $a b$.

Show that if $j$ and $k$ are positive integers, then

$j k j 1 k 1 j k 1$

Let's generalize this result. First, recall the generalized permutation formula from our study of combinatorial structures: for $a$, $s$, and $j$, we defined

$a s j a a s a 2 s · · · a j 1 s$

Suppose that $a 0$, $b 0$, $j$, and $k$. Show that

$a j b k a b a 1 j b 1 k a b 1 j k$

Show that $12 12$

A graph of $a b$ on the square $0 a 10 , 0 b 10$ is shown below.

#### The Density Function

Show that the function $f$ below is a probability density function for every $a 0 , b 0$

$f x 1 a b x a 1 1 x b 1 , 0 x 1$

The distribution with the density in the previous exercise is called the beta distribution with left parameter $a$ and right parameter $b$. The beta distribution is useful for modeling random probabilities and proportions, particularly in the context of Bayesian analysis. The distribution has two parameters and yet a rich variety of shapes:

Sketch the graph of the beta probability density function. Note the qualitative differences in the shape of the density for the following parameter ranges:

1. $0 a 1 , 0 b 1$
2. $a 1 , b 1$. This special case corresponds to the uniform distribution.
3. $a 1 , 0 b 1$
4. $0 a 1 , b 1$
5. $0 a 1 , b 1$
6. $a 1 , 0 b 1$
7. $a 1 , b 1$
8. $a 1 , b 1$
9. $a 1 , b 1$. Show that in this special case, the mode occurs at $u a 1 a b 2$.

In the random variable experiment, select the beta distribution. Set the parameters to values in each of the ranges of the previous exercise. In each case, note the shape of the beta density function. Run the simulation 1000 times with an update frequency of 10 and note the apparent convergence of the empirical density function to the true density function.

The special case $a 12$, $b 12$ is the arcsine distribution (the name will be explained below). Thus, the probability density function of the arcsine distribution is

$f x 1 x 1 x , 0 x 1$

#### Distribution Function

In some special cases, the beta distribution function $F$ and its inverse, the quantile function $F$, can be computed in closed form. In the following exercises, $a$ denotes the left parameter and $b$ the right parameter, as usual.

Suppose that $a 0$ and $b 1$. Show that

1. $F x x a , 0 x 1$
2. $F p p 1 a , 0 p 1$

Suppose that $a 1$ and that $b 0$. Show that

1. $F x 1 1 x b , 0 x 1$
2. $F p 1 1 p 1 b , 0 p 1$

Suppose that $a b 12$ (the arcsine distribution). Show that

1. $F x 2 x$ for $0 x 1$
2. $F p sin 2 2 p$ for $0 p 1$

In general, there is an interesting relationship between the distribution functions of the beta distribution and the binomial distribution.

Fix $n$. Let $F p$ denote the binomial distribution function with trial parameter $n$ and success parameter $p 0 1$, and let $G k$ denote the beta distribution function with left parameter $n k 1$ and right parameter $k$, where $k 1 2 n 1$. Show that

$F p k 1 G k 1 p$

Hint: Express $G k 1 p$ as an integral of the beta probability density function, and then integrate by parts.

In the quantile applet, select the beta distribution. Vary the parameters and note the shape of the density function and the distribution function. In each of the following cases, find the median, the first and third quartiles, and the interquartile range. Sketch the boxplot.

1. $a 1 , b 1$
2. $a 1 , b 3$
3. $a 3 , b 1$
4. $a 2 , b 4$
5. $a 4 , b 2$
6. $a 4 , b 4$

#### Moments

The moments of the beta distribution are easy to express in terms of the beta function.

Suppose that $X$ has the beta distribution with left parameter $a$ and right parameter $b$. Show that

$X k a k b a b$

Suppose that $X$ has the beta distribution with left parameter $a$ and right parameter $b$. Show that

1. $X a a b$
2. $X a b a b 2 a b 1$

In particular, if $a b 12$, so that $X$ has the arcsine distribution, then $X 12$ and $X 18$

In the simulation of the random variable experiment, select the beta distribution. Set the parameters to values in each of the ranges of Exercise 8. In each case, note the size and location of the mean/standard deviation bar. In each case, run the simulation 1000 times with an update frequency of 10. Note the apparent convergence of the sample moments to the distribution moments.

#### Transformations

Suppose that $X$ has the gamma distribution with shape parameter $a$ and scale parameter $r$, that $Y$ has the gamma distribution with shape parameters $b$ and scale parameter $r$, and that $X$ and $Y$ are independent. Show that $U X X Y$ has the beta distribution with left parameter $a$ and right parameter $b$.

Suppose that $X$ has the beta distribution with left parameter $a$ and right parameter $b$. Show that $Y 1 X$ has the beta distribution with parameters left parameter $b$ and right parameter $a$.

Suppose that $X$ has the $F$ distribution with $m$ degrees of freedom in the numerator and $n$ degrees of freedom in the denominator. Show that

$U m n X 1 m n X$

has the beta distribution with left parameter $a m 2$ and right parameter $b n 2$.

Suppose that $X$ has the beta distribution with left parameter $a$ and right parameter $b$. Show that the distribution is a two-parameter exponential family with natural parameters $a 1$ and $b 1$, and natural statistics $X$ and $1 X$.

The beta distribution is also the distribution of the order statistics of a random sample from the uniform distribution.

#### The Generalized Beta Distribution

The beta distribution can be easily generalized from the support interval $0 1$ to an arbitrary bounded interval $c d$ where $c d$, using a linear transformation. Thus, suppose that $Z$ has the standard beta distibution with left parameter $a$ and right parameter $b$. Defne $X c Z d c$

Use the change of variables theorem to show that $X$ has probability density function

Most of the results in the previous sections have simple extensions to this generalized beta distribution. In particular, the mean and variance are given in the following exercise.

Use Exercise 16 and basic properties of expected value and variance to show that

1. $X c d c a a b$
2. $X d c 2 a b a b 2 a b 1$