Generating Functions
The moment-generating function of a 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 function or cumulative distribution functions. There are particularly simple results for the moment-generating functions of distributions defined by the weighted sums of random variables. Note, however, that not all random variables have moment-generating functions.
In addition to 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 does not always exist even for real-valued arguments, 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.
The probability generating function of a discrete random variable is a power series representation (the generating function) of the probability mass function of the random variable. Probability generating functions are often employed for their succinct description of the sequence of probabilities [math]\operatorname{P}(X=i)[/math] in the probability mass function for a random variable [math]X[/math], and to make available the well-developed theory of power series with non-negative coefficients.
The Moment Generating Function
Definition
In probability theory and statistics, the moment-generating function of a random variable [math]X[/math] is
wherever this expectation exists. In other terms, the moment-generating function can be interpreted as the expectation of the random variable [math] e^{tX}[/math].
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 always exists and thus may be used instead.
The reason for defining this function is that it can be used to find all the moments of the distribution.[1] The series expansion of [math]e^{tX}[/math] is:
Hence:
where [math]m_n[/math] is the [math]n[/math]th moment. Differentiating [math]M_X(t)[/math] [math]i[/math] times with respect to [math]t[/math] and setting [math]t=0[/math] we obtain the [math]i[/math]th moment about the origin, [math]m_i[/math], see Calculations of moments below.
Calculation
The moment-generating function is the expectation of a function of the random variable, it can be written as:
Case | Calculation |
---|---|
General | [math]M_X(t) = \int_{-\infty}^\infty e^{tx}\,dF(x)[/math], using the Riemann–Stieltjes integral, and where [math]F[/math] is the cumulative distribution function |
Discrete probability mass function | [math]M_X(t)=\sum_{i=1}^\infty e^{tx_i}\, p_i[/math] |
Continuous probability density function | [math] M_X(t) = \int_{-\infty}^\infty e^{tx} f(x)\,dx [/math] |
Sum of independent random variables
If [math]S_n = \sum_{i=1}^{n} a_i X_i[/math], where the [math]X_i[/math] are independent random variables and the [math]a_i[/math] are constants, then the probability density function for [math]S_n[/math] is the convolution of the probability density functions of each of the [math]X_i[/math], and the moment-generating function for [math]S_n[/math] is given by
Calculations of moments
The moment-generating function is so called because if it exists on an open interval around [math]t=0[/math] then it is the exponential generating function of the moments of the probability distribution:
Here [math]n[/math] must be a nonnegative integer.
Relation to other functions
Related to the moment-generating function are a number of other transforms that are common in probability theory:
Function | Description |
---|---|
Characteristic function | The characteristic function [math]\varphi_X(t)[/math] is related to the moment-generating function via [math]\varphi_X(t) = M_{iX}(t) = M_X(it):[/math] the characteristic function is the moment-generating function of iX or the moment generating function of [math]X[/math] 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 functions | The probability-generating function is defined as [math]G(z) = E[z^X].\,[/math] This immediately implies that [math]G(e^t) = E[e^{tX}] = M_X(t).\,[/math] |
Examples
Here are some examples of the moment generating function and the characteristic function for comparison.
Distribution | Moment-generating function M[math]X[/math]([math]t[/math]) | Characteristic function φ(t) |
---|---|---|
Bernoulli [math]\, \operatorname{P}(X=1)=p[/math] | [math]\, 1-p+pe^t[/math] | [math]\, 1-p+pe^{it}[/math] |
Geometric [math](1 - p)^{k-1}\,p\![/math] | [math]\frac{p e^t}{1-(1-p) e^t}\![/math] [math]\forall t\lt-\ln(1-p)\![/math] |
[math]\frac{p e^{it}}{1-(1-p)\,e^{it}}\![/math] |
Binomial [math]B(n, p)[/math] | [math]\, (1-p+pe^t)^n[/math] | [math]\, (1-p+pe^{it})^n[/math] |
Poisson Pois([math]λ[/math]) | [math]\, e^{\lambda(e^t-1)}[/math] | [math]\, e^{\lambda(e^{it}-1)}[/math] |
Uniform (continuous) [math]U(a, b)[/math] | [math]\, \frac{e^{tb} - e^{ta}}{t(b-a)}[/math] | [math]\, \frac{e^{itb} - e^{ita}}{it(b-a)}[/math] |
Uniform (discrete) [math]U(a, b)[/math] | [math]\, \frac{e^{at} - e^{(b+1)t}}{(b-a+1)(1-e^{t})}[/math] | [math]\, \frac{e^{ait} - e^{(b+1)it}}{(b-a+1)(1-e^{it})}[/math] |
Normal [math]N(\mu, \sigma^2)[/math] | [math]\, e^{t\mu + \frac{1}{2}\sigma^2t^2}[/math] | [math]\, e^{it\mu - \frac{1}{2}\sigma^2t^2}[/math] |
Chi-squared [math]\chi^2_k[/math] | [math]\, (1 - 2t)^{-k/2}[/math] | [math]\, (1 - 2it)^{-k/2}[/math] |
Gamma [math]\Gamma(k, \theta)[/math] | [math]\, (1 - t\theta)^{-k}[/math] | [math]\, (1 - it\theta)^{-k}[/math] |
Exponential Exp([math]λ[/math]) | [math]\, (1-t\lambda^{-1})^{-1}, \, (t\lt\lambda) [/math] | [math]\, (1 - it\lambda^{-1})^{-1}[/math] |
Multivariate normal [math]N(\mu, \Sigma)[/math] | [math]\, e^{t^\mathrm{T} \mu + \frac{1}{2} t^\mathrm{T} \Sigma t}[/math] | [math]\, e^{i t^\mathrm{T} \mu - \frac{1}{2} t^\mathrm{T} \Sigma t}[/math] |
Degenerate δa | [math]\, e^{ta}[/math] | [math]\, e^{ita}[/math] |
Laplace [math]L(μ, b)[/math] | [math]\, \frac{e^{t\mu}}{1 - b^2t^2}[/math] | [math]\, \frac{e^{it\mu}}{1 + b^2t^2}[/math] |
Negative Binomial [math]NB(r, p)[/math] | [math]\, \frac{(1-p)^r}{(1-pe^t)^r}[/math] | [math]\, \frac{(1-p)^r}{(1-pe^{it})^r}[/math] |
Cauchy Cauchy([math]μ, θ[/math]) | does not exist | [math]\, e^{it\mu -\theta|t|}[/math] |
The Probability Generating Function
Definition
If [math]X[/math] is a discrete random variable taking values in the non-negative integers {0,1, ...}, then the probability generating function of [math]X[/math] is defined as [2]
where [math]p[/math] is the probability mass function of [math]X[/math]. Note that the subscripted notations [math]G_X[/math] and [math]p_X[/math] are often used to emphasize that these pertain to a particular random variable [math]X[/math], and to its distribution. The power series converges absolutely at least for all complex numbers [math]z \leq 1[/math]; in many examples the radius of convergence is larger.
Properties
Power series
Probability generating functions obey all the rules of power series with non-negative coefficients. In particular, [math]G(1^{-})=1[/math], where
, since the probabilities must sum to one. So the radius of convergence of any probability generating function must be at least 1, by Abel's theorem for power series with non-negative coefficients.
Probabilities and expectations
The following properties allow the derivation of various basic quantities related to [math]X[/math]:
1. The probability mass function of [math]X[/math] is recovered by taking derivatives of [math]G[/math]:
2. It follows from Property 1 that if [math]X[/math] and [math]Y[/math] have identical probability generating functions, then they have identical distributions.
3. The normalization of the probability density function can be expressed in terms of the generating function by
The expectation of [math]X[/math] is given by
More generally, the [math]k[/math]th factorial moment, [math]\textrm{E}(X(X - 1) \cdots (X - k + 1))[/math] of [math]X[/math] is given by
So the variance of [math]X[/math] is given by
4. [math]G_X(e^{t}) = M_X(t)[/math] where [math]X[/math] is a random variable, [math]G_X(t)[/math] is the probability generating function (of [math]X[/math]) and [math]M_X(t)[/math] is the moment generating function (of [math]X[/math]) .
Functions of independent random variables
Probability generating functions are particularly useful for dealing with functions of independent random variables. For example:
- If [math]X_1, X_2, \ldots, X_n[/math] is a sequence of independent (and not necessarily identically distributed) random variables, and
where the [math]a_i[/math] are constants, then the probability generating function is given by
For example, if [math]S_n = \sum_{i=1}^n X_i,[/math] then the probability generating function, GSn(z), is given by
It also follows that the probability generating function of the difference of two independent random variables [math]S[/math] = [math]X[/math]1 − [math]X[/math]2 is
- Suppose that [math]n[/math] is also an independent, discrete random variable taking values on the non-negative integers, with probability generating function [math]G_n[/math]. If the [math]X_1,X_2, \ldots, X_N[/math] are independent and identically distributed with common probability generating function [math]G_X[/math], then [math]G_{S_N}(z) = G_N(G_X(z)).[/math] This can be seen, using the law of total expectation, as follows:
This last fact is useful in the study of Galton–Watson processes.
- Suppose again that [math]N[/math] is also an independent, discrete random variable taking values on the non-negative integers, with probability generating function [math]G_N[/math] and probability density [math]f_i = \operatorname{P}(N = i)[/math]. If the [math]X_1, \ldots, X_N [/math] are independent, but not identically distributed random variables, where [math]G_{X_i}[/math] denotes the probability generating function of [math]X_i[/math], then
For identically distributed [math]X_i[/math] this simplifies to the identity stated before. The general case is sometimes useful to obtain a decomposition of [math]S_N[/math] by means of generating functions.
Examples
The table below gives the probability generating function for some well known discrete distributions.
Distribution | PGF |
---|---|
Degenerate [math]\delta_a[/math] | [math]G(z) = \left(z^a\right)[/math] |
Bernoulli [math]\, \operatorname{P}(X=1)=p[/math] | [math]G(z) = 1/2 + z/2 [/math] |
Binomial [math]\operatorname{B}(n, p)[/math] | [math]G(z) = \left[(1-p) + pz\right]^n [/math] |
Negative Binomial [math]\operatorname{NB}(r,p)[/math] | [math]G(z) = \left(\frac{pz}{1 - (1-p)z}\right)^r[/math] |
Poisson [math]\textrm{Pois}(\lambda) [/math] | [math]G(z) = \textrm{e}^{\lambda(z - 1)}[/math] |
Notes
- Bulmer, M.G., Principles of Statistics, Dover, 1979, pp. 75–79
- http://www.am.qub.ac.uk/users/g.gribakin/sor/Chap3.pdf
References
- Casella, George; Berger, Roger. Statistical Inference (2nd ed.). pp. 59–68. ISBN 978-0-534-24312-8.
- Grimmett, Geoffrey; Welsh, Dominic. Probability - An Introduction (1st ed.). pp. 101 ff. ISBN 978-0-19-853264-4.
- Wikipedia contributors. "Moment-generating function". Wikipedia. Wikipedia. Retrieved 28 January 2022.
- Wikipedia contributors. "Probability-generating function". Wikipedia. Wikipedia. Retrieved 28 January 2022.