St · Statistics & Probability

What Is the Moment-Generating Function of a Beta Distribution?

Published By the 9to5Science editorial team

At a glance

  1. 1. Write the density

    For positive shape parameters alpha and beta, use the beta density on the interval from zero to one.

  2. 2. Take the exponential expectation

    Integrate e to the power tX against the density, or expand the exponential and use the beta moments.

  3. 3. Identify the function

    The integral is the confluent hypergeometric function 1F1 with parameters alpha and alpha plus beta.

  4. 4. Read off moments

    The coefficient of each power of t gives a moment; derivatives at zero give the same results.

If X∼Beta⁡(α,β)X\sim\operatorname{Beta}(\alpha,\beta), its moment-generating function can be written using the confluent hypergeometric function. In general, it does not simplify to a combination of elementary functions, but the formula gives a convergent series and makes moments easy to obtain.

The formula

Assume α>0\alpha>0 and β>0\beta>0, with the standard Beta distribution supported on 0<x<10<x<1. Its density is

fX(x)=xα−1(1−x)β−1B(α,β),0<x<1,f_X(x)=\frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha,\beta)},\qquad 0<x<1,

where B(α,β)B(\alpha,\beta) is the beta function. By definition, the MGF is MX(t)=E[etX]M_X(t)=\mathbb{E}[e^{tX}]. For a Beta random variable,

MX(t)=1F1(α;α+β;t),t∈R.M_X(t)={}_1F_1(\alpha;\alpha+\beta;t),\qquad t\in\mathbb{R}.

Here 1F1(a;c;t){}_1F_1(a;c;t) is the confluent hypergeometric function, also called Kummer’s function. The semicolon separates its two parameters.

Deriving the MGF

Start with the expectation integral and substitute the density:

MX(t)=1B(α,β)∫01etxxα−1(1−x)β−1 dx.\begin{aligned} M_X(t) &=\frac{1}{B(\alpha,\beta)}\int_0^1 e^{tx}x^{\alpha-1}(1-x)^{\beta-1}\,dx. \end{aligned}

One way to identify the result is the integral representation

1F1(a;c;t)=Γ(c)Γ(a)Γ(c−a)∫01etxxa−1(1−x)c−a−1 dx,{}_1F_1(a;c;t)=\frac{\Gamma(c)}{\Gamma(a)\Gamma(c-a)}\int_0^1 e^{tx}x^{a-1}(1-x)^{c-a-1}\,dx,

which applies when Re⁡(c)>Re⁡(a)>0\operatorname{Re}(c)>\operatorname{Re}(a)>0. Set a=αa=\alpha and c=α+βc=\alpha+\beta. The prefactor becomes the reciprocal beta-function normalization, giving the stated MGF.

You can also derive it from the power series for the exponential. The Beta moments are

E[Xn]=(α)n(α+β)n,\mathbb{E}[X^n]=\frac{(\alpha)_n}{(\alpha+\beta)_n},

where (q)n=q(q+1)⋯(q+n−1)(q)_n=q(q+1)\cdots(q+n-1) is the rising factorial, and (q)0=1(q)_0=1. Thus

MX(t)=∑n=0∞E[Xn]n!tn=∑n=0∞(α)n(α+β)ntnn!=1F1(α;α+β;t).\begin{aligned} M_X(t) &=\sum_{n=0}^{\infty}\frac{\mathbb{E}[X^n]}{n!}t^n\\ &=\sum_{n=0}^{\infty}\frac{(\alpha)_n}{(\alpha+\beta)_n}\frac{t^n}{n!} ={}_1F_1(\alpha;\alpha+\beta;t). \end{aligned}

Because 0≤X≤10\le X\le1, the expectation of etXe^{tX} is finite for every real tt. In fact, the power series converges for every complex tt as well.

Worked example: X∼Beta⁡(2,3)X\sim\operatorname{Beta}(2,3)

For this distribution, α=2\alpha=2 and α+β=5\alpha+\beta=5, so

MX(t)=1F1(2;5;t).M_X(t)={}_1F_1(2;5;t).

Expanding the series gives

MX(t)=1+25t+110t2+2105t3+⋯ .M_X(t)=1+\frac{2}{5}t+\frac{1}{10}t^2+\frac{2}{105}t^3+\cdots.

The coefficient of tnt^n is E[Xn]/n!\mathbb{E}[X^n]/n!. For example, the coefficient of tt gives E[X]=2/5\mathbb{E}[X]=2/5. The coefficient of t2t^2 is E[X2]/2!\mathbb{E}[X^2]/2!, so E[X2]=2(1/10)=1/5\mathbb{E}[X^2]=2(1/10)=1/5. Therefore,

Var⁡(X)=E[X2]−E[X]2=15−(25)2=125.\operatorname{Var}(X)=\mathbb{E}[X^2]-\mathbb{E}[X]^2=\frac{1}{5}-\left(\frac{2}{5}\right)^2=\frac{1}{25}.

This agrees with the standard Beta variance formula αβ/[(α+β)2(α+β+1)]\alpha\beta/[(\alpha+\beta)^2(\alpha+\beta+1)].

Common mistakes

  • Using the wrong second parameter. The second parameter of 1F1{}_1F_1 is α+β\alpha+\beta, not just β\beta.
  • Forgetting the factorial in the series. The coefficient of tnt^n is E[Xn]/n!\mathbb{E}[X^n]/n!, not the moment itself.
  • Confusing an MGF with a probability-generating function. The MGF uses etXe^{tX} and a real parameter tt; it is not obtained by substituting a probability value into a discrete generating function.
  • Assuming every MGF has an elementary form. The hypergeometric expression is a standard closed form; for general shape parameters it need not reduce to elementary functions.

A useful check

At t=0t=0, the formula must give MX(0)=1M_X(0)=1, as every MGF does. Differentiating at zero gives MX′(0)=α/(α+β)M_X'(0)=\alpha/(\alpha+\beta), the Beta mean. A formula that fails either check likely has an incorrect parameter or normalization.

References

  1. NIST Digital Library of Mathematical Functions, §13.2: Confluent Hypergeometric Functions
  2. NIST Digital Library of Mathematical Functions, §5.12: Beta Function

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.