1.9. Some Special Expectations¶
1.9.1. Mean and Variance¶
Definition 1.9.1 : Mean
Let \(X\) be a random variable whose expectation exists. The mean value \(\mu\) of \(X\) is defined to be \(\mu=E(X)\).
Definition 1.9.2 : Variance
Let \(X\) be a random variable with finite mean \(\mu\) such that \(E\left[(X-\mu)^{2}\right]\) is finite. The variance of \(X\) is defined to be \(E\left[(X-\mu)^{2}\right]\). It is usually denoted by \(\sigma^{2}\) or by \(\operatorname{Var}(X)\).
Theorem 1.9.3 : Variance formula
Let \(\mu=E(X)\) and \(\sigma^{2}=\operatorname{Var}(X)\). Then
This formula often provides an easier way to compute the variance of \(X\).
Proof
Expanding the square and using the linearity of \(E\) gives
Definition 1.9.4 : Standard deviation
The standard deviation of \(X\) (or of its distribution) is \(\sigma\), the positive square root of the variance.
The number \(\sigma\) is sometimes interpreted as a measure of the dispersion of the points of the space relative to the mean value \(\mu\). If the space contains only one point \(k\) for which \(p(k)>0\), then \(p(k)=1\), \(\mu=k\), and \(\sigma=0\).
Theorem 1.9.5 : Variance of a linear transformation
Let \(X\) be a random variable with finite mean \(\mu\) and variance \(\sigma^{2}\). Then for all constants \(a\) and \(b\),
Proof
Because \(E\) is linear, \(E(a X+b)=a\mu+b\). Hence, by definition,
Corollary 1.9.6 : Standard deviation under an affine transformation
For standard deviations,
1.9.2. Moment Generating Function¶
Definition 1.9.7 : Moment generating function
Let \(X\) be a random variable such that, for some \(h>0\), the expectation of \(e^{tX}\) exists for \(-h<t<h\). The moment generating function of \(X\), abbreviated mgf, is the function
When discussing several random variables, we may write \(M_X\) to denote the mgf of \(X\).
Example 1.9.8 : Moment generating function for a spinner
Suppose a fair spinner has the numbers 1, 2, and 3, and the spins are independent. Let \(X\) be the number of spins until the first 3 occurs. The pmf of \(X\) is
Using the geometric series (Theorem 1.2.13), the mgf of \(X\) is
provided that \(e^t(2/3)<1\), or equivalently, \(t<\log(3/2)\). This interval is an open interval about 0, so the mgf of \(X\) exists and is given by the final expression above.
Theorem 1.9.9 : Uniqueness of moment generating functions
Let \(X\) and \(Y\) be random variables with moment generating functions \(M_X\) and \(M_Y\), respectively, existing in open intervals about \(0\). Then \(F_X(z)=F_Y(z)\) for all \(z \in \mathbb{R}\) if and only if \(M_X(t)=M_Y(t)\) for all \(t \in (-h,h)\) for some \(h>0\).
This theorem is used without proof.
Example 1.9.10 : Identifying discrete distributions from their mgfs
The discrete case illustrate the uniqueness of a distribution determined by its mgf.
Suppose a random variable \(X\) of the discrete type has mgf
If \(p(x)\) is its pmf with support \(\{a_1,a_2,a_3,\ldots\}\), then
so
Since this identity holds for every real \(t\), it suggests that the right-hand side consists of four terms matching those on the left. Thus we may take \(a_i=i\) and \(p(a_i)=i/10\) for \(i=1,2,3,4\), giving
Example 1.9.11 : Identifying continuous distributions from their mgfs
The continuous case illustrates the uniqueness of a distribution determined by its mgf.
Suppose \(X\) is of the continuous type and has mgf
Its pdf \(f(x)\) must satisfy
Although it is not obvious how to recover \(f(x)\) directly from this identity, consider the pdf
Substituting this pdf into the defining integral gives, for \(t<1\),
The last equality holds because \(1-t>0\), so \(e^{-(1-t)b}\to0\) as \(b\to\infty\). Thus this pdf has the required mgf \(M(t)=(1-t)^{-1}\) for \(t<1\). By the uniqueness of the mgf in Theorem 1.9.9, \(X\) has a distribution with this pdf.
Theorem 1.9.12 : Existence of derivatives of all orders
If the mgf \(M_X(t)=E[e^{tX}]\) is finite for \(-h<t<h\) for some \(h>0\), then derivatives of \(M_X\) of every order exist at \(t=0\), and
Moreover,
Proof
Choose any \(a\) with \(0<a<h\). Since \(e^{a|x|}\leq e^{ax}+e^{-ax}\) for every real \(x\),
The exponential series has nonnegative terms, so
Taking expectations gives
Thus every moment \(E[X^n]\) exists and is finite.
To obtain a power series for \(M_X\), fix \(t\) with \(0<|t|<a\) and let \(q=|t|/a<1\). By the exponential series, for every nonnegative integer \(N\),
Taking expectations and using linearity for the finite sum yields
The identity also holds at \(t=0\), where \(M_X(0)=1\), so
This argument justifies the expansion by bounding the expected remainder directly. Moreover, the moment bound gives
Hence the power series has radius of convergence at least \(a\) and can be differentiated term by term any number of times within this interval. For each nonnegative integer \(k\),
Evaluating at \(t=0\) leaves only the term with \(n=k\), giving
Since \(a\) can be chosen arbitrarily close to \(h\), the power series representation in fact holds for every \(|t|<h\).
Definition 1.9.13 : Moment of a distribution
\(E\left(X^{m}\right)\) is called the \(m\)th moment of the distribution, or the \(m\)th moment of \(X\).
Example 1.9.14 : A distribution without an mgf
The series
converges to \(\pi^{2}/6\). Therefore,
is the pmf of a discrete random variable \(X\). The mgf of this distribution, if it exists, is given by
By the ratio test, this series diverges if \(t>0\). Thus, there is no positive number \(h\) such that \(M(t)\) exists for \(-h<t<h\). Accordingly, this distribution has a pmf but does not have an mgf.
Example 1.9.15 : Nonexistence of the Cauchy mgf
Let \(X\) be a continuous random variable with pdf
This is the Cauchy pdf.
Let \(t>0\) be given. If \(x>0\), then the mean value theorem gives, for some \(0<\xi_{0}<tx\),
Hence, \(e^{tx}\geq 1+tx\geq tx\), which yields the second inequality below:
Because \(t>0\) was arbitrary, the integral does not exist in an open interval about \(0\). Hence, the mgf of the Cauchy distribution does not exist.
Example 1.9.16 : Moments from a Maclaurin series
Let \(X\) have the mgf
As discussed in Chapter 3, this is the mgf of a standard normal distribution. The moments of \(X\) can be found by repeatedly differentiating \(M(t)\), or by comparing coefficients in its Maclaurin series. Expanding the exponential gives
On the other hand, the Maclaurin series of \(M(t)\) is
Thus the coefficient of \(t^{m}/m!\) is \(E\left(X^{m}\right)\). Comparing the two expansions yields
This result is used in Section 3.4.
1.9.3. Characteristic Function¶
Definition 1.9.17 : Characteristic function
Let \(i\) denote the imaginary unit and \(t\) an arbitrary real number. The characteristic function of the distribution of \(X\) is defined by
This expectation exists for every distribution.
Theorem 1.9.18 : Existence of the characteristic function
The characteristic function \(\varphi(t)\) exists for every \(t\in\mathbb{R}\) and satisfies
Proof
Suppose \(X\) is continuous with pdf \(f(x)\). For every real \(t\) and \(x\),
Since \(f(x)\geq0\), we have
Thus the integral defining \(\varphi(t)\) converges absolutely for every \(t\in\mathbb{R}\). Moreover,
In the discrete case, the same argument applies with a summation in place of the integral.
Theorem 1.9.19 : Uniqueness of characteristic functions and distributions
Every probability distribution has a unique characteristic function, and each characteristic function corresponds to a unique probability distribution.
This theorem is used without proof.
Theorem 1.9.20 : Obtaining moments from the characteristic function
Let \(X\) have characteristic function \(\varphi(t)=E(e^{itX})\). If \(E(|X|^n)<\infty\) for a positive integer \(n\), then \(\varphi\) is \(n\) times continuously differentiable on \(\mathbb{R}\) and, for each \(k=1,\ldots,n\),
In particular,
Proof
Since \(|x|^k\leq 1+|x|^n\) for \(0\leq k\leq n\), all the expectations
are finite, and \(F_0=\varphi\). We prove that \(F_k'=F_{k+1}\) for \(k<n\) by controlling the difference quotient explicitly. Elementary calculus gives, for real \(u\),
For \(h\neq 0\),
On \(|X|\leq A\), the absolute value of the integrand is at most \(|h|A^{k+2}/2\). On \(|X|>A\), it is at most \(2|X|^{k+1}\). Writing \(\mathbf{1}_{\{|X|>A\}}\) for the indicator of the event \(|X|>A\), we obtain
The second term tends to zero as \(A\to\infty\) because it is the tail of the finite absolute moment \(E(|X|^{k+1})\). First choose \(A\) so that this term is arbitrarily small, and then let \(h\to 0\) with \(A\) fixed. This proves \(F_k'(t)=F_{k+1}(t)\), so induction gives the asserted derivative formula.
The same separation into \(|X|\leq A\) and \(|X|>A\) gives
Choosing \(A\) first and then letting \(h\to 0\) proves continuity of \(F_n\). Each \(F_k\) with \(k<n\) is differentiable and hence continuous. Thus \(\varphi\) is \(n\) times continuously differentiable, and evaluating at \(t=0\) gives the moment identities.
Note that the existence of a characteristic function alone does not guarantee differentiability. For example, a standard Cauchy random variable has characteristic function \(\varphi(t)=e^{-|t|}\), whose left and right derivatives at zero are \(1\) and \(-1\), respectively.
Concept 1.9.21 : Connection to Laplace and Fourier transforms
The moment-generating function \(M(t)\) and the characteristic function \(\varphi(t)\) are similar to Laplace and Fourier transforms. The uniqueness of these transforms allows us to assert the uniqueness of the moment-generating and characteristic functions.