Definition (moments of X).mk≜E(Xk), if it exists, k=0,1,2,…. Note that m0=1 always and m1=E(X).
Remark. The moments mk, if they exist, provide information about X. The more moments exist and are known, the better the knowledge about the behavior of X.
Example: moments determine a discrete density
Consider a discrete random variable X with alphabet X={x1,x2,…,xM} and density p=(p1,p2,…,pM), where pi=pX(xi). Let
mk=i=1∑Mxikpi(∗)
(the moments exist for all k≥0). The moments m0,m1,…,mM−1 and the density p are connected by the equations (∗), or in matrix form (m0=1)
The matrix is a Vandermonde matrix, invertible if x1,…,xM are distinct. Conclusion: given the first M−1 moments it is possible to determine the discrete density of size M.
Remark (absolutely continuous case). With random variables with absolutely continuous DF (distribution function) the situation is more complicated. To determine fX(x) it is in general necessary to know all the moments mk, k=1,2,…; moreover there are examples of random variables that are not uniquely determined by their moments, i.e. even if the moments mk exist for all k and are known it might still be impossible to determine fX.
Moment generating function (MGF)
The computation of the moments mk=E(Xk), k=1,2,…, requires the evaluation of infinitely many integrals (continuous case) or series (discrete case),
mk=∫−∞+∞xkfX(x)dx,mk=i∑xikpX(xi).
On the other hand, for the exponential function of X, from eX=∑k=0∞k!Xk and taking the expected value on both sides,
E(eX)=∫exfX(x)dx=k=0∑∞k!E(Xk).
The moments E(Xk) are all involved in the computation of the single integral E(eX). How is it possible to extract mk=E(Xk) from E(eX)?
MX(s)=E(esX)=∫−∞+∞esxfX(x)dx is the bilateral Laplace transform of the density fX(x) limited to s∈R.
Lemma. If (−s0,s0)⊂D for some s0>0, then all the moments mk exist for k=1,2,…; moreover
mk=E(Xk)=ds(k)d(k)MX(s)s=0.
Proof. The proof of the existence of all moments if the MGF exists in a neighborhood (−s0,s0) of the origin is omitted. As for the computation of the moments,
Recall that for any power series g(s)=∑k=0∞aksk, taking the n-th derivative on both sides and evaluating at s=0 gives g(n)(0)=n!an. Substituting into the expression of MX(s) one gets ds(n)d(n)MX(s)s=0=mn. □
Example (binomial). Use the lemma to compute E(X) where X∼Bin(n,p). First the MGF:
The CF of an absolutely continuous random variable coincides with the Fourier transform of the density fX(x). If you are used to the definition of the Fourier transform F(fX(x))(ω)=∫e−jωxfX(x)dx, do not be alarmed: it is a matter of conventions. In probability theory the formulas of the Fourier transform are
WARNING. If Y=aX+b, avoid the stupid mistake φY(ω)=aφX(ω)+b: the CF is not linear in this sense, the argument is rescaled and a phase factor appears.
CF of the sum of independent random variables
Let Z=X+Y where X,Y are independent. Then
φZ(ω)=φX(ω)φY(ω).
Proof. This is a property of Fourier transforms (convolution becomes product) but also trivial to derive probabilistically:
φZ(ω)=E(ejω(X+Y))=E(ejωXejωY)=E(ejωX)E(ejωY)=φX(ω)φY(ω). □
Corollary. If X1,X2,…,Xn are independent then φX1+X2+⋯+Xn(ω)=∏i=1nφXi(ω).
Corollary. If X1,…,Xn are i.i.d. then φX1+⋯+Xn(ω)=[φX1(ω)]n.
The CF characterizes the distribution
Remark. The CF characterizes the DF of a random variable in the sense that for any DF (discrete, absolutely continuous or mixed) there is a unique CF and vice versa. The proof is difficult. Note however that, contrary to DFs and densities that are easy to recognize, it is hard to recognize whether a given function is a CF.
Examples
Example 1.X∼b(p) (Bernoulli). Then φX(ω)=E(ejωX)=ejω0pX(0)+ejω1pX(1)=1−p+pejω.
Example 2.X∼Bin(n,p). Then φX(ω)=∑k=0nejωk(kn)pk(1−p)n−k=(1−p+pejω)n.
Example 3. If X1,…,Xn are i.i.d. b(p), then X=∑i=1nXi has CF φX(ω)=[φX1(ω)]n=(1−p+pejω)n (Example 1). Comparing with Example 2 we have proved that the sum of n i.i.d. b(p) random variables is a Bin(n,p) random variable.
Example 4. Let Z∼N(0,1). Then
φZ(ω)=∫2π1e−21z2ejωzdz=e−21ω2
(a classical example in Signals and Systems). Note: the page writes the exponent as −jωZ; by the symmetry of the density the result is the same.
Example 5. Let X∼N(μ,σ2). Then
φX(ω)=ejμωφZ(σω)=ejμω−21σ2ω2.
Proof.X=σZ+μ where Z∼N(0,1); now apply the rule for affine transformations.
Lemma (linear combinations of independent Gaussians). Linear combinations of independent gaussian random variables are gaussian.
Proof. Let X∼N(μX,σX2), Y∼N(μY,σY2), X⊥Y, and W=αX+βY. Then
Example 8 (sum of independent Poissons). Let X1,…,Xn be independent Poisson random variables, Xi∼P(λi), and Z=∑i=1nXi. Clearly pZ=pX1∗pX2∗⋯∗pXn, but it is much easier to work with CFs:
It is possible, and useful, to define the characteristic function for random vectors. Mathematically this is equivalent to the multidimensional Fourier transform. Only the definition and some basic properties are needed for the time being.
Definition. Let X be an n-dimensional random vector. The CF of X is
WARNING. This is not equal to ∏i=1nE(ejωiXi)=∏i=1nφXi(ωi) unless the random variables (X1,…,Xn) are independent.
The multivariate CF φX(ω) is useful for the same reasons φX(ω) is useful for scalar random variables. In particular φX(ω) completely characterizes the DF of a random vector in the general case, i.e. in the discrete, absolutely continuous or mixed cases.
Properties
(a) Existence.φX(ω) exists for all ω∈Rn, for all X: φX(ω)=E(ejωTX)≤E(∣ejωTX∣)=1.
(b)φX(ω)≤φX(0)=1 (it follows from the proof of existence).
(c) Marginals.φXi(ωi)=E(ejωiXi)=φX(ω)ωj=0for allj=i. Example: φX1(ω1)=φX1X2(ω1,0); the proof is trivial just inspecting the definition. This extends to more complicated marginals; example (n=4): φX1X3(ω1,ω3)=φX1X2X3X4(ω1,0,ω3,0).
(d) Moments (case n=2 for notational compactness). Let V=(X,Y)T, φXY(ω1,ω2)=E(ej(ω1X+ω2Y)). Then
Proof. Imitate the proof of the moments theorem for random variables. The difficult part is to show that there exist as many partial derivatives of φX as moments of X.
Example (correlation matrix). For V=(YX) the correlation matrix is
(e) CF and independence. Recall that (X1,…,Xn) are independent iff (definition) their joint DF factorizes as FX1…Xn(x1,…,xn)=FX1(x1)⋯FXn(xn).
Proof. If (X1,…,Xn) are independent then φX(ω)=E(ej∑iωiXi)=∏iE(ejωiXi)=∏iφXi(ωi). The other direction is much harder to prove; the proof is omitted.
WARNING. If (X1,…,Xn) are independent with scalar CFs φXi(ω), one can define two functions: φ1(ω)=∏i=1nφXi(ω) and φ2(ω1,…,ωn)=∏i=1nφXi(ωi), where φ1(ω)=E(ejω(X1+⋯+Xn)) is the CF of the scalar random variable S=∑iXi and φ2(ω1,…,ωn)=E(ej(ω1X1+⋯+ωnXn)) is the CF of the random vectorX=(X1,…,Xn)T with independent components. They are different objects.
(f) Affine transformations of random vectors. Let Y=AX+b with Y∈Rm, A∈Rm×n, X∈Rn, b∈Rm. The multivariate CF of Y (with ω∈Rm) is
Moments.mk=E(Xk), m0=1, m1=E(X). For a discrete X with M distinct values, m0,…,mM−1 determine p (Vandermonde matrix invertible). For continuous X all moments are in general needed, and even all moments may not determine fX.
MGF.MX(s)=E(esX) on D={s:E(esX) exists}, 0∈D always; bilateral Laplace transform of fX. If (−s0,s0)⊂D: all moments exist and mk=MX(k)(0) (from MX(s)=∑kk!mksk and g(n)(0)=n!an). Binomial: MX(s)=(pes+1−p)n, MX′(0)=np.
Exp(λ): λ−jωλ; sum of n i.i.d.: (λ−jωλ)n, mean λn, variance λ2n (via E(Y2)=λ2(n+1)n).
P(λ): eλ(ejω−1); independent P(λi) sum to P(∑λi).
Multivariate CF.φX(ω)=E(ejωTX), ω∈Rn; exists always, ∣φX∣≤φX(0)=1; characterizes the joint DF.
Marginals: set the other ωj=0, e.g. φX1(ω1)=φX1X2(ω1,0).
Moments: E(XkYh)=jk+h1∂ω1k∂ω2hφXY(0,0); RV=−(Hessian of φV at 0).
Independence iff φX(ω)=∏iφXi(ωi) (the "if" direction is hard, proof omitted).
Affine: Y=AX+b⇒φY(ω)=ejωTbφX(ATω).
Typical mistakes.φaX+b=aφX+b; using ∏iφXi(ωi) for the multivariate CF without independence; confusing ∏iφXi(ω) (CF of the scalar sum) with ∏iφXi(ωi) (CF of the vector); forgetting that φ is complex-valued while the MGF may fail to exist away from 0.