Moment-generating function explained

In probability theory and statistics, the moment-generating function of a real-valued random variable is an alternative specification of its probability distribution. Thus, it provides the basis of an alternative route to analytical results compared with working directly with probability density functions or cumulative distribution functions. There are particularly simple results for the moment-generating functions of distributions defined by the weighted sums of random variables. However, not all random variables have moment-generating functions.

As its name implies, the moment-generating function can be used to compute a distribution’s moments: the nth moment about 0 is the nth derivative of the moment-generating function, evaluated at 0.

In addition to real-valued distributions (univariate distributions), moment-generating functions can be defined for vector- or matrix-valued random variables, and can even be extended to more general cases.

The moment-generating function of a real-valued distribution does not always exist, unlike the characteristic function. There are relations between the behavior of the moment-generating function of a distribution and properties of the distribution, such as the existence of moments.

Definition

Let

X

be a random variable with CDF

FX

. The moment generating function (mgf) of

X

(or

FX

), denoted by

MX(t)

, is

MX(t)=\operatornameE\left[etX\right]

provided this expectation exists for

t

in some open neighborhood of 0. That is, there is an

h>0

such that for all

t

in

-h<t<h

,

\operatornameE\left[etX\right]

exists. If the expectation does not exist in an open neighborhood of 0, we say that the moment generating function does not exist.[1]

In other words, the moment-generating function of X is the expectation of the random variable

etX

. More generally, when

X=(X1,\ldots,

T
X
n)
, an

n

-dimensional random vector, and

t

is a fixed vector, one uses

tX=tTX

instead of 

tX

:

MX(t):=\operatornameE

tTX
\left(e

\right).

MX(0)

always exists and is equal to 1. However, a key problem with moment-generating functions is that moments and the moment-generating function may not exist, as the integrals need not converge absolutely. By contrast, the characteristic function or Fourier transform always exists (because it is the integral of a bounded function on a space of finite measure), and for some purposes may be used instead.

The moment-generating function is so named because it can be used to find the moments of the distribution.[2] The series expansion of

etX

is

etX=1+tX+

t2X2
2!

+

t3X3
3!

+ … +

tnXn
n!

+.

Hence

\begin{align} MX(t)=\operatornameE(etX)&=1+t\operatornameE(X)+

t2\operatornameE(X2)
2!

+

t3\operatornameE(X3)
3!

+ … +

tn\operatornameE(Xn)
n!

+ … \\ &=1+tm1+

2m
t
2
2!

+

3m
t
3
3!

+ … +

nm
t
n
n!

+, \end{align}

where

mn

is the

n

th moment. Differentiating

MX(t)

i

times with respect to

t

and setting

t=0

, we obtain the

i

th moment about the origin,

mi

;see Calculations of moments below.

If

X

is a continuous random variable, the following relation between its moment-generating function

MX(t)

and the two-sided Laplace transform of its probability density function

fX(x)

holds:

MX(t)=l{L}\{fX\}(-t),

since the PDF's two-sided Laplace transform is given as

l{L}\{fX\}(s)=

infty
\int
-infty

e-sxfX(x)dx,

and the moment-generating function's definition expands (by the law of the unconscious statistician) to

MX(t)=\operatornameE\left[etX\right]=

infty
\int
-infty

etxfX(x)dx.

This is consistent with the characteristic function of

X

being a Wick rotation of

MX(t)

when the moment generating function exists, as the characteristic function of a continuous random variable

X

is the Fourier transform of its probability density function

fX(x)

, and in general when a function

f(x)

is of exponential order, the Fourier transform of

f

is a Wick rotation of its two-sided Laplace transform in the region of convergence. See the relation of the Fourier and Laplace transforms for further information.

Examples

Here are some examples of the moment-generating function and the characteristic function for comparison. It can be seen that the characteristic function is a Wick rotation of the moment-generating function

MX(t)

when the latter exists.
DistributionMoment-generating function

MX(t)

Characteristic function

\varphi(t)

Degenerate

\deltaa

eta

eita

Bernoulli

P(X=1)=p

1-p+pet

1-p+peit

Geometric

(1-p)k-1p

pet
1-(1-p)et

,~t<-ln(1-p)

peit
1-(1-p)eit
Binomial

B(n,p)

\left(1-p+pet\right)n

\left(1-p+peit\right)n

Negative binomial

\operatorname{NB}(r,p)

\left(p
1-et+pet

\right)r,~t<-ln(1-p)

\left(p
1-eit+peit

\right)r

Poisson

\operatorname{Pois}(λ)

λ(et-1)
e
λ(eit-1)
e
Uniform (continuous)

\operatornameU(a,b)

etb-eta
t(b-a)
eitb-eita
it(b-a)
Uniform (discrete)

\operatorname{DU}(a,b)

eat-e(b
(b-a+1)(1-et)
eait-e(b
(b-a+1)(1-eit)
Laplace

L(\mu,b)

et\mu
1-b2t2

,~

t< 1/b
eit\mu
1+b2t2
Normal

N(\mu,\sigma2)

t\mu+
1
2
\sigma2t2
e
it\mu-
1
2
\sigma2t2
e
Chi-squared
2
\chi
k

(1-

-k
2
2t)

,~t<1/2

(1-

-k
2
2it)
Noncentral chi-squared
2
\chi
k(λ)

eλ(1-

-k
2
2t)

eiλ(1-

-k
2
2it)
Gamma

\Gamma(k,\tfrac{1}{\theta})

(1-t\theta)-k,~t<\tfrac{1}{\theta}

(1-it\theta)-k

Exponential

\operatorname{Exp}(λ)

\left(1-tλ-1\right)-1,~t<λ

\left(1-itλ-1\right)-1

Beta

1

infty
+\sum
k=1

\left(

k-1
\prod
r=0
\alpha+r
\alpha+\beta+r

\right)

tk
k!

{}1F1(\alpha;\alpha+\beta;it)

(see Confluent hypergeometric function)
Multivariate normal

N(\mu,\Sigma)

tT\left(\boldsymbol{\mu
e

+

1
2

\Sigmat\right)}

tT\left(i\boldsymbol{\mu
e

-

1
2

\boldsymbol{\Sigma}t\right)}

Cauchy

\operatorname{Cauchy}(\mu,\theta)

Does not exist

eit\mu

Multivariate Cauchy

\operatorname{MultiCauchy}(\mu,\Sigma)

[3]
Does not exist

itT\boldsymbol\mu-\sqrt{tT\boldsymbol{\Sigma
e

t

}}

Calculation

The moment-generating function is the expectation of a function of the random variable, it can be written as:

MX(t)=\sum

infty
i=0
txi
e

pi

MX(t)=

infty
\int
-infty

etxf(x)dx

MX(t)=

infty
\int
-infty

etxdF(x)

, using the Riemann - Stieltjes integral, and where

F

is the cumulative distribution function. This is simply the Laplace-Stieltjes transform of

F

, but with the sign of the argument reversed.

Note that for the case where

X

has a continuous probability density function

f(x)

,

MX(-t)

is the two-sided Laplace transform of

f(x)

.

\begin{align} MX(t)&=

infty
\int
-infty

etxf(x)dx\\ &=

infty
\int
-infty

\left(1+tx+

t2x2
2!

++

tnxn
n!

+\right)f(x)dx\\ &=1+tm1+

2m
t
2
2!

+ … +

nm
t
n
n!

+ … , \end{align}

where

mn

is the

n

th moment.

Linear transformations of random variables

If random variable

X

has moment generating function

MX(t)

, then

\alphaX+\beta

has moment generating function

M\alpha(t)=e\betaMX(\alphat)

M\alpha(t)=E[e(\alpha]=e\betaE[e\alpha]=e\betaMX(\alphat)

Linear combination of independent random variables

If

Sn=

n
\sum
i=1

aiXi

, where the Xi are independent random variables and the ai are constants, then the probability density function for Sn is the convolution of the probability density functions of each of the Xi, and the moment-generating function for Sn is given by
M
Sn
(t)=M
X1

(a1t)M

X2

(a2t)

M
Xn

(ant).

Vector-valued random variables

X

with real components, the moment-generating function is given by

MX(t)=E\left(e\langle\right)

where

t

is a vector and

\langle,\rangle

is the dot product.

Important properties

Moment generating functions are positive and log-convex, with M(0) = 1.

An important property of the moment-generating function is that it uniquely determines the distribution. In other words, if

X

and

Y

are two random variables and for all values of t,

MX(t)=MY(t),

then

FX(x)=FY(x)

for all values of x (or equivalently X and Y have the same distribution). This statement is not equivalent to the statement "if two distributions have the same moments, then they are identical at all points." This is because in some cases, the moments exist and yet the moment-generating function does not, because the limit

\limn

n
\sum
i=0
im
t
i
i!

may not exist. The log-normal distribution is an example of when this occurs.

Calculations of moments

The moment-generating function is so called because if it exists on an open interval around t = 0, then it is the exponential generating function of the moments of the probability distribution:

mn=E\left(Xn\right)=

(n)
M
X

(0)=\left.

dnMX
dtn

\right|t=0.

That is, with n being a nonnegative integer, the nth moment about 0 is the nth derivative of the moment generating function, evaluated at t = 0.

Other properties

Jensen's inequality provides a simple lower bound on the moment-generating function:

MX(t)\geqe\mu,

where

\mu

is the mean of X.

The moment-generating function can be used in conjunction with Markov's inequality to bound the upper tail of a real random variable X. This statement is also called the Chernoff bound. Since

x\mapstoext

is monotonically increasing for

t>0

, we have

P(X\gea)=P(etX\geeta)\lee-atE[etX]=e-atMX(t)

for any

t>0

and any a, provided

MX(t)

exists. For example, when X is a standard normal distribution and

a>0

, we can choose

t=a

and recall that
t2/2
M
X(t)=e
. This gives

P(X\gea)\le

-a2/2
e
, which is within a factor of 1+a of the exact value.

Various lemmas, such as Hoeffding's lemma or Bennett's inequality provide bounds on the moment-generating function in the case of a zero-mean, bounded random variable.

When

X

is non-negative, the moment generating function gives a simple, useful bound on the moments:

E[Xm]\le\left(

m
te

\right)mMX(t),

For any

X,m\ge0

and

t>0

.

This follows from the inequality

1+x\leex

into which we can substitute

x'=tx/m-1

implies

tx/m\leetx/m-1

for any

x,t,m\inR

.Now, if

t>0

and

x,m\ge0

, this can be rearranged to

xm\le(m/(te))metx

.Taking the expectation on both sides gives the bound on

E[Xm]

in terms of

E[etX]

.

As an example, consider

X\simChi-Squared

with

k

degrees of freedom. Then from the examples
-k/2
M
X(t)=(1-2t)
.Picking

t=m/(2m+k)

and substituting into the bound:

E[Xm]\le(1+2m/k)k/2e-m(k+2m)m.

We know that in this case the correct bound is

E[Xm]\le2m\Gamma(m+k/2)/\Gamma(k/2)

.To compare the bounds, we can consider the asymptotics for large

k

.Here the moment-generating function bound is

km(1+m2/k+O(1/k2))

,where the real bound is

km(1+(m2-m)/k+O(1/k2))

.The moment-generating function bound is thus very strong in this case.

Relation to other functions

Related to the moment-generating function are a number of other transforms that are common in probability theory:

Characteristic function

\varphiX(t)

is related to the moment-generating function via

\varphiX(t)=MiX(t)=MX(it):

the characteristic function is the moment-generating function of iX or the moment generating function of X evaluated on the imaginary axis. This function can also be viewed as the Fourier transform of the probability density function, which can therefore be deduced from it by inverse Fourier transform.
Cumulant-generating function
  • The cumulant-generating function is defined as the logarithm of the moment-generating function; some instead define the cumulant-generating function as the logarithm of the characteristic function, while others call this latter the second cumulant-generating function.
    Probability-generating function
  • The probability-generating function is defined as

    G(z)=E\left[zX\right].

    This immediately implies that

    G(et)=E\left[etX\right]=MX(t).

    See also

    References

    Sources

    Notes and References

    1. Book: Casella . George. Berger. Roger L. . Statistical Inference . Wadsworth & Brooks/Cole. 1990 . 61 . 0-534-11958-1 .
    2. Book: Bulmer, M. G. . Principles of Statistics . Dover . 1979 . 75–79 . 0-486-63760-3 .
    3. Kotz et al. p. 37 using 1 as the number of degree of freedom to recover the Cauchy distribution