Mathematical Methods Handbook

Probability and random variables

Probability spaces, distributions, expectations and transforms.

In this chapter 8

Tick a unit to add it to your PDF basket.

  1. Random variables
  2. Generating and characteristic functions

Random variables

6

Definition

Probability spaces

Adapted

Sets up the triple of sample space, sigma-field and probability measure on which every later probabilistic statement is made, derives the elementary consequences of the axioms including continuity along monotone sequences, and defines conditioning and independence, from which the partition theorem and Bayes' theorem follow in two lines each.

Note(What the axioms are for)Original

Probability is a measure-theoretic subject wearing different clothes. A probability space is a measure space of total mass one, an event is a measurable set, and a random variable is a measurable function; the names change because the questions do. Folland (Folland (1999), §10.1, p. 314) sets the two vocabularies side by side in a table, and the translation is exact.

What the axioms buy is modest and indispensable. They do not say what the probability of any particular event is — that is part of the description of the experiment, not of the theory — and they do not define probability as a limiting frequency. They say only that probabilities are numbers in [0,1][0,1] that add over disjoint alternatives, including over countably many of them. Everything in the rest of this part is deduced from that, together with the two derived notions of this unit: conditioning, which restricts attention to a sub-population, and independence, which says that a restriction changes nothing.

Definition(Sample space, sigma-field, probability measure)AdaptedAdapted from Grimmett & Stirzaker (2020), Ch. 1, the recapitulation on p. 4 and Definition (1.3.1), p. 5; Folland (1999), §10.1, the dictionary on p. 314

Let Ω\Omega be a set, whose elements ω\omega are the possible outcomes of an experiment; Ω\Omega is the sample space.

A collection F\mathcal{F} of subsets of Ω\Omega is a σ\sigma-field (measure theorists say σ\sigma-algebra) if it contains ∅\emptyset, is closed under complementation, and is closed under countable unions. Its members are the events; to say that AA is an event is exactly to say A∈FA \in \mathcal{F}. Closure under countable intersections follows by De Morgan.

A probability measure on (Ω,F)(\Omega, \mathcal{F}) is a function P:F→[0,1]\mathbb{P} : \mathcal{F} \to [0,1] with

  1. P(∅)=0\mathbb{P}(\emptyset) = 0 and P(Ω)=1\mathbb{P}(\Omega) = 1;
  2. countable additivity: whenever A1,A2,…A_1, A_2, \dots are members of F\mathcal{F} that are pairwise disjoint, meaning Ai∩Aj=∅A_i \cap A_j = \emptyset for i≠ji \neq j, P(⋃i=1∞Ai)  =  ∑i=1∞P(Ai).\mathbb{P}\Bigl( \bigcup_{i=1}^{\infty} A_i \Bigr) \; = \; \sum_{i=1}^{\infty} \mathbb{P}(A_i) .

The triple (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}) is a probability space. It is a measure space (see Sigma-algebras and measures) whose total mass is 11.

An event AA with P(A)=0\mathbb{P}(A) = 0 is called null; if P(A)=1\mathbb{P}(A) = 1 we say AA occurs almost surely, abbreviated a.s. A null event is not the same as the impossible event ∅\emptyset: a dart thrown at a target hits some particular point, and the event that it hits that point had probability zero.

The elementary case is a finite Ω\Omega with all outcomes equally likely, F\mathcal{F} the collection of all subsets, and P(A)=∣A∣/∣Ω∣\mathbb{P}(A) = \lvert A \rvert / \lvert \Omega \rvert. Then probability is counting, and the whole difficulty is combinatorial.

Definition(Consequences of the axioms)AdaptedAdapted from Grimmett & Stirzaker (2020), Lemma (1.3.4) and Theorem (1.3.5), pp. 6-7; Riley, Hobson & Bence (2006), eqs. (30.9)-(30.16), pp. 1125-1127; Arfken, Weber & Harris (2013), eq. (23.4), p. 1128

Let (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}) be a probability space and let A,B,A1,A2,…A, B, A_1, A_2, \dots be events.

  1. Complement. P(Ac)=1−P(A)\mathbb{P}(A^{c}) = 1 - \mathbb{P}(A).
  2. Monotonicity. If A⊆BA \subseteq B then P(B)=P(A)+P(B∖A)≥P(A)\mathbb{P}(B) = \mathbb{P}(A) + \mathbb{P}(B \setminus A) \ge \mathbb{P}(A).
  3. Addition law. P(A∪B)=P(A)+P(B)−P(A∩B)\mathbb{P}(A \cup B) = \mathbb{P}(A) + \mathbb{P}(B) - \mathbb{P}(A \cap B).
  4. Inclusion-exclusion. For any n≥1n \ge 1, P(⋃i=1nAi)  =  ∑iP(Ai)  −∑i<jP(Ai∩Aj)  +∑i<j<kP(Ai∩Aj∩Ak)  −  ⋯  +  (−1)n+1 P(A1∩⋯∩An),\mathbb{P}\Bigl( \bigcup_{i=1}^{n} A_i \Bigr) \; = \; \sum_{i} \mathbb{P}(A_i) \; - \sum_{i<j} \mathbb{P}(A_i \cap A_j) \; + \sum_{i<j<k} \mathbb{P}(A_i \cap A_j \cap A_k) \; - \; \cdots \; + \; (-1)^{n+1}\,\mathbb{P}(A_1 \cap \cdots \cap A_n) , each sum running over unordered index sets of the stated size.
  5. Countable subadditivity. P(⋃i≥1Ai)≤∑i≥1P(Ai)\mathbb{P}\bigl( \bigcup_{i \ge 1} A_i \bigr) \le \sum_{i \ge 1} \mathbb{P}(A_i), with no disjointness assumed.
  6. Continuity along monotone sequences. If A1⊆A2⊆⋯A_1 \subseteq A_2 \subseteq \cdots and A=⋃i≥1AiA = \bigcup_{i \ge 1} A_i, then P(Ai)→P(A)\mathbb{P}(A_i) \to \mathbb{P}(A) as i→∞i \to \infty. If B1⊇B2⊇⋯B_1 \supseteq B_2 \supseteq \cdots and B=⋂i≥1BiB = \bigcap_{i \ge 1} B_i, then P(Bi)→P(B)\mathbb{P}(B_i) \to \mathbb{P}(B).

Property 6 is the one that distinguishes countable from merely finite additivity: given finite additivity, countable additivity holds if and only if P\mathbb{P} is continuous in this sense.

Idea of the proof(Everything is a disjoint union)Original

The only tool the axioms give is additivity over disjoint events, so every proof below consists of rewriting the event of interest as a disjoint union and then adding.

For the addition law, A∪BA \cup B is AA together with the part of BB outside AA. For a nested increasing sequence, AA is A1A_1 together with the successive shells Ai+1∖AiA_{i+1} \setminus A_i, which are disjoint, so countable additivity turns P(A)\mathbb{P}(A) into a telescoping series whose partial sums are exactly P(An)\mathbb{P}(A_n). For subadditivity one cannot disjointify without losing mass, so one disjointifies downwards: replace AiA_i by the part of it not already covered, which is a subset, and use monotonicity to pay for the replacement.

Conditioning is a renormalisation. Restricting attention to the outcomes in BB makes BB the new sure event, so every probability must be divided by P(B)\mathbb{P}(B) to restore total mass one; AA then occurs exactly when A∩BA \cap B does. The partition theorem and Bayes' theorem are what this renormalisation looks like read in the two possible directions: forwards, summing causes to get the probability of an effect; backwards, dividing to recover the probability of a cause from an observed effect.

Proof(Consequences 1-6)AdaptedAdapted from Grimmett & Stirzaker (2020), the proofs of Lemma (1.3.4) and Theorem (1.3.5), pp. 6-7

Throughout, disjoint unions are written out explicitly and axiom 2 of the definition is applied; a finite disjoint union is covered by taking all but finitely many of the AiA_i to be ∅\emptyset, which is legitimate because P(∅)=0\mathbb{P}(\emptyset) = 0.

1. Ω=A∪Ac\Omega = A \cup A^{c} is a disjoint union, so 1=P(Ω)=P(A)+P(Ac)1 = \mathbb{P}(\Omega) = \mathbb{P}(A) + \mathbb{P}(A^{c}).

2. If A⊆BA \subseteq B then B=A∪(B∖A)B = A \cup (B \setminus A) is a disjoint union, so P(B)=P(A)+P(B∖A)\mathbb{P}(B) = \mathbb{P}(A) + \mathbb{P}(B\setminus A), and the second term is non-negative because P\mathbb{P} takes values in [0,1][0,1].

3. Write A∪B=A∪(B∖A)A \cup B = A \cup (B \setminus A), again disjoint, so P(A∪B)=P(A)+P(B∖A)\mathbb{P}(A \cup B) = \mathbb{P}(A) + \mathbb{P}(B \setminus A). Now B∖A=B∖(A∩B)B \setminus A = B \setminus (A \cap B) and A∩B⊆BA \cap B \subseteq B, so step 2 gives P(B∖A)=P(B)−P(A∩B)\mathbb{P}(B \setminus A) = \mathbb{P}(B) - \mathbb{P}(A \cap B). Substituting gives the addition law.

4. Induction on nn. The case n=2n = 2 is step 3. Suppose the formula holds for n−1n-1 events and put C=A1∪⋯∪An−1C = A_1 \cup \cdots \cup A_{n-1}. By step 3,

P(C∪An)=P(C)+P(An)−P(C∩An),\mathbb{P}(C \cup A_n) = \mathbb{P}(C) + \mathbb{P}(A_n) - \mathbb{P}(C \cap A_n),

and C∩An=⋃i≤n−1(Ai∩An)C \cap A_n = \bigcup_{i \le n-1} (A_i \cap A_n) is a union of n−1n-1 events, so the inductive hypothesis applies to both P(C)\mathbb{P}(C) and P(C∩An)\mathbb{P}(C \cap A_n). Collecting terms of each size: a set S⊆{1,…,n}S \subseteq \{1,\dots,n\} with n∉Sn \notin S contributes once, from P(C)\mathbb{P}(C), with sign (−1)∣S∣+1(-1)^{\lvert S\rvert+1}; a set containing nn with ∣S∣≥2\lvert S \rvert \ge 2 contributes once, from −P(C∩An)-\mathbb{P}(C \cap A_n), where it appears as S∖{n}S \setminus \{n\} with sign (−1)∣S∣(-1)^{\lvert S\rvert}, so after the minus sign its sign is (−1)∣S∣+1(-1)^{\lvert S\rvert+1} as required; and S={n}S = \{n\} contributes the term P(An)\mathbb{P}(A_n).

5. Disjointify downwards: set D1=A1D_1 = A_1 and Di=Ai∖(A1∪⋯∪Ai−1)D_i = A_i \setminus (A_1 \cup \cdots \cup A_{i-1}) for i≥2i \ge 2. The DiD_i are pairwise disjoint with the same union as the AiA_i, and Di⊆AiD_i \subseteq A_i. Hence by countable additivity and then monotonicity,

P(⋃iAi)=∑iP(Di)≤∑iP(Ai).\mathbb{P}\Bigl( \bigcup_i A_i \Bigr) = \sum_i \mathbb{P}(D_i) \le \sum_i \mathbb{P}(A_i) .

6. Let A1⊆A2⊆⋯A_1 \subseteq A_2 \subseteq \cdots with union AA. Put C1=A1C_1 = A_1 and Ci+1=Ai+1∖AiC_{i+1} = A_{i+1} \setminus A_i for i≥1i \ge 1. These are pairwise disjoint, since the AiA_i increase, and ⋃i≤nCi=An\bigcup_{i \le n} C_i = A_n while ⋃i≥1Ci=A\bigcup_{i \ge 1} C_i = A. Countable additivity gives

P(A)=∑i≥1P(Ci)=lim⁡n→∞∑i≤nP(Ci)=lim⁡n→∞P(An),\mathbb{P}(A) = \sum_{i \ge 1} \mathbb{P}(C_i) = \lim_{n \to \infty} \sum_{i \le n} \mathbb{P}(C_i) = \lim_{n \to \infty} \mathbb{P}(A_n) ,

the last equality by finite additivity. For a decreasing sequence B1⊇B2⊇⋯B_1 \supseteq B_2 \supseteq \cdots, apply what has just been proved to the increasing sequence BicB_i^{c}, whose union is BcB^{c}, and use step 1 twice:

1−P(B)=P(Bc)=lim⁡iP(Bic)=1−lim⁡iP(Bi).□1 - \mathbb{P}(B) = \mathbb{P}(B^{c}) = \lim_{i} \mathbb{P}(B_i^{c}) = 1 - \lim_{i} \mathbb{P}(B_i) . \qquad \square
Definition(Conditional probability, independence)AdaptedAdapted from Grimmett & Stirzaker (2020), Definition (1.4.1), p. 9, Definition (1.5.1) and the following remark, p. 13, and eq. (1.5.5), p. 14; Riley, Hobson & Bence (2006), eqs. (30.19)-(30.22), pp. 1129-1130; Folland (1999), §10.1, the conditional probability measure and the definition of an independent collection, p. 315

Let (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}) be a probability space.

Conditional probability. If BB is an event with P(B)>0\mathbb{P}(B) > 0, the probability of AA given BB is

P(A∣B)  =  P(A∩B)P(B).\mathbb{P}(A \mid B) \; = \; \frac{\mathbb{P}(A \cap B)}{\mathbb{P}(B)} .

For fixed BB the map A↦P(A∣B)A \mapsto \mathbb{P}(A \mid B) is itself a probability measure on (Ω,F)(\Omega, \mathcal{F}): it is non-negative, assigns 11 to Ω\Omega, and inherits countable additivity from P\mathbb{P} because (⋃iAi)∩B=⋃i(Ai∩B)(\bigcup_i A_i) \cap B = \bigcup_i (A_i \cap B) preserves disjointness. So every result proved for probability measures holds verbatim for conditional probabilities.

Rearranged, the definition is the chain rule P(A∩B)=P(B) P(A∣B)\mathbb{P}(A \cap B) = \mathbb{P}(B)\,\mathbb{P}(A \mid B), which iterates: provided P(A1∩⋯∩An−1)>0\mathbb{P}(A_1 \cap \cdots \cap A_{n-1}) > 0,

P(A1∩⋯∩An)=P(A1) P(A2∣A1) P(A3∣A1∩A2)⋯P(An∣A1∩⋯∩An−1).\mathbb{P}(A_1 \cap \cdots \cap A_n) = \mathbb{P}(A_1)\,\mathbb{P}(A_2 \mid A_1)\,\mathbb{P}(A_3 \mid A_1 \cap A_2) \cdots \mathbb{P}(A_n \mid A_1 \cap \cdots \cap A_{n-1}) .

Independence. Events AA and BB are independent if

P(A∩B)=P(A) P(B).\mathbb{P}(A \cap B) = \mathbb{P}(A)\,\mathbb{P}(B) .

When P(B)>0\mathbb{P}(B) > 0 this says exactly P(A∣B)=P(A)\mathbb{P}(A \mid B) = \mathbb{P}(A), which is the meaning; the product form is taken as the definition because it is symmetric in AA and BB and remains meaningful when P(B)=0\mathbb{P}(B) = 0.

A family {Ai:i∈I}\{A_i : i \in I\} of events is independent if

P(⋂i∈JAi)=∏i∈JP(Ai)for every finite J⊆I,\mathbb{P}\Bigl( \bigcap_{i \in J} A_i \Bigr) = \prod_{i \in J} \mathbb{P}(A_i) \qquad \text{for every finite } J \subseteq I ,

and pairwise independent if this holds for every JJ of size 22. Pairwise independence is strictly weaker; see the remark below.

Finally, for an event CC with P(C)>0\mathbb{P}(C) > 0, events AA and BB are conditionally independent given CC if P(A∩B∣C)=P(A∣C) P(B∣C)\mathbb{P}(A \cap B \mid C) = \mathbb{P}(A \mid C)\,\mathbb{P}(B \mid C), that is, if they are independent under the conditional measure.

Partition. A finite or countable family {Bi}\{B_i\} of events is a partition of Ω\Omega if the BiB_i are pairwise disjoint and their union is Ω\Omega. Every outcome then lies in exactly one BiB_i.

Definition(The partition theorem and Bayes' theorem)AdaptedAdapted from Grimmett & Stirzaker (2020), Lemma (1.4.4), p. 10, and Exercise (1.4.1), p. 12; Riley, Hobson & Bence (2006), eqs. (30.24), (30.26), (30.28) and (30.29), pp. 1130-1133; Arfken, Weber & Harris (2013), eqs. (23.10) and (23.11), p. 1130

Let {B1,B2,… }\{B_1, B_2, \dots\} be a partition of Ω\Omega with P(Bi)>0\mathbb{P}(B_i) > 0 for every ii, and let AA be any event.

  1. Partition theorem (law of total probability): P(A)  =  ∑iP(A∣Bi) P(Bi).\mathbb{P}(A) \; = \; \sum_i \mathbb{P}(A \mid B_i)\,\mathbb{P}(B_i) . In particular P(A)=P(A∣B)P(B)+P(A∣Bc)P(Bc)\mathbb{P}(A) = \mathbb{P}(A \mid B)\mathbb{P}(B) + \mathbb{P}(A \mid B^{c})\mathbb{P}(B^{c}) whenever 0<P(B)<10 < \mathbb{P}(B) < 1.
  2. Bayes' theorem. If also P(A)>0\mathbb{P}(A) > 0, then for each kk P(Bk∣A)  =  P(A∣Bk) P(Bk)P(A)  =  P(A∣Bk) P(Bk)∑iP(A∣Bi) P(Bi).\mathbb{P}(B_k \mid A) \; = \; \frac{\mathbb{P}(A \mid B_k)\,\mathbb{P}(B_k)}{\mathbb{P}(A)} \; = \; \frac{\mathbb{P}(A \mid B_k)\,\mathbb{P}(B_k)}{\sum_i \mathbb{P}(A \mid B_i)\,\mathbb{P}(B_i)} .
  3. Odds form. For any two events B,CB, C of positive probability and any AA with P(A)>0\mathbb{P}(A) > 0, P(B∣A)P(C∣A)  =  P(B)P(C)⋅P(A∣B)P(A∣C),\frac{\mathbb{P}(B \mid A)}{\mathbb{P}(C \mid A)} \; = \; \frac{\mathbb{P}(B)}{\mathbb{P}(C)} \cdot \frac{\mathbb{P}(A \mid B)}{\mathbb{P}(A \mid C)} , in which P(A)\mathbb{P}(A) does not appear. Riley, Hobson and Bence (Riley, Hobson & Bence (2006), eq. (30.29), p. 1133) note that this form is the useful one when only relative probabilities are wanted.

The names attached to the three factors in part 2 are standard: P(Bk)\mathbb{P}(B_k) is the prior, P(A∣Bk)\mathbb{P}(A \mid B_k) the likelihood of the observation AA under hypothesis BkB_k, and P(Bk∣A)\mathbb{P}(B_k \mid A) the posterior.

Proof(The partition theorem and Bayes' theorem)AdaptedAdapted from Grimmett & Stirzaker (2020), the proof of Lemma (1.4.4), p. 10; Arfken, Weber & Harris (2013), the decomposition argument for eq. (23.11), p. 1130

1. The sets A∩BiA \cap B_i are pairwise disjoint, because the BiB_i are, and their union is A∩Ω=AA \cap \Omega = A. Countable additivity gives

P(A)=∑iP(A∩Bi).\mathbb{P}(A) = \sum_i \mathbb{P}(A \cap B_i) .

Each term is rewritten by the chain rule, which is available because P(Bi)>0\mathbb{P}(B_i) > 0:

P(A∩Bi)=P(A∣Bi) P(Bi).\mathbb{P}(A \cap B_i) = \mathbb{P}(A \mid B_i)\,\mathbb{P}(B_i) .

Summing gives the claim. For the two-event version take the partition {B,Bc}\{B, B^{c}\}, both of positive probability by hypothesis.

2. Since P(A)>0\mathbb{P}(A) > 0 the quantity P(Bk∣A)\mathbb{P}(B_k \mid A) is defined, and by the definition of conditional probability applied twice to the same intersection,

P(Bk∣A) P(A)=P(A∩Bk)=P(A∣Bk) P(Bk).\mathbb{P}(B_k \mid A)\,\mathbb{P}(A) = \mathbb{P}(A \cap B_k) = \mathbb{P}(A \mid B_k)\,\mathbb{P}(B_k) .

Dividing by P(A)\mathbb{P}(A) gives the first equality. Replacing P(A)\mathbb{P}(A) by the sum from part 1 gives the second; this is the only place where the family is required to be a partition rather than just a disjoint family.

3. Apply the first equality of part 2 to BB and to CC and divide the two identities; the common factor P(A)\mathbb{P}(A) cancels. □\square

Remark(Where each hypothesis is used)AdaptedAdapted from Grimmett & Stirzaker (2020), the remark after Definition (1.5.1) and Example (1.5.2), pp. 13-14, and the comment on Theorem (1.3.5), p. 7; Folland (1999), §10.1, p. 315

Countable, not finite, additivity. Only the continuity property (consequence 6) uses the full strength of axiom 2; consequences 1-4 need no more than finite additivity. Continuity is what lets a probability be computed as a limit of approximations, and without it the distribution function of a random variable need not be right-continuous and the Borel-Cantelli lemmas have no proof. Convergence of random variables rests on consequence 6 at almost every step.

Positivity of the conditioning event. P(A∣B)\mathbb{P}(A \mid B) is undefined when P(B)=0\mathbb{P}(B) = 0, and this is not a removable blemish: conditioning on a null event genuinely has no unique answer, and different limiting procedures give different results. Conditional expectation is the construction that handles the case P(B)=0\mathbb{P}(B) = 0, and it does so by changing the question rather than by patching the quotient. In the partition theorem the hypothesis P(Bi)>0\mathbb{P}(B_i) > 0 is needed for each term to be defined; if some P(Bi)=0\mathbb{P}(B_i) = 0 the identity still holds with that term read as P(A∩Bi)=0\mathbb{P}(A \cap B_i) = 0.

Independence is not disjointness. Grimmett and Stirzaker single out the belief that A∩B=∅A \cap B = \emptyset makes AA and BB independent as a common error. It is close to the opposite of the truth: if AA and BB are disjoint then the occurrence of BB rules AA out entirely, and P(A∣B)=0\mathbb{P}(A \mid B) = 0. Disjoint events of positive probability are never independent.

Pairwise is weaker than mutual. Let XX and YY be the results of two independent fair coin tosses, coded 00 and 11, and let Z=X+Y mod 2Z = X + Y \bmod 2. Put A={X=1}A = \{X = 1\}, B={Y=1}B = \{Y=1\}, C={Z=1}C = \{Z = 1\}, each of probability 12\tfrac12. Any two of the three determine the third, so each pairwise intersection has probability 14=12⋅12\tfrac14 = \tfrac12 \cdot \tfrac12 and the three events are pairwise independent. But A∩B∩C=∅A \cap B \cap C = \emptyset, since X=Y=1X = Y = 1 forces Z=0Z = 0, so

P(A∩B∩C)=0≠18=P(A)P(B)P(C),\mathbb{P}(A \cap B \cap C) = 0 \ne \tfrac18 = \mathbb{P}(A)\mathbb{P}(B)\mathbb{P}(C) ,

and the family is not independent. This is why the definition quantifies over every finite subfamily and not merely over pairs; Grimmett and Stirzaker (Grimmett & Stirzaker (2020), Example (1.5.2), p. 14) give a different construction on a nine-point sample space, and Folland (Folland (1999), §10.1, Exercise 1, p. 315) makes the same point.

Conditional independence is a separate condition. It neither implies nor is implied by independence. In the example above, AA and BB are independent but are not conditionally independent given CC: conditionally on CC, knowing AA determines BB.

Method(Conditioning on a partition)Original

Most elementary probability calculations are one of the following two, and the work is in choosing the partition.

  1. Identify the experiment. Write down Ω\Omega explicitly only if it is small; otherwise it is enough to be confident that it could be written down. Fix the events of interest.
  2. Choose a partition {Bi}\{B_i\} that resolves whatever makes the problem hard: the unknown branch taken, the unobserved cause, the value of a hidden parameter, the result of the first step. A good partition is one for which both P(Bi)\mathbb{P}(B_i) and P(A∣Bi)\mathbb{P}(A \mid B_i) are immediate.
  3. Forwards (prediction). Compute P(A)=∑iP(A∣Bi)P(Bi)\mathbb{P}(A) = \sum_i \mathbb{P}(A \mid B_i)\mathbb{P}(B_i). Check the partition by verifying ∑iP(Bi)=1\sum_i \mathbb{P}(B_i) = 1.
  4. Backwards (inference). If instead AA has been observed and the branch is wanted, compute the unnormalised posteriors P(A∣Bi)P(Bi)\mathbb{P}(A \mid B_i)\mathbb{P}(B_i), then divide each by their sum. The sum is P(A)\mathbb{P}(A), so step 3 is contained in step 4 and is a useful arithmetic check.
  5. Check the direction. P(A∣B)\mathbb{P}(A \mid B) and P(B∣A)\mathbb{P}(B \mid A) are equal only when P(A)=P(B)\mathbb{P}(A) = \mathbb{P}(B). Confusing them is the single most common error in applied probability; it has a name, the prosecutor's fallacy.
  6. For a sequence of steps, use the chain rule rather than a partition: multiply the conditional probability of each step given everything before it.
Example(A three-module detector: forwards and backwards)Original

A tracking detector routes each incoming event to exactly one of three reconstruction modules. Module 11 handles a fraction 0.500.50 of the events, module 22 a fraction 0.300.30, and module 33 a fraction 0.200.20. Each module occasionally misreconstructs an event; from calibration runs the misreconstruction probabilities are

P(E∣M1)=0.02,P(E∣M2)=0.05,P(E∣M3)=0.10,\mathbb{P}(E \mid M_1) = 0.02 , \qquad \mathbb{P}(E \mid M_2) = 0.05 , \qquad \mathbb{P}(E \mid M_3) = 0.10 ,

where MiM_i is the event that module ii handled the event and EE is the event that it was misreconstructed. The modules partition the sample space: P(M1)+P(M2)+P(M3)=0.50+0.30+0.20=1\mathbb{P}(M_1) + \mathbb{P}(M_2) + \mathbb{P}(M_3) = 0.50 + 0.30 + 0.20 = 1.

Forwards: the overall error rate. By the partition theorem,

P(E)=(0.02)(0.50)+(0.05)(0.30)+(0.10)(0.20)=0.010+0.015+0.020=0.045.\mathbb{P}(E) = (0.02)(0.50) + (0.05)(0.30) + (0.10)(0.20) = 0.010 + 0.015 + 0.020 = 0.045 .

So 4.5%4.5\% of all events are misreconstructed.

Backwards: which module is to blame? The three unnormalised posteriors are the three products just computed, 0.0100.010, 0.0150.015 and 0.0200.020, and dividing each by their sum 0.0450.045 gives

P(M1∣E)=0.0100.045=29=0.2222…,P(M2∣E)=0.0150.045=13,P(M3∣E)=0.0200.045=49=0.4444…\mathbb{P}(M_1 \mid E) = \frac{0.010}{0.045} = \frac{2}{9} = 0.2222\ldots , \qquad \mathbb{P}(M_2 \mid E) = \frac{0.015}{0.045} = \frac{1}{3} , \qquad \mathbb{P}(M_3 \mid E) = \frac{0.020}{0.045} = \frac{4}{9} = 0.4444\ldots

The three posteriors sum to 2/9+3/9+4/9=12/9 + 3/9 + 4/9 = 1, as they must.

What the numbers say. Module 33 handles only one event in five but is responsible for 4/94/9 of the bad ones, while module 11 handles half the events and causes only 2/92/9 of them. The prior ordering 0.50>0.30>0.200.50 > 0.30 > 0.20 has been reversed by the likelihoods. Note also the gap between the two conditional probabilities that are easy to confuse: P(E∣M3)=0.10\mathbb{P}(E \mid M_3) = 0.10, but P(M3∣E)=0.444\mathbb{P}(M_3 \mid E) = 0.444, larger by a factor of about 4.44.4.

The odds form, as a check. Comparing modules 33 and 11 without computing P(E)\mathbb{P}(E) at all:

P(M3∣E)P(M1∣E)=P(M3)P(M1)⋅P(E∣M3)P(E∣M1)=0.200.50⋅0.100.02=0.4×5=2,\frac{\mathbb{P}(M_3 \mid E)}{\mathbb{P}(M_1 \mid E)} = \frac{\mathbb{P}(M_3)}{\mathbb{P}(M_1)} \cdot \frac{\mathbb{P}(E \mid M_3)}{\mathbb{P}(E \mid M_1)} = \frac{0.20}{0.50}\cdot\frac{0.10}{0.02} = 0.4 \times 5 = 2 ,

and indeed (4/9)/(2/9)=2(4/9)/(2/9) = 2. The prior odds of 0.40.4 against module 33 are overturned by a likelihood ratio of 55 in its favour.

A second question, by the chain rule. Two events arrive and are routed independently. What is the probability that both are handled by module 11 and that neither is misreconstructed? Independence across events, and the chain rule within each event, give

[P(M1) P(Ec∣M1)]2=[(0.50)(0.98)]2=0.492=0.2401.\bigl[ \mathbb{P}(M_1)\,\mathbb{P}(E^{c} \mid M_1) \bigr]^{2} = \bigl[ (0.50)(0.98) \bigr]^{2} = 0.49^{2} = 0.2401 .
Application(Where this machinery is actually used)Original

Inference from data. Bayes' theorem is the engine of Bayesian inference: the partition is over hypotheses or parameter values, the likelihood is supplied by the measurement model, and the posterior is the output. The detector example above is the discrete skeleton of every such calculation, including the medical-screening example that Riley, Hobson and Bence (Riley, Hobson & Bence (2006), §30.2.3, p. 1132) work through, in which a test that is 99.99%99.99\% sensitive still leaves a positive result only one-third likely to be a true positive because the prior prevalence is low. Misreading P(positive∣ill)\mathbb{P}(\text{positive} \mid \text{ill}) as P(ill∣positive)\mathbb{P}(\text{ill} \mid \text{positive}) is the same error that Grimmett and Stirzaker label the prosecutor's fallacy.

Reliability and fault trees. A system is modelled as a network whose components fail independently; the probability that the system works is computed by inclusion-exclusion over the paths, or by conditioning on the state of one critical component. Consequence 4 and the partition theorem are the whole method, and independence of components is the modelling assumption that makes the numbers finite in count.

Statistical mechanics. The microcanonical ensemble is the equally-likely-outcomes measure P(A)=∣A∣/∣Ω∣\mathbb{P}(A) = \lvert A \rvert/\lvert\Omega\rvert on the set of accessible microstates, and the counting of states that makes up much of the subject is exactly the combinatorics of such a space. Conditioning on the total energy of a system plus reservoir, and applying the partition theorem over the energy of the subsystem, is how the canonical distribution is derived.

Sequential experiments and Markov models. The chain rule is the definition of a stochastic process specified step by step: the probability of a whole trajectory is the product of one-step conditional probabilities. When each step depends only on the previous state, the chain rule collapses to the Markov property and one is in the setting of Discrete-time Markov chains. The product-space construction that Grimmett and Stirzaker sketch is what guarantees that a probability space carrying infinitely many independent trials exists at all, which is what Laws of large numbers silently assumes.

Conditional independence as a modelling language. Measurements are usually modelled as independent given the state of the system, not independent outright; the state is the common cause that induces the correlation. This single conditional-independence assumption underlies the likelihood function of Maximum likelihood, the recursion of the Kalman filter, and the graphical models used throughout data assimilation.

Definition

Random variables and distributions

Adapted

Defines a random variable as a measurable function on a probability space and its distribution function as the object that carries all the probabilistic information about it, characterises which functions are distribution functions, separates the discrete and continuous cases, and catalogues the standard distributions with the mechanism each one models.

Prerequisites: Probability spaces

Note(Why a distribution function and not a list of probabilities)Original

A random variable is just a numerical readout of an experiment: the sample space Ω\Omega may be a set of card hands, molecular configurations or detector hit patterns, but what gets recorded is a number. The obvious way to describe the number is to list P(X=x)\mathbb{P}(X = x) for each possible value xx, and for a die or a photon count that is exactly right. For a length, a time or a temperature it is useless, because every single value has probability zero.

The device that covers both cases is the distribution function F(x)=P(X≤x)F(x) = \mathbb{P}(X \le x), an increasing function from 00 to 11. It exists for every random variable, it determines all the probabilities of interest, and it is a function on R\mathbb{R} rather than on Ω\Omega — so once it is written down the original probability space can be forgotten. Two experiments with entirely different sample spaces can share a distribution function, and for most purposes they are then the same experiment.

Definition(Random variable, distribution function, distribution)AdaptedAdapted from Grimmett & Stirzaker (2020), §2.1, Definitions (2.1.3) and (2.1.4) and the discussion preceding them, pp. 29-30; Folland (1999), §10.1, pp. 314-315

Let (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}) be a probability space as in Probability spaces.

A random variable is a function X:Ω→RX : \Omega \to \mathbb{R} such that

{ω∈Ω:X(ω)≤x}∈Ffor every x∈R;\{\omega \in \Omega : X(\omega) \le x\} \in \mathcal{F} \qquad \text{for every } x \in \mathbb{R} ;

such an XX is called F\mathcal{F}-measurable. The condition is exactly what is needed for the probabilities below to be defined; it is automatic when F\mathcal{F} consists of all subsets of Ω\Omega, as it does for a finite or countable sample space.

Following the usual abuse, the event {ω:X(ω)≤x}\{\omega : X(\omega) \le x\} is written {X≤x}\{X \le x\} and its probability P(X≤x)\mathbb{P}(X \le x).

The distribution function of XX is

F:R→[0,1],F(x)=P(X≤x),F : \mathbb{R} \to [0,1] , \qquad F(x) = \mathbb{P}(X \le x) ,

written FXF_X when the variable must be named. Measure-theoretically, XX pushes P\mathbb{P} forward to a Borel probability measure on the line,

PX(B)=P(X−1(B))(B⊆R Borel),\mathbb{P}_X(B) = \mathbb{P}\bigl( X^{-1}(B) \bigr) \qquad (B \subseteq \mathbb{R} \text{ Borel}) ,

called the distribution of XX; and FF determines PX\mathbb{P}_X completely. Two random variables with the same distribution function are identically distributed, whether or not they are defined on the same space, and no purely distributional statement can tell them apart.

The two tails of XX are T1(x)=P(X>x)=1−F(x)T_1(x) = \mathbb{P}(X > x) = 1 - F(x) and T2(x)=P(X≤−x)=F(−x)T_2(x) = \mathbb{P}(X \le -x) = F(-x) for large positive xx; how fast they decay governs which moments exist.

Definition(Discrete and continuous random variables)AdaptedAdapted from Grimmett & Stirzaker (2020), §2.3, Definitions (2.3.1) and (2.3.2) and the surrounding discussion, p. 35, and §4.1, Definition (4.1.2), p. 99; Riley, Hobson & Bence (2006), §30.4.1-§30.4.2, eqs. (30.38)-(30.44), pp. 1139-1142

XX is discrete when its range lies inside a countable subset {x1,x2,… }\{x_1, x_2, \dots\} of the line. Its (probability) mass function is

f:R→[0,1],f(x)=P(X=x),f : \mathbb{R} \to [0,1] , \qquad f(x) = \mathbb{P}(X = x) ,

which vanishes off the countable set and satisfies ∑if(xi)=1\sum_i f(x_i) = 1. Then F(x)=∑xi≤xf(xi)F(x) = \sum_{x_i \le x} f(x_i) is a step function, constant between the xix_i and jumping by f(xi)f(x_i) at xix_i; such a distribution is called atomic, and the points xix_i with f(xi)>0f(x_i) > 0 are its atoms. Riley, Hobson and Bence call ff the probability function and FF the cumulative probability function.

XX is continuous when some integrable f:R→[0,∞)f : \mathbb{R} \to [0,\infty), called a (probability) density function for XX, reproduces FF by integration:

F(x)=∫−∞xf(u) duat every x∈R.F(x) = \int_{-\infty}^{x} f(u)\,du \qquad \text{at every } x \in \mathbb{R} .

Then FF is continuous, P(X=x)=0\mathbb{P}(X = x) = 0 for every xx, and

P(a<X≤b)=∫abf(u) du.\mathbb{P}(a < X \le b) = \int_a^b f(u)\,du .

The density is not unique — changing ff at finitely many points changes no integral — but wherever FF is differentiable one takes f(x)=F′(x)f(x) = F'(x). Physicists usually define the density the other way round, by P(x<X≤x+dx)=f(x) dx\mathbb{P}(x < X \le x + dx) = f(x)\,dx, which is the same statement in infinitesimal form.

Two cautions. First, the word "continuous" describes FF, not the function XX on Ω\Omega. Second, these two classes are not exhaustive: there exist singular distribution functions, continuous but with no density, and there exist mixtures of all three kinds. A convenient device for handling discrete and continuous variables in one formalism, used throughout physics, is to allow densities containing Dirac deltas, writing f(x)=∑ipi δ(x−xi)f(x) = \sum_i p_i\,\delta(x - x_i) for a discrete variable; see The Dirac delta.

Definition(Which functions are distribution functions, and what they tell you)AdaptedAdapted from Grimmett & Stirzaker (2020), §2.1, Lemma (2.1.6) with the remark following it on p. 31, and Lemma (2.1.11), p. 32

Let XX be a random variable with distribution function FF.

  1. FF is non-decreasing: x<yx < y implies F(x)≤F(y)F(x) \le F(y).
  2. F(x)→0F(x) \to 0 as x→−∞x \to -\infty and F(x)→1F(x) \to 1 as x→+∞x \to +\infty.
  3. FF is right-continuous: F(x+h)→F(x)F(x + h) \to F(x) as h↓0h \downarrow 0.

Conversely, any F:R→[0,1]F : \mathbb{R} \to [0,1] having properties 1-3 arises as FYF_Y for some random variable YY on some probability space, constructed in step 5 of the proof. So these three properties characterise distribution functions exactly.

Moreover, writing F(x−)=lim⁡y↑xF(y)F(x-) = \lim_{y \uparrow x} F(y) for the left limit, which exists by monotonicity,

P(X>x)=1−F(x),P(x<X≤y)=F(y)−F(x),P(X=x)=F(x)−F(x−).\mathbb{P}(X > x) = 1 - F(x) , \qquad \mathbb{P}(x < X \le y) = F(y) - F(x) , \qquad \mathbb{P}(X = x) = F(x) - F(x-) .

In particular FF is continuous at xx if and only if P(X=x)=0\mathbb{P}(X = x) = 0, so the atoms of XX are precisely the jumps of FF, and there are at most countably many of them because the jumps at distinct points sum to at most 11.

Idea of the proof(The three properties are the three continuity statements)Original

Each property of FF is the continuity theorem for probability measures applied to a different monotone sequence of events, and the side on which FF is continuous is decided by the choice of ≤\le rather than << in the definition.

Monotonicity needs no limit: {X≤x}\{X \le x\} sits inside {X≤y}\{X \le y\} when x<yx < y, and a probability measure is monotone. The two limits at ±∞\pm\infty come from the sequences {X≤−n}\{X \le -n\}, which decrease to ∅\emptyset, and {X≤n}\{X \le n\}, which increase to Ω\Omega.

Right-continuity is the same argument at a finite point: the events {X≤x+1/n}\{X \le x + 1/n\} decrease, and their intersection is {X≤x}\{X \le x\} — because a real number that is ≤x+1/n\le x + 1/n for every nn is ≤x\le x. Had we defined F(x)=P(X<x)F(x) = \mathbb{P}(X < x), the corresponding intersection would have been {X≤x}\{X \le x\} again and FF would have come out left-continuous instead. The mass at a point is then the gap between the two conventions, P(X=x)=P(X≤x)−P(X<x)=F(x)−F(x−)\mathbb{P}(X = x) = \mathbb{P}(X \le x) - \mathbb{P}(X < x) = F(x) - F(x-).

Proof(Properties of the distribution function)AdaptedAdapted from Grimmett & Stirzaker (2020), §2.1, the proofs of Lemma (2.1.6) and Lemma (2.1.11), pp. 30-32

Write A(x)={X≤x}A(x) = \{X \le x\}, an event by the measurability requirement in the definition.

1. Monotone. If x<yx < y then A(y)=A(x)∪{x<X≤y}A(y) = A(x) \cup \{x < X \le y\}, a disjoint union of events, so by additivity

F(y)=F(x)+P(x<X≤y) ≥ F(x).F(y) = F(x) + \mathbb{P}(x < X \le y) \ \ge \ F(x) .

This also proves the second displayed formula of the statement.

2. Limits at ±∞\pm\infty. The events Bn=A(−n)B_n = A(-n) decrease as nn grows, and ⋂nBn=∅\bigcap_n B_n = \emptyset, since no real number X(ω)X(\omega) satisfies X(ω)≤−nX(\omega) \le -n for every nn. By continuity of P\mathbb{P} along decreasing sequences (Probability spaces, consequence 6), F(−n)=P(Bn)→P(∅)=0F(-n) = \mathbb{P}(B_n) \to \mathbb{P}(\emptyset) = 0. As FF is monotone, convergence along the integers forces F(x)→0F(x) \to 0 as x→−∞x \to -\infty. Symmetrically, A(n)A(n) increases with union Ω\Omega, so F(n)→1F(n) \to 1 and hence F(x)→1F(x) \to 1 as x→+∞x \to +\infty.

3. Right-continuity. The events Cn=A(x+1/n)C_n = A(x + 1/n) decrease, and ⋂nCn=A(x)\bigcap_n C_n = A(x): if X(ω)≤x+1/nX(\omega) \le x + 1/n for all nn then X(ω)≤xX(\omega) \le x, and the reverse inclusion is clear. Continuity along decreasing sequences gives F(x+1/n)→F(x)F(x + 1/n) \to F(x), and monotonicity upgrades this to F(x+h)→F(x)F(x+h) \to F(x) as h↓0h \downarrow 0.

4. Mass at a point. Let Dn={x−1/n<X≤x}D_n = \{x - 1/n < X \le x\}. These decrease with ⋂nDn={X=x}\bigcap_n D_n = \{X = x\}. By part 1, P(Dn)=F(x)−F(x−1/n)\mathbb{P}(D_n) = F(x) - F(x - 1/n), and continuity along decreasing sequences gives

P(X=x)=lim⁡n→∞[F(x)−F(x−1/n)]=F(x)−F(x−).\mathbb{P}(X = x) = \lim_{n \to \infty}\bigl[ F(x) - F(x-1/n) \bigr] = F(x) - F(x-) .

The first displayed formula, P(X>x)=1−F(x)\mathbb{P}(X>x) = 1 - F(x), is the complement rule.

5. The converse. Given FF with properties 1-3, take Ω=(0,1)\Omega = (0,1) with Lebesgue measure and set

X(ω)=inf⁡{x∈R:F(x)≥ω},X(\omega) = \inf\{ x \in \mathbb{R} : F(x) \ge \omega \} ,

the generalised inverse of FF. Right-continuity of FF makes the infimum attained, so F(X(ω))≥ωF(X(\omega)) \ge \omega; and monotonicity makes X(ω)≤xX(\omega) \le x equivalent to ω≤F(x)\omega \le F(x). Hence P(X≤x)=P((0,F(x)])=F(x)\mathbb{P}(X \le x) = \mathbb{P}\bigl( (0, F(x)] \bigr) = F(x), and property 2 guarantees that XX is finite for every ω∈(0,1)\omega \in (0,1). □\square

Remark(Where each hypothesis is used, and what goes wrong without it)AdaptedAdapted from Grimmett & Stirzaker (2020), §2.1, the discussion of measurability on p. 29, §2.3, the remarks on singular and mixed variables and Example (2.3.5), pp. 35-36

Measurability. Nothing above works if {X≤x}\{X \le x\} is not an event: F(x)F(x) is then simply undefined. On a countable sample space with F\mathcal{F} the full power set the condition is vacuous, which is why it can be ignored in elementary work. It becomes real on Ω=R\Omega = \mathbb{R} with the Borel σ\sigma-field, where non-measurable functions exist (see Measurable functions).

Countable additivity. Properties 2 and 3 are the continuity theorem, which as noted in Probability spaces is equivalent to countable rather than finite additivity. A finitely additive set function can produce a monotone "distribution function" that fails to tend to 11, or that jumps without having an atom.

Right- rather than left-continuity is a convention, forced by writing F(x)=P(X≤x)F(x) = \mathbb{P}(X \le x). Some applied texts define F(x)=P(X<x)F(x) = \mathbb{P}(X < x) and obtain a left-continuous function. The two differ exactly at the atoms, and every formula involving FF at a jump has to be read in the right convention; we use ≤\le throughout, as do all four of our sources.

Discrete and continuous do not exhaust the possibilities. The worked example below is a variable that is neither: it has a density on part of the line and an atom at one point. Grimmett and Stirzaker give a similar example in which a coin toss decides between a point mass at −1-1 and a uniform angle. There are also singular distributions, continuous but with F′=0F' = 0 almost everywhere; the standard construction is supported on the Cantor set. When a theorem below is stated for continuous variables, the hypothesis is that FF is an integral of a density, not merely that FF is a continuous function.

Non-uniqueness of the density. Because ff enters only through its integrals, altering ff on a set of Lebesgue measure zero changes nothing. So "the" density is really an equivalence class, and statements such as "ff is largest at the mode" require choosing the continuous representative when one exists.

Note(A catalogue of the standard distributions)AdaptedAdapted from Grimmett & Stirzaker (2020), §3.5, Examples (1)-(6), pp. 64-65, and §4.4, Examples (1)-(8), pp. 106-108

In each row the parameters are as shown and the mass or density function is zero outside the stated range. The mean and variance are included for reference; they are defined, and the method for computing them given, in Expectation, variance and covariance and Generating functions.

Discrete.

Distribution f(k)=P(X=k)f(k) = \mathbb{P}(X=k) Range Mean Variance Mechanism
Bernoulli (p)(p) pk(1−p)1−kp^{k}(1-p)^{1-k} k∈{0,1}k \in \{0,1\} pp p(1−p)p(1-p) one trial; the indicator of an event
Binomial bin(n,p)\mathrm{bin}(n,p) (nk)pk(1−p)n−k\binom{n}{k}p^{k}(1-p)^{n-k} 0≤k≤n0 \le k \le n npnp np(1−p)np(1-p) successes in nn independent trials
Poisson (λ)(\lambda) e−λλk/k!e^{-\lambda}\lambda^{k}/k! k≥0k \ge 0 λ\lambda λ\lambda rare events: n→∞n \to \infty, p→0p \to 0, np→λnp \to \lambda
Geometric (p)(p) p(1−p)k−1p(1-p)^{k-1} k≥1k \ge 1 1/p1/p (1−p)/p2(1-p)/p^{2} trial number of the first success
Negative binomial (r,p)(r,p) (k−1r−1)pr(1−p)k−r\binom{k-1}{r-1}p^{r}(1-p)^{k-r} k≥rk \ge r r/pr/p r(1−p)/p2r(1-p)/p^{2} trial number of the rrth success

Continuous.

Distribution f(x)f(x) Range Mean Variance Mechanism
Uniform [a,b][a,b] 1/(b−a)1/(b-a) a<x<ba < x < b (a+b)/2(a+b)/2 (b−a)2/12(b-a)^{2}/12 no preference within an interval
Exponential (λ)(\lambda) λe−λx\lambda e^{-\lambda x} x≥0x \ge 0 1/λ1/\lambda 1/λ21/\lambda^{2} waiting time with no memory
Normal N(μ,σ2)N(\mu, \sigma^{2}) 12πσ2exp⁡ ⁣[−(x−μ)22σ2]\dfrac{1}{\sqrt{2\pi\sigma^{2}}}\exp\!\left[-\dfrac{(x-\mu)^{2}}{2\sigma^{2}}\right] x∈Rx \in \mathbb{R} μ\mu σ2\sigma^{2} sums of many small independent effects
Gamma Γ(λ,t)\Gamma(\lambda, t) λtxt−1e−λx/Γ(t)\lambda^{t}x^{t-1}e^{-\lambda x}/\Gamma(t) x≥0x \ge 0 t/λt/\lambda t/λ2t/\lambda^{2} waiting time for the ttth event
Chi-squared χ2(d)\chi^{2}(d) Γ(12,d2)\Gamma(\tfrac12, \tfrac{d}{2}) density x≥0x \ge 0 dd 2d2d sum of dd squared standard normals
Cauchy 1/[π(1+x2)]1/[\pi(1+x^{2})] x∈Rx \in \mathbb{R} none none ratio of two independent normals
Beta (a,b)(a,b) xa−1(1−x)b−1Γ(a+b)/[Γ(a)Γ(b)]x^{a-1}(1-x)^{b-1}\Gamma(a+b)/[\Gamma(a)\Gamma(b)] 0<x<10 < x < 1 a/(a+b)a/(a+b) ab(a+b)2(a+b+1)\dfrac{ab}{(a+b)^{2}(a+b+1)} a random proportion

Three conventions to watch. The geometric distribution is here the number of trials up to and including the first success, so it starts at k=1k=1 and has mean 1/p1/p; many texts instead count the failures before the first success, shifting everything by one and giving mean (1−p)/p(1-p)/p. Grimmett and Stirzaker parametrise the gamma distribution as Γ(λ,t)\Gamma(\lambda, t) with λ\lambda a rate, so that Γ(λ,1)\Gamma(\lambda,1) is the exponential and χ2(d)=Γ(12,d2)\chi^{2}(d) = \Gamma(\tfrac12, \tfrac{d}{2}); writers who use a scale parameter θ=1/λ\theta = 1/\lambda invert it. The Cauchy distribution has no mean, not a mean of zero: the defining integral is not absolutely convergent.

For the standard normal the density and distribution function have their own symbols,

ϕ(x)=12πe−x2/2,Φ(y)=∫−∞yϕ(v) dv,\phi(x) = \frac{1}{\sqrt{2\pi}}e^{-x^{2}/2} , \qquad \Phi(y) = \int_{-\infty}^{y}\phi(v)\,dv ,

and if XX is N(μ,σ2)N(\mu,\sigma^{2}) then (X−μ)/σ(X - \mu)/\sigma is N(0,1)N(0,1), so that FX(x)=Φ((x−μ)/σ)F_X(x) = \Phi\bigl((x-\mu)/\sigma\bigr). This standardisation is why one table of Φ\Phi serves for all normal distributions.

Example(A clipped decay time: a variable that is neither discrete nor continuous)Original

A counter records the time TT at which an unstable state decays, but the acquisition window closes after c=3c = 3 hours; if no decay has occurred by then the counter writes down 33 and stops. Model the true decay time as exponential with rate λ=12\lambda = \tfrac12 per hour, and let X=min⁡(T,3)X = \min(T, 3) be the recorded value.

The distribution function. For x<0x < 0, F(x)=0F(x) = 0. For 0≤x<30 \le x < 3 the recorded value is at most xx exactly when the true decay time is, so

F(x)=P(T≤x)=1−e−x/2.F(x) = \mathbb{P}(T \le x) = 1 - e^{-x/2} .

For x≥3x \ge 3, F(x)=1F(x) = 1, because XX never exceeds 33. The function is non-decreasing, tends to 00 and 11 at the ends, and is right-continuous — at x=3x = 3 it jumps up to the value 11 and stays there, which is continuity from the right, not from the left.

The atom. By the formula P(X=x)=F(x)−F(x−)\mathbb{P}(X = x) = F(x) - F(x-),

P(X=3)=1−(1−e−3/2)=e−3/2=0.2231301…,\mathbb{P}(X = 3) = 1 - \bigl( 1 - e^{-3/2} \bigr) = e^{-3/2} = 0.2231301\ldots ,

which is just the probability that the state survives the whole window. At every other point FF is continuous, so XX has exactly one atom and XX is not continuous. Nor is it discrete, since the set of values it takes, (0,3](0,3], is uncountable and FF is not a step function. It is a mixture: a density f(x)=12e−x/2f(x) = \tfrac12 e^{-x/2} on (0,3)(0,3), of total mass 1−e−3/2=0.7768698…1 - e^{-3/2} = 0.7768698\ldots, together with a point mass of 0.2231301…0.2231301\ldots at 33. The two add to 11, as they must.

Interval probabilities. Between one and two hours,

P(1<X≤2)=F(2)−F(1)=e−1/2−e−1=0.6065307−0.3678794=0.2386512.\mathbb{P}(1 < X \le 2) = F(2) - F(1) = e^{-1/2} - e^{-1} = 0.6065307 - 0.3678794 = 0.2386512 .

Quantiles, and why the generalised inverse is needed. The median solves F(m)=12F(m) = \tfrac12, that is e−m/2=12e^{-m/2} = \tfrac12, giving

m=2ln⁡2=1.3862944 hours,m = 2\ln 2 = 1.3862944 \text{ hours} ,

comfortably inside the window; the upper quartile solves e−q/2=14e^{-q/2} = \tfrac14, giving q=4ln⁡2=2.7725887q = 4\ln 2 = 2.7725887, still inside. But the 9090th percentile would need e−x/2=0.1e^{-x/2} = 0.1, that is x=2ln⁡10=4.6051702x = 2\ln 10 = 4.6051702, which lies beyond the window. There is no xx with F(x)=0.9F(x) = 0.9: the function leaps from 0.77686980.7768698 to 11 at x=3x = 3. The generalised inverse inf⁡{x:F(x)≥0.9}\inf\{x : F(x) \ge 0.9\} used in step 5 of the proof returns 33, which is the right answer — nine runs in ten do finish by the time the counter stops, because in fact more than nine in ten do.

What the clipping costs. The recorded distribution agrees with the true one below 33 hours and lumps everything above into a single spike. Any analysis that treats XX as exponential will therefore underestimate the mean lifetime; the correct treatment keeps the atom, and this is the elementary case of what survival analysis calls right-censoring.

Application(Distributions as models)Original

Counting. Radioactive decays in a fixed interval, photons on a pixel, cosmic rays through a detector and raindrops in a gauge are all modelled as Poisson, for the reason in the catalogue: a very large number of potential contributors each with a very small probability. The quality of the model is a statement about independence, not about the counts, and when the contributors cluster the data are overdispersed relative to Poisson, which is itself a diagnostic.

Waiting and lifetimes. The exponential distribution is the unique continuous distribution with no memory, and is therefore the universal model for the time to the next event of a process with a constant hazard rate: spontaneous emission, nuclear decay, the time between arrivals in a queue. The gamma distribution is the waiting time for the ttth such event, which is why it describes the total dead time of a counter that must record several hits.

Measurement error. Gaussian errors are assumed throughout experimental science, on the strength of The central limit theorem: an error that is the accumulation of many small independent contributions is approximately normal regardless of their individual laws. The assumption fails when one contribution dominates, or when the tails matter, and the Cauchy distribution — the ratio of two normals, with no mean at all — is the standard warning of how badly it can fail. The Lorentzian line shape of a resonance is the same function.

Quantum mechanics. A wavefunction is a probability density in exactly the sense of this unit: Arfken, Weber and Harris (Arfken, Weber & Harris (2013), Example 23.2.2, p. 1135) treat the radial position of the hydrogen 1s1s electron as a continuous random variable with density 4r2a−3e−2r/a4r^{2}a^{-3}e^{-2r/a}, obtained from ∣ψ∣2\lvert\psi\rvert^{2} by integrating over angles. Normalisation of the wavefunction is the condition ∫f=1\int f = 1, and the Born rule is the assertion that ∣ψ∣2\lvert\psi\rvert^{2} is a density and not merely a weight.

Simulation. The generalised inverse constructed in step 5 of the proof is the inverse-transform sampling method: feed a uniform random number on (0,1)(0,1) into F−1F^{-1} and out comes a sample from FF. It works for any distribution function, mixed ones included, and it is how the clipped variable of the worked example would be simulated. More efficient alternatives for specific distributions are in Joint distributions and transformations.

Statistics. The chi-squared, Student and FF distributions that appear in Sampling distributions are all built from normal variables by the transformations of Joint distributions and transformations, and the beta distribution is the standard prior for an unknown proportion in Bayesian inference.

Definition

Expectation, variance and covariance

Adapted

Defines the expectation of a random variable and the three derived numbers that summarise a distribution and the link between two of them, proves the rules that make expectation linear and variance quadratic, and establishes the Cauchy-Schwarz bound that confines the correlation coefficient to the interval from minus one to one.

Prerequisites: Random variables and distributions

Note(Four numbers)Original

A distribution function contains everything, and is therefore hard to compare, hard to communicate and hard to estimate from data. In practice a distribution is summarised by a few numbers: where it sits, how wide it is, and — for two variables at once — how much one moves with the other.

The first is the expectation, the centre of mass of the distribution. The second is the variance, its moment of inertia about that centre. The third, covariance, is the mixed second moment of a pair, and the fourth, correlation, is the covariance rescaled so that it lies in [−1,1][-1,1] and can be quoted without units. The rescaling is not cosmetic: a covariance of 10−610^{-6} may mean total dependence or none at all, depending on the units of the two variables, and a correlation of −0.9-0.9 means the same thing whatever they are measured in.

Everything in this unit follows from two facts: expectation is linear, and E(Z2)≥0\mathbb{E}(Z^2) \ge 0.

Definition(Expectation)AdaptedAdapted from Grimmett & Stirzaker (2020), Definition (3.3.1), p. 53, Definition (4.3.1) and the unifying notation on p. 103; Riley, Hobson & Bence (2006), eqs. (30.45)-(30.46), p. 1143; Folland (1999), §10.1, pp. 314-315

Let XX be a random variable on (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}), in the sense of Random variables and distributions.

If XX is discrete with mass function ff, its expectation (mean, expected value) is

E(X)  =  ∑xx f(x),\mathbb{E}(X) \; = \; \sum_{x} x\,f(x) ,

the sum running over the countably many xx with f(x)>0f(x) > 0, provided the sum converges absolutely. If XX is continuous with density ff,

E(X)  =  ∫−∞∞x f(x) dx,\mathbb{E}(X) \; = \; \int_{-\infty}^{\infty} x\,f(x)\,dx ,

provided ∫∣x∣f(x) dx<∞\int \lvert x \rvert f(x)\,dx < \infty. When the stated condition fails, XX has no mean.

Both are instances of one definition. The distribution PX\mathbb{P}_X of XX is a measure on R\mathbb{R}, and

E(X)  =  ∫Rt  dPX(t)  =  ∫ΩX dP,\mathbb{E}(X) \; = \; \int_{\mathbb{R}} t \; d\mathbb{P}_X(t) \; = \; \int_{\Omega} X \, d\mathbb{P} ,

a Lebesgue integral (The Lebesgue integral); expectation is integration, and in Folland's dictionary the two words name the same operation. Grimmett and Stirzaker write this uniformly as E(X)=∫x dFX(x)\mathbb{E}(X) = \int x \, dF_X(x), which also covers variables that are neither discrete nor continuous. We write μ\mu or μX\mu_X for E(X)\mathbb{E}(X) where it is convenient, and omit the parentheses as EX\mathbb{E}X.

Moments. For a positive integer kk, the kkth moment of XX is mk=E(Xk)m_k = \mathbb{E}(X^{k}) and the kkth central moment is σk=E((X−m1)k)\sigma_k = \mathbb{E}\bigl( (X - m_1)^{k} \bigr), each defined when the corresponding expectation exists.

Definition(Variance, covariance, correlation)AdaptedAdapted from Grimmett & Stirzaker (2020), Definition (3.3.5) and the computation of $\\sigma_2$, p. 54, Definition (3.3.10), p. 56, and Definition (3.6.7), p. 68; Riley, Hobson & Bence (2006), eq. (30.48) and §30.5.3, p. 1146, and eqs. (30.133)-(30.134), p. 1200; Arfken, Weber & Harris (2013), eqs. (23.26)-(23.27) and (23.36), pp. 1139, 1142; Folland (1999), §10.1, p. 314

Let XX and YY be random variables with finite second moments, that is E(X2)<∞\mathbb{E}(X^{2}) < \infty and E(Y2)<∞\mathbb{E}(Y^{2}) < \infty; equivalently X,Y∈L2X, Y \in L^{2}, in the language of LpL^p spaces. Write μX=EX\mu_X = \mathbb{E}X and μY=EY\mu_Y = \mathbb{E}Y.

The variance of XX is its second central moment,

var⁡(X)  =  E((X−μX)2)  ≥  0,\operatorname{var}(X) \; = \; \mathbb{E}\bigl( (X - \mu_X)^{2} \bigr) \; \ge \; 0 ,

and the standard deviation is σX=var⁡(X)\sigma_X = \sqrt{\operatorname{var}(X)}, which carries the same units as XX. A variance is never negative.

The covariance of XX and YY is their mixed central second moment,

cov⁡(X,Y)  =  E((X−μX)(Y−μY)),\operatorname{cov}(X,Y) \; = \; \mathbb{E}\bigl( (X - \mu_X)(Y - \mu_Y) \bigr) ,

so that cov⁡(X,X)=var⁡(X)\operatorname{cov}(X,X) = \operatorname{var}(X): covariance generalises variance. XX and YY are uncorrelated when cov⁡(X,Y)=0\operatorname{cov}(X,Y) = 0, equivalently when E(XY)=E(X)E(Y)\mathbb{E}(XY) = \mathbb{E}(X)\mathbb{E}(Y).

When σX\sigma_X and σY\sigma_Y are both non-zero, the correlation coefficient is

ρ(X,Y)  =  cov⁡(X,Y)σX σY,\rho(X,Y) \; = \; \frac{\operatorname{cov}(X,Y)}{\sigma_X \, \sigma_Y} ,

a dimensionless number. If ρ>0\rho > 0 the variables are positively correlated, if ρ<0\rho < 0 negatively correlated, and if ρ=0\rho = 0 uncorrelated.

Definition(The rules)AdaptedAdapted from Grimmett & Stirzaker (2020), Lemma (3.3.3), p. 54, Theorems (3.3.8) and (3.3.11) and Lemma (3.3.9), pp. 55-56, Lemma (3.6.6), p. 68, Lemma (3.6.8) and Theorem (3.6.9), p. 69, Theorem (4.3.3) and Lemma (4.3.4), pp. 103-104; Riley, Hobson & Bence (2006), the properties (i)-(iii) on p. 1144, eq. (30.51), p. 1147, and eq. (30.135), p. 1201; Arfken, Weber & Harris (2013), property 2 on p. 1139 and the theorem on p. 1143

Let XX and YY be random variables and a,b,c∈Ra, b, c \in \mathbb{R}; each statement is asserted whenever the expectations it names exist.

  1. Law of the unconscious statistician. For g:R→Rg : \mathbb{R} \to \mathbb{R}, E(g(X))=∑xg(x)f(x)(discrete),E(g(X))=∫−∞∞g(x)f(x) dx(continuous),\mathbb{E}\bigl( g(X) \bigr) = \sum_{x} g(x) f(x) \quad \text{(discrete)} , \qquad \mathbb{E}\bigl( g(X) \bigr) = \int_{-\infty}^{\infty} g(x) f(x)\,dx \quad \text{(continuous)} , provided the sum converges absolutely or the integral exists. The density of g(X)g(X) is never needed. For two variables with joint mass function or density fX,Yf_{X,Y} and g:R2→Rg:\mathbb{R}^{2}\to\mathbb{R}, the same formula holds with fX,Yf_{X,Y} in place of ff and a double sum or integral. Grimmett and Stirzaker call this the change of variable formula and record that it is also known by the longer name used here.
  2. Positive linear operator. E(1)=1\mathbb{E}(1) = 1; if X≥0X \ge 0 then E(X)≥0\mathbb{E}(X) \ge 0; and E(aX+bY)=a E(X)+b E(Y).\mathbb{E}(aX + bY) = a\,\mathbb{E}(X) + b\,\mathbb{E}(Y) . No independence is required. In particular E(a)=a\mathbb{E}(a) = a for a constant aa.
  3. Products under independence. If XX and YY are independent then E(XY)=E(X)E(Y)\mathbb{E}(XY) = \mathbb{E}(X)\mathbb{E}(Y), so independent variables are uncorrelated. The converse is false; see the remark.
  4. Computing formulas. var⁡(X)=E(X2)−(EX)2,cov⁡(X,Y)=E(XY)−E(X)E(Y).\operatorname{var}(X) = \mathbb{E}(X^{2}) - \bigl( \mathbb{E}X \bigr)^{2} , \qquad \operatorname{cov}(X,Y) = \mathbb{E}(XY) - \mathbb{E}(X)\mathbb{E}(Y) .
  5. Behaviour under a linear change. var⁡(a)=0\operatorname{var}(a) = 0 for a constant, and var⁡(aX+b)=a2var⁡(X),cov⁡(aX+b,cY+d)=accov⁡(X,Y),ρ(aX+b,cY+d)=sgn⁡(ac) ρ(X,Y)\operatorname{var}(aX + b) = a^{2}\operatorname{var}(X) , \qquad \operatorname{cov}(aX + b, cY + d) = ac \operatorname{cov}(X,Y) , \qquad \rho(aX+b, cY+d) = \operatorname{sgn}(ac)\,\rho(X,Y) for a,c≠0a, c \neq 0. Variance is quadratic and blind to shifts; correlation is invariant up to the sign of the scalings.
  6. Variance of a sum. var⁡(X+Y)=var⁡(X)+var⁡(Y)+2cov⁡(X,Y)\operatorname{var}(X + Y) = \operatorname{var}(X) + \operatorname{var}(Y) + 2\operatorname{cov}(X,Y), which reduces to var⁡(X)+var⁡(Y)\operatorname{var}(X) + \operatorname{var}(Y) when XX and YY are uncorrelated — in particular when they are independent.
  7. Cauchy-Schwarz, and the range of ρ\rho. (E(XY))2≤E(X2) E(Y2)\bigl( \mathbb{E}(XY) \bigr)^{2} \le \mathbb{E}(X^{2})\,\mathbb{E}(Y^{2}), with equality if and only if P(aX=bY)=1\mathbb{P}(aX = bY) = 1 for some real a,ba, b not both zero. Consequently ∣cov⁡(X,Y)∣≤σXσY,so−1≤ρ(X,Y)≤1,\lvert \operatorname{cov}(X,Y) \rvert \le \sigma_X \sigma_Y , \qquad \text{so} \qquad -1 \le \rho(X,Y) \le 1 , and ∣ρ(X,Y)∣=1\lvert \rho(X,Y) \rvert = 1 holds exactly when P(aX+bY=c)=1\mathbb{P}(aX + bY = c) = 1 for some a,b,ca,b,c with a,ba, b not both zero: that is, exactly when YY is almost surely an affine function of XX. The sign of ρ\rho is then the sign of the slope.
  8. The mean minimises mean squared error. a↦E((X−a)2)a \mapsto \mathbb{E}\bigl( (X-a)^{2} \bigr) is a quadratic in aa with its minimum at a=E(X)a = \mathbb{E}(X), and the minimum value is var⁡(X)\operatorname{var}(X).
  9. Tail formula. If X≥0X \ge 0 with distribution function FF, then E(X)=∫0∞[1−F(x)] dx\mathbb{E}(X) = \int_{0}^{\infty} \bigl[ 1 - F(x) \bigr]\,dx.
Idea of the proof(Linearity, then one square)Original

Only two mechanisms are at work.

Linearity comes from the fact that a sum is integrated term by term; in the discrete case one writes both variables as combinations of indicators of the joint events {X=x}∩{Y=y}\{X = x\} \cap \{Y = y\} and reorganises a double sum. Everything about means follows, and so does the computing formula for the variance: expand (X−μ)2(X - \mu)^{2} and apply linearity to the three terms, two of which collapse because E(X)=μ\mathbb{E}(X) = \mu is a constant. Rules 4, 5, 6 and 8 are this expansion carried out in slightly different arrangements.

Positivity of a square does the rest. The quantity E((aU+cV)2)\mathbb{E}\bigl( (aU + cV)^{2} \bigr) is non-negative for every pair of real coefficients, and expanding it gives a quadratic form in (a,c)(a,c) whose coefficients are E(U2)\mathbb{E}(U^{2}), E(UV)\mathbb{E}(UV) and E(V2)\mathbb{E}(V^{2}). A quadratic that never goes negative has non-positive discriminant, and that inequality is Cauchy-Schwarz. Applying it to the centred variables U=X−μXU = X - \mu_X, V=Y−μYV = Y - \mu_Y bounds the covariance by the product of the standard deviations, which is what confines ρ\rho to [−1,1][-1,1]. Equality forces the quadratic to have a real root, that is, to vanish for some (a,c)≠(0,0)(a,c) \neq (0,0); and a non-negative random variable with zero mean is zero almost surely, so aU+cV=0aU + cV = 0 with probability one. That is the linear relation in the equality case.

Independence enters only in rule 3, and only through the factorisation of the joint mass function or density, which turns a double sum into a product of single sums.

Proof(The rules)AdaptedAdapted from Grimmett & Stirzaker (2020), the proofs of Theorems (3.3.8) and (3.3.11), Lemma (3.3.9), pp. 55-56, Theorem (3.6.9), p. 69, and Lemma (4.3.4), p. 104; Arfken, Weber & Harris (2013), the quadratic-form argument on p. 1143; Riley, Hobson & Bence (2006), the expansion (30.135), p. 1201, and the proof that independence gives $E[XY]=E[X]E[Y]$, p. 1200

We give the discrete case where the two cases differ only by replacing sums with integrals.

Rule 1 (law of the unconscious statistician). Let Y=g(X)Y = g(X) and let yy run over the values of YY. Grouping the values of XX by the value they are sent to,

E(Y)=∑yy P(Y=y)=∑yy∑x : g(x)=yf(x)=∑y  ∑x : g(x)=yg(x)f(x)=∑xg(x)f(x),\mathbb{E}(Y) = \sum_{y} y \, \mathbb{P}(Y = y) = \sum_{y} y \sum_{x \,:\, g(x) = y} f(x) = \sum_{y} \; \sum_{x \,:\, g(x)=y} g(x) f(x) = \sum_{x} g(x) f(x) ,

the regrouping being legitimate because the double sum converges absolutely. In the continuous case the corresponding statement for g≥0g \ge 0 follows from rule 9 applied to g(X)g(X) together with an exchange of the order of integration, and the general case follows by splitting g=g+−g−g = g^{+} - g^{-} into positive and negative parts.

Rule 2 (linearity). Put Ax={X=x}A_x = \{X = x\} and By={Y=y}B_y = \{Y = y\}. The events Ax∩ByA_x \cap B_y are disjoint and exhaust Ω\Omega, and on Ax∩ByA_x \cap B_y the variable aX+bYaX + bY takes the value ax+byax + by. Hence by rule 1 applied to the pair,

E(aX+bY)=∑x,y(ax+by) P(Ax∩By)=a∑xx∑yP(Ax∩By)+b∑yy∑xP(Ax∩By).\mathbb{E}(aX + bY) = \sum_{x,y} (ax + by)\,\mathbb{P}(A_x \cap B_y) = a \sum_{x} x \sum_{y} \mathbb{P}(A_x \cap B_y) + b \sum_{y} y \sum_{x} \mathbb{P}(A_x \cap B_y) .

The inner sums are the marginals: ∑yP(Ax∩By)=P(Ax)\sum_y \mathbb{P}(A_x \cap B_y) = \mathbb{P}(A_x), since the ByB_y partition Ω\Omega, and similarly in the other order. This is aE(X)+bE(Y)a\mathbb{E}(X) + b\mathbb{E}(Y). Positivity and E(1)=1\mathbb{E}(1)=1 are immediate from the definition.

Rule 3 (products). Independence of XX and YY means P(Ax∩By)=P(Ax)P(By)\mathbb{P}(A_x \cap B_y) = \mathbb{P}(A_x)\mathbb{P}(B_y) for all x,yx,y, so the double sum factorises:

E(XY)=∑x,yxy P(Ax)P(By)=(∑xx P(Ax))(∑yy P(By))=E(X)E(Y).\mathbb{E}(XY) = \sum_{x,y} x y \,\mathbb{P}(A_x)\mathbb{P}(B_y) = \Bigl( \sum_x x\,\mathbb{P}(A_x) \Bigr) \Bigl( \sum_y y\,\mathbb{P}(B_y) \Bigr) = \mathbb{E}(X)\mathbb{E}(Y) .

This is the only step in the whole unit that uses independence.

Rule 4 (computing formulas). By linearity, with μ=EX\mu = \mathbb{E}X a constant,

E((X−μ)2)=E(X2)−2μ E(X)+μ2=E(X2)−μ2.\mathbb{E}\bigl( (X-\mu)^{2} \bigr) = \mathbb{E}(X^{2}) - 2\mu\,\mathbb{E}(X) + \mu^{2} = \mathbb{E}(X^{2}) - \mu^{2} .

The same expansion on (X−μX)(Y−μY)(X - \mu_X)(Y - \mu_Y) gives E(XY)−μXE(Y)−μYE(X)+μXμY=E(XY)−μXμY\mathbb{E}(XY) - \mu_X \mathbb{E}(Y) - \mu_Y \mathbb{E}(X) + \mu_X\mu_Y = \mathbb{E}(XY) - \mu_X\mu_Y.

Rule 5 (linear change). E(aX+b)=aμX+b\mathbb{E}(aX+b) = a\mu_X + b by linearity, so (aX+b)−E(aX+b)=a(X−μX)(aX+b) - \mathbb{E}(aX+b) = a(X - \mu_X): the shift cancels. Squaring and taking expectations gives var⁡(aX+b)=a2var⁡(X)\operatorname{var}(aX+b) = a^{2}\operatorname{var}(X), and multiplying the two centred variables gives the covariance rule. Since σaX+b=∣a∣σX\sigma_{aX+b} = \lvert a \rvert \sigma_X, dividing yields ρ(aX+b,cY+d)=ac ρ(X,Y)/(∣a∣∣c∣)=sgn⁡(ac)ρ(X,Y)\rho(aX+b, cY+d) = ac\,\rho(X,Y)/(\lvert a\rvert \lvert c\rvert) = \operatorname{sgn}(ac)\rho(X,Y).

Rule 6 (variance of a sum). Centre both variables and expand the square:

var⁡(X+Y)=E([(X−μX)+(Y−μY)]2)=var⁡(X)+2cov⁡(X,Y)+var⁡(Y),\operatorname{var}(X+Y) = \mathbb{E}\bigl( [(X-\mu_X) + (Y-\mu_Y)]^{2} \bigr) = \operatorname{var}(X) + 2\operatorname{cov}(X,Y) + \operatorname{var}(Y) ,

by linearity applied to the three terms.

Rule 7 (Cauchy-Schwarz). Take any U,VU, V in L2L^{2} and any real coefficients a,ca, c. Since (aU+cV)2≥0(aU + cV)^{2} \ge 0 pointwise, positivity and linearity of E\mathbb{E} give

Q(a,c)  =  a2 E(U2)+2ac E(UV)+c2 E(V2)  ≥  0for all a,c.Q(a,c) \; = \; a^{2}\,\mathbb{E}(U^{2}) + 2ac\,\mathbb{E}(UV) + c^{2}\,\mathbb{E}(V^{2}) \; \ge \; 0 \qquad \text{for all } a, c .

Suppose first E(U2)>0\mathbb{E}(U^{2}) > 0. Fixing c=1c = 1 makes QQ a quadratic in aa with positive leading coefficient that is never negative, so its discriminant is non-positive:

4(E(UV))2−4 E(U2)E(V2)≤0,4\bigl( \mathbb{E}(UV) \bigr)^{2} - 4\,\mathbb{E}(U^{2})\mathbb{E}(V^{2}) \le 0 ,

which is the inequality. If instead E(U2)=0\mathbb{E}(U^{2}) = 0 then U=0U = 0 almost surely, both sides vanish, and the equality case holds with (a,c)=(1,0)(a,c) = (1,0).

For the equality case, suppose E(U2)>0\mathbb{E}(U^2)>0 and the discriminant is zero. Then the quadratic has a real root a0a_0, so E((a0U+V)2)=0\mathbb{E}\bigl( (a_0 U + V)^{2} \bigr) = 0. A non-negative random variable with zero expectation is zero almost surely, so P(a0U+V=0)=1\mathbb{P}(a_0 U + V = 0) = 1. Conversely a linear relation makes QQ vanish at that point, forcing the discriminant to zero.

The bound on ρ\rho. Apply the inequality to the centred variables U=X−μXU = X - \mu_X and V=Y−μYV = Y - \mu_Y: then E(UV)=cov⁡(X,Y)\mathbb{E}(UV) = \operatorname{cov}(X,Y), E(U2)=var⁡(X)\mathbb{E}(U^{2}) = \operatorname{var}(X) and E(V2)=var⁡(Y)\mathbb{E}(V^{2}) = \operatorname{var}(Y), so cov⁡(X,Y)2≤var⁡(X)var⁡(Y)\operatorname{cov}(X,Y)^{2} \le \operatorname{var}(X)\operatorname{var}(Y) and dividing by σX2σY2>0\sigma_X^{2}\sigma_Y^{2} > 0 gives ρ2≤1\rho^{2} \le 1. Equality holds exactly when a0(X−μX)+(Y−μY)=0a_0(X - \mu_X) + (Y - \mu_Y) = 0 almost surely, that is when P(aX+bY=c)=1\mathbb{P}(aX + bY = c) = 1 for suitable constants; solving for YY shows Y=−a0X+(μY+a0μX)Y = -a_0 X + (\mu_Y + a_0\mu_X) almost surely, an affine function of XX with slope −a0-a_0, and rule 5 gives ρ=sgn⁡(−a0)\rho = \operatorname{sgn}(-a_0).

Rule 8 (the mean minimises). By rule 4 applied to X−aX - a,

E((X−a)2)=var⁡(X−a)+(E(X−a))2=var⁡(X)+(μX−a)2,\mathbb{E}\bigl( (X-a)^{2} \bigr) = \operatorname{var}(X - a) + \bigl( \mathbb{E}(X-a) \bigr)^{2} = \operatorname{var}(X) + (\mu_X - a)^{2} ,

a quadratic in aa minimised at a=μXa = \mu_X with value var⁡(X)\operatorname{var}(X).

Rule 9 (tail formula). For X≥0X \ge 0 with density ff,

∫0∞[1−F(x)]dx=∫0∞P(X>x) dx=∫x=0∞∫y=x∞f(y) dy dx=∫y=0∞∫x=0ydx f(y) dy=∫0∞yf(y) dy=E(X),\int_{0}^{\infty}\bigl[ 1 - F(x) \bigr] dx = \int_{0}^{\infty} \mathbb{P}(X > x)\,dx = \int_{x=0}^{\infty} \int_{y=x}^{\infty} f(y)\,dy\,dx = \int_{y=0}^{\infty} \int_{x=0}^{y} dx \, f(y)\,dy = \int_{0}^{\infty} y f(y)\,dy = \mathbb{E}(X) ,

the exchange of the order of integration being legitimate by Tonelli's theorem (Fubini and Tonelli) because the integrand is non-negative. □\square

Remark(Where the hypotheses are used)AdaptedAdapted from Grimmett & Stirzaker (2020), the absolute-convergence proviso in Definition (3.3.1) and Example (3.3.12), pp. 53, 57, the remark after Theorem (3.3.8), p. 56, and the Cauchy density, p. 108; Riley, Hobson & Bence (2006), the statement that uncorrelated does not imply independent and the symmetry criterion, p. 1201; Folland (1999), §10.1, p. 314

Absolute convergence, not convergence. The mean of a discrete variable is a sum over an unordered set, so it must not depend on the order of summation; this is why absolute convergence is demanded rather than convergence. Grimmett and Stirzaker's example f(k)=Ak−2f(k) = Ak^{-2} for k=±1,±2,…k = \pm1, \pm2, \dots has ∑k∣k∣f(k)=A∑k≠0∣k∣−1=∞\sum_k \lvert k \rvert f(k) = A\sum_{k \ne 0}\lvert k\rvert^{-1} = \infty, so no mean exists even though the distribution is symmetric and one is tempted to call its mean zero. The Cauchy density 1/[π(1+x2)]1/[\pi(1+x^{2})] is the continuous counterpart: symmetric, and with no mean at all.

Finite second moment, for everything after the definition of the mean. Variance, covariance, correlation and the Cauchy-Schwarz inequality all need X,Y∈L2X, Y \in L^{2}. Folland states the convention that σ2(X)=∞\sigma^{2}(X) = \infty when X∉L2X \notin L^{2}. If var⁡(X)=∞\operatorname{var}(X) = \infty then rule 6 is vacuous and ρ\rho is undefined; the first place this bites is the central limit theorem, whose finite-variance hypothesis cannot be dropped.

Non-degeneracy, for the correlation coefficient. ρ\rho requires σX,σY>0\sigma_X, \sigma_Y > 0. A constant random variable is uncorrelated with everything and has no correlation coefficient with anything.

Independence is used only in rule 3, and only in one direction. Uncorrelated does not imply independent. Let XX be uniform on {−1,0,1}\{-1, 0, 1\} and set Y=X2Y = X^{2}. Then EX=0\mathbb{E}X = 0 and E(XY)=E(X3)=13(−1+0+1)=0\mathbb{E}(XY) = \mathbb{E}(X^{3}) = \tfrac13(-1 + 0 + 1) = 0, so cov⁡(X,Y)=0−0⋅EY=0\operatorname{cov}(X,Y) = 0 - 0 \cdot \mathbb{E}Y = 0 and the two are uncorrelated. They are as dependent as they could be — YY is a function of XX — and indeed

P(X=0, Y=1)=0≠13⋅23=P(X=0) P(Y=1).\mathbb{P}(X = 0,\, Y = 1) = 0 \neq \tfrac13 \cdot \tfrac23 = \mathbb{P}(X=0)\,\mathbb{P}(Y=1) .

What has happened is that correlation measures only the linear part of a dependence, and the dependence here is purely quadratic. Riley, Hobson and Bence give the general reason: any joint distribution symmetric in xx about μX\mu_X has zero correlation, whatever else it does. The one important case in which uncorrelated does imply independent is the joint normal, treated in The multivariate normal distribution.

Rule 6 needs only uncorrelatedness, not independence, which is why variances of sums are so widely usable: pairwise uncorrelated errors suffice, and nothing about higher-order dependence matters.

The exchange of integrals in rule 9 needs the integrand to be non-negative, which is why that rule is stated for X≥0X \ge 0. For a general XX the correct version splits into positive and negative parts and both must converge.

Method(Computing a variance or covariance without losing it to rounding)Original
  1. Centre first if you can. Work with U=X−mU = X - m for any convenient constant mm near the mean; by rule 5, var⁡(X)=var⁡(U)\operatorname{var}(X) = \operatorname{var}(U) and cov⁡(X,Y)=cov⁡(U,Y−m′)\operatorname{cov}(X,Y) = \operatorname{cov}(U, Y - m'), so shifting is free and costs no accuracy.
  2. Then use whichever of the two formulas is cheaper. E(U2)−(EU)2\mathbb{E}(U^{2}) - (\mathbb{E}U)^{2} needs one pass over the distribution; E((U−μU)2)\mathbb{E}((U - \mu_U)^{2}) needs the mean first, hence two. With exact arithmetic they agree.
  3. Beware the difference of two large numbers. When σX≪∣μX∣\sigma_X \ll \lvert \mu_X \rvert the formula E(X2)−(EX)2\mathbb{E}(X^{2}) - (\mathbb{E}X)^{2} subtracts two nearly equal quantities and loses most of its significant digits; this is precisely what step 1 prevents, and it is the reason numerical libraries subtract a provisional mean before accumulating squares.
  4. For a function of XX, do not find its distribution. Apply rule 1 directly: E(g(X))=∑xg(x)f(x)\mathbb{E}(g(X)) = \sum_x g(x)f(x) or ∫g(x)f(x) dx\int g(x)f(x)\,dx. Deriving the density of g(X)g(X) first, by the methods of Joint distributions and transformations, is extra work and extra opportunity for error.
  5. For a linear combination, use rules 2, 5 and 6 rather than constructing the distribution of the combination: var⁡(∑iaiXi)=∑iai2var⁡(Xi)+2∑i<jaiajcov⁡(Xi,Xj)\operatorname{var}(\sum_i a_i X_i) = \sum_i a_i^{2}\operatorname{var}(X_i) + 2\sum_{i<j}a_i a_j \operatorname{cov}(X_i, X_j).
  6. Check the answer. A variance must be non-negative; a correlation must lie in [−1,1][-1,1]; and var⁡(X+Y)\operatorname{var}(X+Y) computed from rule 6 must agree with a direct computation from the distribution of X+YX+Y. Each of these catches a different arithmetic slip.
Example(Two detector channels: a complete calculation)Original

Two photon-counting channels AA and BB view the same weak source through a beam splitter. In a fixed 1 ms1\,\mathrm{ms} gate, let XX be the number of counts in channel AA, taking values 0,1,20, 1, 2, and YY the number in channel BB, taking values 0,10, 1. Calibration gives the joint mass function (all entries in twentieths):

20 f(x,y)20\,f(x,y) y=0y=0 y=1y=1 20 fX(x)20\,f_X(x)
x=0x=0 44 11 55
x=1x=1 33 55 88
x=2x=2 22 55 77
20 fY(y)20\,f_Y(y) 99 1111 2020

The six entries sum to 2020, so ff is a mass function; the margins are the row and column sums.

Means. By the definition applied to the marginals,

E(X)=0⋅5+1⋅8+2⋅720=2220=1.1,E(Y)=0⋅9+1⋅1120=1120=0.55.\mathbb{E}(X) = \frac{0 \cdot 5 + 1 \cdot 8 + 2 \cdot 7}{20} = \frac{22}{20} = 1.1 , \qquad \mathbb{E}(Y) = \frac{0 \cdot 9 + 1 \cdot 11}{20} = \frac{11}{20} = 0.55 .

Second moments and variances. E(X2)=(0+1⋅8+4⋅7)/20=36/20=1.8\mathbb{E}(X^{2}) = (0 + 1\cdot 8 + 4 \cdot 7)/20 = 36/20 = 1.8, and since YY takes only the values 00 and 11, E(Y2)=E(Y)=0.55\mathbb{E}(Y^{2}) = \mathbb{E}(Y) = 0.55. Rule 4 gives

var⁡(X)=1.8−1.12=1.8−1.21=0.59,var⁡(Y)=0.55−0.552=0.2475,\operatorname{var}(X) = 1.8 - 1.1^{2} = 1.8 - 1.21 = 0.59 , \qquad \operatorname{var}(Y) = 0.55 - 0.55^{2} = 0.2475 ,

so σX=0.59=0.768115\sigma_X = \sqrt{0.59} = 0.768115 and σY=0.2475=0.497494\sigma_Y = \sqrt{0.2475} = 0.497494.

Covariance. Only the cells with x≥1x \ge 1 and y=1y = 1 contribute to E(XY)\mathbb{E}(XY):

E(XY)=1⋅1⋅5+2⋅1⋅520=1520=0.75,\mathbb{E}(XY) = \frac{1 \cdot 1 \cdot 5 + 2 \cdot 1 \cdot 5}{20} = \frac{15}{20} = 0.75 ,

and therefore

cov⁡(X,Y)=0.75−(1.1)(0.55)=0.75−0.605=0.145=29200.\operatorname{cov}(X,Y) = 0.75 - (1.1)(0.55) = 0.75 - 0.605 = 0.145 = \tfrac{29}{200} .

It is positive, as it should be for two channels fed by the same source.

Correlation.

ρ(X,Y)=0.145(0.768115)(0.497494)=0.1450.382132=0.379450,\rho(X,Y) = \frac{0.145}{(0.768115)(0.497494)} = \frac{0.145}{0.382132} = 0.379450 ,

comfortably inside [−1,1][-1,1], as rule 7 demands. The two channels are moderately, not strongly, coupled: a little over a third of the way to a deterministic linear relation.

Check by rule 6. The predicted variance of the total count S=X+YS = X + Y is

var⁡(S)=0.59+0.2475+2(0.145)=1.1275.\operatorname{var}(S) = 0.59 + 0.2475 + 2(0.145) = 1.1275 .

Computing it directly, SS takes the values 0,1,2,30,1,2,3 with probabilities 4/204/20, 4/204/20, 7/207/20, 5/205/20, so E(S)=(0+4+14+15)/20=33/20=1.65\mathbb{E}(S) = (0 + 4 + 14 + 15)/20 = 33/20 = 1.65 — which equals 1.1+0.551.1 + 0.55, as linearity requires — and E(S2)=(0+4+28+45)/20=77/20=3.85\mathbb{E}(S^{2}) = (0 + 4 + 28 + 45)/20 = 77/20 = 3.85, giving var⁡(S)=3.85−1.652=3.85−2.7225=1.1275\operatorname{var}(S) = 3.85 - 1.65^{2} = 3.85 - 2.7225 = 1.1275. The two agree exactly.

What would independence have given? Under independence the covariance would vanish, so var⁡(S)\operatorname{var}(S) would be 0.83750.8375 rather than 1.12751.1275: the positive coupling inflates the variance of the total by 35%35\%. Treating correlated channels as independent is the standard way to underestimate an error bar.

The best linear predictor. The slope of the least-squares line predicting YY from XX is cov⁡(X,Y)/var⁡(X)=0.145/0.59=29/118=0.245763\operatorname{cov}(X,Y)/\operatorname{var}(X) = 0.145/0.59 = 29/118 = 0.245763, and the residual variance is var⁡(Y)(1−ρ2)=0.2475 (1−0.143982)=0.211864\operatorname{var}(Y)(1 - \rho^{2}) = 0.2475\,(1 - 0.143982) = 0.211864. Knowing XX removes about 14.4%14.4\% of the variance of YY; the exact conditional prediction, which does better, is the subject of Conditional expectation.

Application(Where the second moment is the answer)Original

Error bars and propagation. The standard deviation of an estimate is its error bar, and rules 5 and 6 are the whole of linear error propagation: for Z=∑iaiXiZ = \sum_i a_i X_i,

σZ2=∑iai2σi2+2∑i<jaiajcov⁡(Xi,Xj).\sigma_Z^{2} = \sum_i a_i^{2}\sigma_i^{2} + 2\sum_{i<j}a_i a_j \operatorname{cov}(X_i, X_j) .

The cross terms are the part routinely and wrongly dropped; see Error propagation. For a non-linear Z=g(X1,…,Xn)Z = g(X_1,\dots,X_n) the same formula is applied to the first-order Taylor expansion, with ai=∂g/∂xia_i = \partial g/\partial x_i evaluated at the means.

Why averaging helps, and exactly how much. If X1,…,XnX_1, \dots, X_n are uncorrelated with common variance σ2\sigma^{2}, rules 5 and 6 give var⁡(Xˉ)=σ2/n\operatorname{var}(\bar X) = \sigma^{2}/n, so the standard error falls like n−1/2n^{-1/2}. This single calculation is the quantitative content of Laws of large numbers at finite nn, the basis of the n−1/2n^{-1/2} convergence rate of Monte Carlo integration, and the reason correlated samples — from a Markov chain, say — buy less than their number suggests: the cross terms in rule 6 do not vanish, and the effective sample size is smaller.

Fluctuations in statistical mechanics. In the canonical ensemble the energy EE is a random variable with E(E)=−∂ln⁡Z/∂β\mathbb{E}(E) = -\partial \ln Z/\partial\beta and var⁡(E)=∂2ln⁡Z/∂β2\operatorname{var}(E) = \partial^{2}\ln Z/\partial\beta^{2}, where β=1/kBT\beta = 1/k_{B}T. Differentiating the mean with respect to temperature gives

CV=∂E(E)∂T=var⁡(E)kBT2,C_V = \frac{\partial \mathbb{E}(E)}{\partial T} = \frac{\operatorname{var}(E)}{k_{B}T^{2}} ,

so a heat capacity is literally a variance. The same identity in other variables relates the isothermal compressibility to particle-number fluctuations and the magnetic susceptibility to magnetisation fluctuations; it is the elementary form of the fluctuation-dissipation theorem, and it is why a response function diverges at a critical point, where fluctuations do.

Regression and least squares. The slope of the best linear predictor of YY from XX is cov⁡(X,Y)/var⁡(X)\operatorname{cov}(X,Y)/\operatorname{var}(X) and the fraction of variance it explains is ρ2\rho^{2}; see Least-squares regression. Arfken's observation that the mean is the minimiser of the sum of squared deviations, which is rule 8, is the one-parameter case of the same principle.

Covariance matrices. For a vector of variables the covariances form a symmetric positive semi-definite matrix, and the Cauchy-Schwarz inequality of rule 7 is exactly the statement that its 2×22 \times 2 minors are non-negative. Diagonalising it is principal component analysis (EOF and principal component analysis); propagating it through a linear dynamical model is the Kalman filter; and its role as the parameter of a Gaussian is the subject of The multivariate normal distribution.

Tail bounds. The variance is what converts into a probability statement through Chebyshev's inequality, P(∣X−μ∣≥kσ)≤k−2\mathbb{P}(\lvert X - \mu\rvert \ge k\sigma) \le k^{-2}; see Markov, Chebyshev, Jensen and Chernoff inequalities. That one line is why a standard deviation is a useful summary and not merely a conventional one.

Method

Joint distributions and transformations

Adapted

Gives the working recipe for turning the joint density of several random variables into the density of functions of them — invert the map, multiply by the modulus of the Jacobian, integrate out what is not wanted — and derives from it the convolution formula for the density of a sum of independent variables.

Prerequisites: Expectation, variance and covariance, Multiple integrals and change of variables

Note(One question, one recipe)Original

Almost every calculation in applied probability has the shape: I know the distribution of the inputs; what is the distribution of the output? The inputs are random variables X1,…,XnX_1, \dots, X_n with a known joint density, the output is Y=g(X1,…,Xn)Y = g(X_1, \dots, X_n), and what is wanted is the density of YY.

There is one recipe. Complete gg to an invertible map of Rn\mathbb{R}^{n} to itself by adjoining whatever extra coordinates are convenient; transform the density by the rule for changing variables inside a multiple integral, which contributes the modulus of a Jacobian determinant; then integrate out the coordinates that were only there to make the map invertible. Everything else in this unit — the formula for a monotone function of one variable, the convolution formula for a sum, the chi-squared density, the Box-Muller sampler — is this recipe with a particular choice of the extra coordinates.

The Jacobian is not a technicality. A density is a probability per unit volume, so when a map stretches volume the density must shrink in compensation; the Jacobian is exactly the local volume factor.

Definition(Joint distributions, marginals, independence)AdaptedAdapted from Grimmett & Stirzaker (2020), Definition (3.6.2) and the marginals on p. 67, and §4.5, Definitions (4.5.1)-(4.5.2) with items (3)-(7), pp. 110-112; Riley, Hobson & Bence (2006), §30.4.3 p. 1143 and eq. (30.130), p. 1199; Folland (1999), §10.1, pp. 315-316

Let XX and YY be random variables on one probability space. Their joint distribution function is

F(x,y)=P(X≤x, Y≤y),(x,y)∈R2.F(x,y) = \mathbb{P}(X \le x,\, Y \le y) , \qquad (x,y) \in \mathbb{R}^{2} .

If XX and YY are both discrete, their joint mass function is f(x,y)=P(X=x, Y=y)f(x,y) = \mathbb{P}(X = x,\, Y = y), and the marginal mass functions are recovered by summing out the other variable,

fX(x)=∑yf(x,y),fY(y)=∑xf(x,y),f_X(x) = \sum_{y} f(x,y) , \qquad f_Y(y) = \sum_{x} f(x,y) ,

because the events {Y=y}\{Y = y\} partition the sample space.

The pair is jointly continuous with joint density f:R2→[0,∞)f : \mathbb{R}^{2} \to [0,\infty) if

F(x,y)=∫−∞y ⁣ ⁣∫−∞xf(u,v) du dvfor all x,y,F(x,y) = \int_{-\infty}^{y}\!\!\int_{-\infty}^{x} f(u,v)\,du\,dv \qquad \text{for all } x, y ,

in which case f=∂2F/∂x ∂yf = \partial^{2}F/\partial x\,\partial y wherever FF is twice differentiable, and for reasonable B⊆R2B \subseteq \mathbb{R}^{2},

P((X,Y)∈B)=∬Bf(x,y) dx dy.\mathbb{P}\bigl( (X,Y) \in B \bigr) = \iint_{B} f(x,y)\,dx\,dy .

Physicists read f(x,y) dx dyf(x,y)\,dx\,dy directly as the probability that (X,Y)(X,Y) lies in the rectangle of sides dx,dydx, dy at (x,y)(x,y). The marginal densities are

fX(x)=∫−∞∞f(x,y) dy,fY(y)=∫−∞∞f(x,y) dx.f_X(x) = \int_{-\infty}^{\infty} f(x,y)\,dy , \qquad f_Y(y) = \int_{-\infty}^{\infty} f(x,y)\,dx .

Expectations are computed without any further construction: E(g(X,Y))=∬g(x,y)f(x,y) dx dy\mathbb{E}\bigl( g(X,Y) \bigr) = \iint g(x,y) f(x,y)\,dx\,dy, the two-variable law of the unconscious statistician of Expectation, variance and covariance.

Call XX and YY independent when, for every choice of Borel sets B1B_1 and B2B_2, the two events {X∈B1}\{X \in B_1\} and {Y∈B2}\{Y \in B_2\} are independent in the sense of Probability spaces. Folland states this equivalently: the joint distribution on R2\mathbb{R}^{2} is the product of the two individual distributions. All of this extends verbatim to nn variables, with F(x1,…,xn)F(x_1,\dots,x_n), an nn-fold integral, and n−1n-1 integrations to obtain one marginal.

Method(Criteria for independence)AdaptedAdapted from Grimmett & Stirzaker (2020), Lemma (3.6.3) and the following remark, pp. 67-68, and §4.5 item (7), p. 112; Folland (1999), §10.1, pp. 315-316, including Proposition 10.2; Arfken, Weber & Harris (2013), §23.2, p. 1142
  1. Discrete. Independence of XX and YY is equivalent to the identity f(x,y)=fX(x)fY(y)f(x,y) = f_X(x) f_Y(y) holding at every point (x,y)(x,y), and also to the weaker-looking requirement that f(x,y)=g(x)h(y)f(x,y) = g(x)h(y) at every point, for some pair of one-variable functions g,hg, h.
  2. Jointly continuous. Independence of XX and YY is equivalent to F(x,y)=FX(x)FY(y)F(x,y) = F_X(x)F_Y(y) at every point, and this in turn to the possibility of choosing the joint density to be fX(x)fY(y)f_X(x)f_Y(y).
  3. Factorisation suffices. If a joint density factorises as f(x,y)=g(x)h(y)f(x,y) = g(x)h(y) on the whole plane, then XX and YY are independent and fX,fYf_X, f_Y are g,hg, h normalised. The qualifier on the whole plane is essential: a density supported on a region that is not a product of intervals does not factorise even if its formula appears to.
  4. Functions preserve independence. If X1,…,XnX_1, \dots, X_n are independent and the index set is split into disjoint blocks, then Borel functions of separate blocks are independent. In particular, if XX and YY are independent, so are u(X)u(X) and v(Y)v(Y) for any Borel u,vu, v.
  5. Independent variables are uncorrelated, and the converse fails; see Expectation, variance and covariance.
Method(The transformation and convolution formulas)AdaptedAdapted from Grimmett & Stirzaker (2020), §4.7, Theorem (4.7.3), Corollary (4.7.4), p. 122, and eq. (4.7.16), p. 126; Grimmett & Stirzaker (2020), §4.8, Theorem (4.8.1) and the following specialisation, p. 129; Riley, Hobson & Bence (2006), §30.14, pp. 1206-1207, and eq. (30.79), p. 1160

1. Change of variables in nn dimensions. Let X=(X1,…,Xn)X = (X_1, \dots, X_n) have joint density ff, and let

T:D→R,y=T(x)T : D \to R , \qquad y = T(x)

be a one-to-one map of an open set D⊆RnD \subseteq \mathbb{R}^{n} containing the support of ff onto R⊆RnR \subseteq \mathbb{R}^{n}, with inverse x=T−1(y)x = T^{-1}(y) whose partial derivatives ∂xi/∂yj\partial x_i/\partial y_j are continuous. Let

J(y)=det⁡(∂xi∂yj)i,j=1nJ(y) = \det\left( \frac{\partial x_i}{\partial y_j} \right)_{i,j=1}^{n}

be the Jacobian determinant of the inverse map. Then Y=T(X)Y = T(X) has joint density

fY(y)  =  {f(T−1(y)) ∣J(y)∣,y∈R,0,otherwise.f_Y(y) \; = \; \begin{cases} f\bigl( T^{-1}(y) \bigr)\,\bigl\lvert J(y) \bigr\rvert , & y \in R , \\[2pt] 0, & \text{otherwise.}\end{cases}

2. One variable, piecewise monotone. Let XX have density fXf_X and let I1,…,ImI_1, \dots, I_m be intervals partitioning R\mathbb{R} on each of which gg is strictly monotone and continuously differentiable, with inverse hih_i defined on g(Ii)g(I_i). Then Y=g(X)Y = g(X) has density

fY(y)  =  ∑i=1mfX(hi(y)) ∣hi′(y)∣,f_Y(y) \; = \; \sum_{i=1}^{m} f_X\bigl( h_i(y) \bigr)\,\bigl\lvert h_i'(y) \bigr\rvert ,

a term being omitted wherever its hih_i is undefined. For a single increasing or decreasing branch this is the n=1n=1 case of part 1; for the affine map g(x)=ax+bg(x) = ax+b with a≠0a \neq 0 it reads fY(y)=∣a∣−1fX((y−b)/a)f_Y(y) = \lvert a \rvert^{-1} f_X\bigl((y-b)/a\bigr).

3. Sums. If XX and YY have joint density ff, then X+YX + Y has density

fX+Y(z)=∫−∞∞f(x, z−x) dx.f_{X+Y}(z) = \int_{-\infty}^{\infty} f(x,\, z-x)\,dx .

If moreover XX and YY are independent, this is the convolution of the two marginal densities,

fX+Y(z)=(fX∗fY)(z)=∫−∞∞fX(x) fY(z−x) dx=∫−∞∞fX(z−y) fY(y) dy.f_{X+Y}(z) = \bigl( f_X * f_Y \bigr)(z) = \int_{-\infty}^{\infty} f_X(x)\,f_Y(z-x)\,dx = \int_{-\infty}^{\infty} f_X(z-y)\,f_Y(y)\,dy .

For independent integer-valued XX and YY the same statement reads P(X+Y=n)=∑rP(X=r) P(Y=n−r)\mathbb{P}(X+Y = n) = \sum_{r} \mathbb{P}(X = r)\,\mathbb{P}(Y = n-r).

Idea of the proof(Why a Jacobian, and why a sum convolves)Original

A joint density is a probability per unit area. If a map TT carries a small region AA near xx onto a small region T(A)T(A) near y=T(x)y = T(x), then (X,Y)∈A(X,Y) \in A exactly when the transformed pair lies in T(A)T(A), so the two regions carry the same probability. Probability equals density times area, and the areas differ by the local stretching factor of TT — which is ∣det⁡DT∣\lvert \det DT \rvert going forwards, hence ∣J∣=∣det⁡DT−1∣\lvert J \rvert = \lvert \det DT^{-1}\rvert going backwards. So the new density is the old one evaluated at the preimage, divided by the forward stretch, which is the same as multiplied by ∣J∣\lvert J \rvert. Nothing probabilistic has happened: this is Multiple integrals and change of variables, applied to the integral that defines a probability.

The sum formula is this with a deliberately wasteful choice of map. To find the law of Z=X+YZ = X + Y one needs an invertible map, so adjoin a second coordinate that will be discarded: take (x,y)↦(z,w)=(x+y,x)(x,y) \mapsto (z,w) = (x+y, x). This is a shear; it preserves area, so ∣J∣=1\lvert J \rvert = 1, and the joint density of (Z,W)(Z,W) is f(w,z−w)f(w, z-w). Integrating out the unwanted ww gives the marginal density of ZZ, which is the stated formula. Independence then factorises the integrand, and the integral of a product of two shifted functions is by definition a convolution.

That the density of a sum of independent variables is a convolution is the reason transforms dominate the subject: a convolution becomes a product under the Fourier or Laplace transform, so the sum of independent variables becomes multiplication of characteristic functions. The piecewise formula of part 2 is the only genuine addition to the picture, and it says that when a map folds the line, each sheet of the fold contributes its own term.

Proof(The three formulas)AdaptedAdapted from Grimmett & Stirzaker (2020), the proof of Corollary (4.7.4), pp. 122-123, and of Theorem (4.8.1), p. 129; Riley, Hobson & Bence (2006), the probability-element derivation in §30.14, p. 1206

Part 1. Let B⊆RB \subseteq R be a region and A=T−1(B)⊆DA = T^{-1}(B) \subseteq D its preimage, so that Y∈BY \in B holds exactly when X∈AX \in A. Then

P(Y∈B)=P(X∈A)=∫Af(x) dx.\mathbb{P}(Y \in B) = \mathbb{P}(X \in A) = \int_{A} f(x)\,dx .

By the change-of-variables theorem for multiple integrals, applied to the one-to-one continuously differentiable map T−1:B→AT^{-1} : B \to A,

∫Af(x) dx=∫Bf(T−1(y)) ∣J(y)∣ dy.\int_{A} f(x)\,dx = \int_{B} f\bigl( T^{-1}(y) \bigr)\,\lvert J(y) \rvert \, dy .

Thus P(Y∈B)=∫Bf(T−1(y))∣J(y)∣ dy\mathbb{P}(Y \in B) = \int_{B} f(T^{-1}(y))\lvert J(y)\rvert\,dy for every such BB. Comparing with the definition of a joint density for YY — namely that P(Y∈B)=∫BfY\mathbb{P}(Y \in B) = \int_B f_Y for all BB — identifies the integrand, and outside RR the probability is zero so the density may be taken to be zero. Riley, Hobson and Bence obtain the same formula in one line by equating the probability elements ∣f dx1⋯dxn∣\lvert f\,dx_1\cdots dx_n\rvert and ∣g dy1⋯dyn∣\lvert g\,dy_1\cdots dy_n \rvert; that is the infinitesimal version of this argument.

Part 2. Fix ii and suppose first that gg is increasing on IiI_i. For y∈g(Ii)y \in g(I_i),

P(g(X)≤y,  X∈Ii)=P(X≤hi(y),  X∈Ii),\mathbb{P}\bigl( g(X) \le y,\; X \in I_i \bigr) = \mathbb{P}\bigl( X \le h_i(y),\; X \in I_i \bigr) ,

because gg increasing makes g(x)≤yg(x) \le y equivalent to x≤hi(y)x \le h_i(y) within IiI_i. Differentiating in yy and using the chain rule gives the contribution fX(hi(y)) hi′(y)f_X(h_i(y))\,h_i'(y), and hi′>0h_i' > 0 here so this is fX(hi(y))∣hi′(y)∣f_X(h_i(y))\lvert h_i'(y)\rvert. If gg is decreasing on IiI_i the inequality reverses, the contribution is −fX(hi(y))hi′(y)-f_X(h_i(y))h_i'(y), and hi′<0h_i' < 0, so again the contribution is fX(hi(y))∣hi′(y)∣f_X(h_i(y))\lvert h_i'(y)\rvert. The events {X∈Ii}\{X \in I_i\} are disjoint with union of full probability, since the IiI_i partition R\mathbb{R}, so

P(g(X)≤y)=∑iP(g(X)≤y,  X∈Ii),\mathbb{P}\bigl( g(X) \le y \bigr) = \sum_i \mathbb{P}\bigl( g(X) \le y,\; X \in I_i \bigr) ,

and differentiating term by term gives the stated sum.

Part 3. Apply part 1 to the map T(x,y)=(x+y, x)=(z,w)T(x,y) = (x+y,\, x) = (z,w) of R2\mathbb{R}^{2} onto itself. Its inverse is x=wx = w, y=z−wy = z - w, with

J(z,w)=det⁡(∂x/∂z∂y/∂z∂x/∂w∂y/∂w)=det⁡(011−1)=−1,J(z,w) = \det\begin{pmatrix} \partial x/\partial z & \partial y/\partial z \\ \partial x/\partial w & \partial y/\partial w \end{pmatrix} = \det\begin{pmatrix} 0 & 1 \\ 1 & -1 \end{pmatrix} = -1 ,

so ∣J∣=1\lvert J \rvert = 1 and the joint density of (Z,W)(Z, W) is fZ,W(z,w)=f(w, z−w)f_{Z,W}(z,w) = f(w,\, z-w). Integrating out ww gives the marginal density of Z=X+YZ = X+Y:

fX+Y(z)=∫−∞∞f(w, z−w) dw,f_{X+Y}(z) = \int_{-\infty}^{\infty} f(w,\, z-w)\,dw ,

which is the stated formula after renaming ww as xx. If XX and YY are independent then f(x,y)=fX(x)fY(y)f(x,y) = f_X(x)f_Y(y) by criterion 2, and the integrand becomes fX(x)fY(z−x)f_X(x)f_Y(z-x); substituting y=z−xy = z - x exchanges the two roles and gives the second form. The exchange of the order of integration implicit in computing a marginal is justified by Tonelli's theorem (Fubini and Tonelli), the integrand being non-negative.

In the discrete case the same argument needs no Jacobian: the events {X=r, Y=n−r}\{X = r,\, Y = n-r\}, as rr ranges over the integers, are disjoint with union {X+Y=n}\{X + Y = n\}, so their probabilities add. □\square

Remark(Where each hypothesis is used)AdaptedAdapted from Grimmett & Stirzaker (2020), the hypotheses of Theorem (4.7.3) and Corollary (4.7.4), p. 122, the discussion of many-one maps preceding eq. (4.7.16), p. 126, Example (4.7.9), p. 125, and the footnote and Exercise (4.5.1) on marginals, p. 111

One-to-one, on the support only. The transformation rule needs TT to be injective where the density lives; what it does elsewhere is irrelevant, and a failure of injectivity on a set of Lebesgue measure zero is harmless because such a set carries no probability. The polar map of the first example below is not injective at the origin, and that costs nothing. When injectivity genuinely fails on a set of positive measure, the map folds, and part 2 — or its nn-dimensional analogue, a sum over the sheets — is required. Using part 1 on a folding map loses the contributions of all but one sheet; applying it to Y=X2Y = X^{2} gives half the right answer.

A non-vanishing Jacobian, and continuous partial derivatives. These are the hypotheses of the change-of-variables theorem for multiple integrals, and they are used in exactly one place, the second display of the proof of part 1. Where J=0J = 0 the map collapses volume and the formula would assign density zero to a point that may carry probability; such points must be excluded, and again a measure-zero set of them is harmless.

Getting the range right is half the work. The formula is fY(y)=f(T−1(y))∣J(y)∣f_Y(y) = f(T^{-1}(y))\lvert J(y)\rvert on R=T(D)R = T(D) and zero elsewhere, and the commonest error in practice is to write the formula down correctly and then integrate it over the wrong region. Grimmett and Stirzaker's Example (4.7.8) is the standard trap: for independent exponentials, the pair X=X1X = X_1, S=X1+X2S = X_1 + X_2 has joint density λ2e−λs\lambda^{2}e^{-\lambda s}, which looks like a product of a function of xx with a function of ss — but only on the region 0≤x≤s0 \le x \le s, which is not a rectangle, so XX and SS are not independent. This is why criterion 3 above insists that the factorisation hold on the whole plane.

Independence, used only in the last step of part 3. The formula fX+Y(z)=∫f(x,z−x) dxf_{X+Y}(z) = \int f(x, z-x)\,dx holds for any jointly continuous pair, dependent or not; it is only the collapse to a convolution of marginals that needs f=fXfYf = f_Xf_Y. Applying the convolution formula to dependent variables is a genuine error, not a conservative approximation: it can give a density with the wrong variance in either direction, since var⁡(X+Y)\operatorname{var}(X+Y) differs from var⁡X+var⁡Y\operatorname{var} X + \operatorname{var} Y by 2cov⁡(X,Y)2\operatorname{cov}(X,Y).

This machinery does not condition on null events. It computes the law of a transformed variable, not the law of one variable given that another takes an exact value. Grimmett and Stirzaker's Example (4.7.9) shows what goes wrong if the two are confused: for independent exponentials X1,X2X_1, X_2, "the conditional density of X1+X2X_1+X_2 given X1=X2X_1 = X_2" comes out as λ2ye−λy\lambda^{2}y e^{-\lambda y} if the condition is approached through the ratio X1/X2→1X_1/X_2 \to 1 and as λe−λy\lambda e^{-\lambda y} if it is approached through the difference X1−X2→0X_1 - X_2 \to 0. The event has probability zero and the answer depends on the approach. Conditioning of this kind belongs to Conditional expectation.

Joint continuity is stronger than continuity of each variable. A jointly continuous pair has continuous marginals in the sense of having densities, but those densities need not be continuous functions; Grimmett and Stirzaker record a density, due to Clarke, whose first marginal is discontinuous. Conversely, two variables each with a density need not be jointly continuous at all: if Y=XY = X then the pair is supported on a line, which has zero area, and no joint density exists.

Method(Finding the density of a function of random variables)Original

Given the joint density ff of X=(X1,…,Xn)X = (X_1,\dots,X_n) and a function Y1=g(X)Y_1 = g(X) whose density is wanted:

  1. Complete the map. Choose n−1n-1 further functions Y2,…,YnY_2, \dots, Y_n of XX so that T=(g,Y2,…,Yn)T = (g, Y_2, \dots, Y_n) is one-to-one on the support of ff. Choose them for algebraic convenience: a coordinate of XX itself is usually the easiest, and that choice turns step 5 into an integral you can do.
  2. Invert. Solve y=T(x)y = T(x) for x=T−1(y)x = T^{-1}(y) explicitly. If the solution is multi-valued, the map folds: split the support into pieces on which it is one-to-one, carry steps 2-4 out on each, and add the results.
  3. Jacobian. Form the matrix of partial derivatives ∂xi/∂yj\partial x_i/\partial y_j of the inverse map and take the modulus of its determinant, ∣J(y)∣\lvert J(y)\rvert. (Differentiating the forward map instead and taking the reciprocal of the modulus of its determinant gives the same number, and is often less work.)
  4. Substitute. Write fY(y)=f(T−1(y))∣J(y)∣f_Y(y) = f\bigl(T^{-1}(y)\bigr)\lvert J(y)\rvert.
  5. Determine the range and integrate out. Express the image R=T(D)R = T(D) as explicit inequalities on yy — this is the step that is easy to get wrong — and then integrate fYf_Y over y2,…,yny_2, \dots, y_n within that range to obtain the marginal density of Y1Y_1.
  6. Shortcuts worth knowing.
    • For Y=g(X)Y = g(X) with a single variable and a monotone or piecewise monotone gg, use the formula of part 2 directly.
    • For a sum of independent variables, use the convolution formula rather than re-deriving it; for a sum of many, use characteristic functions instead, since convolution is associative but tedious.
    • If the problem has a symmetry, exploit it: for a function of ∑iXi2\sum_i X_i^{2} with a spherically symmetric joint density, integrating over a shell of radius rr and thickness drdr replaces the whole construction, as Riley, Hobson and Bence do in deriving the chi-squared density.
    • When only the distribution function of YY is wanted, computing P(g(X)≤y)\mathbb{P}(g(X) \le y) as an integral of ff over the region {g≤y}\{g \le y\} is often quicker than finding the density.
  7. Check. Verify that fY≥0f_Y \ge 0, that ∫fY=1\int f_Y = 1, and that the mean and variance agree with what linearity and rule 6 of Expectation, variance and covariance predict. These three checks between them catch a missing Jacobian, a wrong range and an algebraic slip.
Example(Two velocity components to a speed: the two-dimensional Maxwell distribution)Original

A gas is confined to a thin film so that its molecules move in a plane. The two velocity components VxV_x and VyV_y of a molecule are independent and each N(0,σ2)N(0, \sigma^{2}), where σ2=kBT/m\sigma^{2} = k_{B}T/m. What is the distribution of the speed S=Vx2+Vy2S = \sqrt{V_x^{2} + V_y^{2}}?

Step 1: the joint density and the completed map. By independence,

f(vx,vy)=12πσ2e−vx2/2σ2⋅12πσ2e−vy2/2σ2=12πσ2 exp⁡ ⁣(−vx2+vy22σ2).f(v_x, v_y) = \frac{1}{\sqrt{2\pi\sigma^{2}}}e^{-v_x^{2}/2\sigma^{2}} \cdot \frac{1}{\sqrt{2\pi\sigma^{2}}}e^{-v_y^{2}/2\sigma^{2}} = \frac{1}{2\pi\sigma^{2}}\,\exp\!\left( -\frac{v_x^{2}+v_y^{2}}{2\sigma^{2}} \right) .

The speed alone is not invertible, so adjoin the direction: let S=Vx2+Vy2S = \sqrt{V_x^{2}+V_y^{2}} and Θ∈[0,2π)\Theta \in [0, 2\pi) be the polar angle.

Steps 2 and 3: inverse and Jacobian. The inverse map is vx=scos⁡θv_x = s\cos\theta, vy=ssin⁡θv_y = s\sin\theta, and

J(s,θ)=det⁡(cos⁡θsin⁡θ−ssin⁡θscos⁡θ)=scos⁡2θ+ssin⁡2θ=s,J(s,\theta) = \det\begin{pmatrix} \cos\theta & \sin\theta \\ -s\sin\theta & s\cos\theta \end{pmatrix} = s\cos^{2}\theta + s\sin^{2}\theta = s ,

so ∣J∣=s\lvert J \rvert = s. The map is one-to-one on {s>0, 0≤θ<2π}\{s > 0,\ 0 \le \theta < 2\pi\}; it fails only at the origin, a single point of zero area, which carries no probability.

Step 4: substitute. Since vx2+vy2=s2v_x^{2} + v_y^{2} = s^{2},

fS,Θ(s,θ)=12πσ2e−s2/2σ2⋅s=sσ2e−s2/2σ2⏟a function of s⋅12π⏟a function of θ,s>0, 0≤θ<2π.f_{S,\Theta}(s,\theta) = \frac{1}{2\pi\sigma^{2}} e^{-s^{2}/2\sigma^{2}} \cdot s = \underbrace{\frac{s}{\sigma^{2}}e^{-s^{2}/2\sigma^{2}}}_{\text{a function of } s} \cdot \underbrace{\frac{1}{2\pi}}_{\text{a function of }\theta} , \qquad s > 0,\ 0 \le \theta < 2\pi .

Step 5: range and marginal. The range is the product region {s>0}×[0,2π)\{s>0\} \times [0,2\pi), so the factorisation is valid on the whole of it and criterion 3 applies: SS and Θ\Theta are independent, with Θ\Theta uniform on [0,2π)[0,2\pi) and

fS(s)=sσ2 e−s2/2σ2,s>0,f_S(s) = \frac{s}{\sigma^{2}}\,e^{-s^{2}/2\sigma^{2}} , \qquad s > 0 ,

the Rayleigh density. Had the Jacobian factor ss been forgotten, the "density" would have been largest at s=0s=0, which is visibly wrong: there are more directions available at larger radius.

Step 7: checks and numbers. Substituting u=s2/2σ2u = s^{2}/2\sigma^{2} gives ∫0∞fS=∫0∞e−udu=1\int_0^\infty f_S = \int_0^\infty e^{-u}du = 1. The distribution function is FS(s)=1−e−s2/2σ2F_S(s) = 1 - e^{-s^{2}/2\sigma^{2}}, so

P(S≤σ)=1−e−1/2=0.393469,P(S≤2σ)=1−e−2=0.864665.\mathbb{P}(S \le \sigma) = 1 - e^{-1/2} = 0.393469 , \qquad \mathbb{P}(S \le 2\sigma) = 1 - e^{-2} = 0.864665 .

The most probable speed is at the maximum of fSf_S: fS′(s)=(1−s2/σ2)e−s2/2σ2/σ2f_S'(s) = (1 - s^{2}/\sigma^{2})e^{-s^{2}/2\sigma^{2}}/\sigma^{2} vanishes at s=σs = \sigma. The mean and root-mean-square speeds are

E(S)=∫0∞s2σ2e−s2/2σ2 ds=σπ2=1.253314 σ,E(S2)=E(Vx2)+E(Vy2)=σ2=1.414214 σ,\mathbb{E}(S) = \int_{0}^{\infty} \frac{s^{2}}{\sigma^{2}}e^{-s^{2}/2\sigma^{2}}\,ds = \sigma\sqrt{\tfrac{\pi}{2}} = 1.253314\,\sigma , \qquad \sqrt{\mathbb{E}(S^{2})} = \sqrt{\mathbb{E}(V_x^{2}) + \mathbb{E}(V_y^{2})} = \sigma\sqrt{2} = 1.414214\,\sigma ,

the second obtained from linearity of expectation without any integration, and the ordering σ<1.2533σ<1.4142σ\sigma < 1.2533\sigma < 1.4142\sigma of mode, mean and root-mean-square is the familiar one for a right-skewed distribution. For nitrogen at 300 K300\,\mathrm{K}, with m=28.013 um = 28.013\,u, one finds σ=kBT/m=298.40 m s−1\sigma = \sqrt{k_BT/m} = 298.40\,\mathrm{m\,s^{-1}}, a mean speed E(S)=373.99 m s−1\mathbb{E}(S) = 373.99\,\mathrm{m\,s^{-1}}, a root-mean-square speed of 422.00 m s−1422.00\,\mathrm{m\,s^{-1}}, and P(S≤298.40 m s−1)=0.3935\mathbb{P}(S \le 298.40\,\mathrm{m\,s^{-1}}) = 0.3935.

The same calculation in three dimensions, with ∣J∣=r2sin⁡ϕ\lvert J \rvert = r^{2}\sin\phi, produces the factor s2s^{2} instead of ss and so the full Maxwell-Boltzmann speed distribution.

Example(A decay time plus a readout delay: convolution)Original

An unstable state decays at a time DD measured from the start of a gate, exponentially distributed with mean lifetime τ\tau; the electronics then timestamps the event after a delay UU that is uniformly distributed between 00 and τ\tau, independently of DD. Work in units of τ\tau, so that DD has density e−de^{-d} for d>0d > 0 and UU has density 11 on (0,1)(0,1). What is the distribution of the recorded time T=D+UT = D + U?

Convolution. By part 3, with fU(u)=1f_U(u) = 1 on (0,1)(0,1) and zero elsewhere,

fT(t)=∫−∞∞fD(t−u) fU(u) du=∫0min⁡(1, t)e−(t−u) du,f_T(t) = \int_{-\infty}^{\infty} f_D(t-u)\,f_U(u)\,du = \int_{0}^{\min(1,\,t)} e^{-(t-u)}\,du ,

the upper limit being min⁡(1,t)\min(1,t) because fDf_D vanishes unless t−u>0t - u > 0, that is unless u<tu < t, while fUf_U vanishes unless u<1u < 1. Carrying out the elementary integral ∫0ae−(t−u)du=e−t(ea−1)\int_0^{a} e^{-(t-u)}du = e^{-t}(e^{a} - 1) with a=min⁡(1,t)a = \min(1,t):

fT(t)={0,t≤0,e−t(et−1)=1−e−t,0<t<1,e−t(e−1),t≥1.f_T(t) = \begin{cases} 0 , & t \le 0 , \\[2pt] e^{-t}\bigl( e^{t} - 1 \bigr) = 1 - e^{-t} , & 0 < t < 1 , \\[2pt] e^{-t}\bigl( e - 1 \bigr) , & t \ge 1 . \end{cases}

Checks. The two branches agree at t=1t = 1, where both give 1−e−1=0.6321211 - e^{-1} = 0.632121, so fTf_T is continuous; it rises from 00 on (0,1)(0,1) and decays exponentially thereafter, with its maximum at t=1t = 1. Its total mass is

∫01(1−e−t)dt+∫1∞(e−1)e−t dt=[1−(1−e−1)]+(e−1)e−1=e−1+(1−e−1)=1.\int_{0}^{1}\bigl(1 - e^{-t}\bigr)dt + \int_{1}^{\infty}(e-1)e^{-t}\,dt = \bigl[ 1 - (1 - e^{-1}) \bigr] + (e-1)e^{-1} = e^{-1} + \bigl(1 - e^{-1}\bigr) = 1 .

By linearity of expectation and rule 6 of Expectation, variance and covariance, using independence,

E(T)=E(D)+E(U)=1+12=1.5,var⁡(T)=1+112=1312=1.083333,\mathbb{E}(T) = \mathbb{E}(D) + \mathbb{E}(U) = 1 + \tfrac12 = 1.5 , \qquad \operatorname{var}(T) = 1 + \tfrac{1}{12} = \tfrac{13}{12} = 1.083333 ,

neither of which required the density at all — a useful independent check on it.

A checkable number. The probability that the recorded time falls within one mean lifetime of the start of the gate is

P(T≤1)=∫01(1−e−t)dt=1−(1−e−1)=e−1=0.367879.\mathbb{P}(T \le 1) = \int_{0}^{1}\bigl( 1 - e^{-t}\bigr)dt = 1 - \bigl( 1 - e^{-1} \bigr) = e^{-1} = 0.367879 .

For comparison, the undelayed decay satisfies P(D≤1)=1−e−1=0.632121\mathbb{P}(D \le 1) = 1 - e^{-1} = 0.632121. The delay has moved a large part of the probability past the one-lifetime mark: the uniform smearing, though small in mean, is comparable to the lifetime and badly distorts the early part of the spectrum. Fitting a pure exponential to TT would overestimate τ\tau, and the standard remedy — deconvolving the known instrument response from the measured spectrum — is exactly the inverse of the calculation just performed.

Application(Where transformations of densities are the work)Original

Instrument response. Every measured spectrum is the convolution of the true spectrum with the response function of the apparatus: a pulse-height distribution smeared by electronic noise, a spectral line broadened by a finite slit, a time-of-flight peak widened by a trigger jitter. Part 3 is the statement of this, and the Gaussian-on-Gaussian case explains why resolutions add in quadrature, σobs2=σtrue2+σinst2\sigma_{\text{obs}}^{2} = \sigma_{\text{true}}^{2} + \sigma_{\text{inst}}^{2}. Unfolding or deconvolution reverses it, and is hard precisely because convolution destroys the high-frequency content that would be needed to invert it.

Derived quantities and error propagation. A measured quantity is almost never the one of interest: one measures a period and wants a frequency, measures two lengths and wants an aspect ratio, measures counts and wants a rate. Part 2 gives the exact density of the derived quantity, and the first-order version of it — the affine case fY(y)=∣a∣−1fX((y−b)/a)f_Y(y) = \lvert a\rvert^{-1}f_X((y-b)/a) with a=g′a = g' — is the linearised rule of Error propagation. The exact rule matters when the function is strongly curved over the width of the input distribution, which is when the linear rule silently fails.

Sampling distributions. The chi-squared, Student and Fisher distributions of Sampling distributions are each produced by one application of part 1 to independent normals: χn2=∑iZi2\chi^{2}_{n} = \sum_i Z_i^{2} by the spherical-shell version of the method, as Riley, Hobson and Bence carry it out; Student's tt as a ratio of a normal to the square root of an independent chi-squared; and FF as a ratio of two chi-squareds. The Rayleigh density of the first example is the n=2n=2 case, in disguise.

Random number generation. Inverse-transform sampling is part 2 run backwards: if UU is uniform on (0,1)(0,1) then F−1(U)F^{-1}(U) has distribution function FF. The Box-Muller algorithm is the first worked example read backwards — generate the Rayleigh radius from a uniform by inverting 1−e−s2/21 - e^{-s^{2}/2}, generate an independent uniform angle, and the Cartesian components are two independent standard normals. The whole of Monte Carlo rests on such transformations, and the Jacobian is what makes the output density correct.

Statistical mechanics and kinetic theory. The step from a distribution over velocity vectors to one over speeds, over energies, or over a relative velocity between two molecules is in every case an application of this method; the familiar density-of-states factors ss, s2s^{2}, E\sqrt{E} are Jacobians and nothing else. The same is true of the change from Cartesian to action-angle variables in phase space, where Liouville's theorem is the statement that the relevant Jacobian is 11 along the flow.

Sums and limit theorems. Repeated convolution is what the central limit theorem is about, and the reason the proof is conducted with characteristic functions is that they turn the convolution of part 3 into multiplication. The stable distributions — normal, Cauchy, Lévy — are exactly the fixed points of repeated convolution followed by rescaling.

Definition

Conditional expectation

Adapted

Defines the conditional distribution and the conditional expectation E(Y∣X)\mathbb{E}(Y \mid X) as a random variable, proves the tower, pull-through and conditional-variance rules, shows that E(Y∣X)\mathbb{E}(Y \mid X) is the function of XX closest to YY in mean square, and works a mixture example whose checks are log⁡2\log 2 and 12\tfrac12.

Prerequisites: Joint distributions and transformations, Expectation, variance and covariance, Probability spaces

Note(What conditioning is for)Original

Two quantities are measured together and only one of them is observed. A detector records an energy deposit but not the particle that caused it; a survey records a household's income but not its wealth; a simulation stores a coarse field but not the microstate behind it. The question in every case is the same: given what was seen, what is the average of what was not?

The answer is a number for each observed value, and therefore a function of the observed variable, and therefore itself a random variable. That one shift of viewpoint - from E(Y∣X=x)\mathbb{E}(Y \mid X = x), a number, to E(Y∣X)\mathbb{E}(Y \mid X), a random variable - is what makes conditional expectation a tool rather than a notation. It gives the tower property, which computes hard expectations in two easy stages; it gives the conditional variance formula, which splits a variance into a part explained by XX and a part not; and it gives the best mean-square prediction of YY from XX, which is the whole content of regression.

This unit covers the case where XX and YY are both discrete or both continuous. The general construction, which conditions on a σ\sigma-field rather than on a variable, is stated at the end and used in Martingales.

Definition(Conditional distributions, conditional expectation and conditional variance)AdaptedAdapted from Grimmett & Stirzaker (2020), §3.7, Definitions (3.7.1), (3.7.2) and (3.7.3), pp. 71-72; Grimmett & Stirzaker (2020), §4.6, Definitions (4.6.1) and (4.6.2) with the preceding limit argument, and the definition of $\psi$ following Example (4.6.3), pp. 117-118; Riley, Hobson & Bence (2006), §30.11.3, p. 1199

Let XX and YY be random variables on a probability space (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}), with joint mass function fX,Yf_{X,Y} or joint density fX,Yf_{X,Y} in the sense of Joint distributions and transformations, and write fXf_X for the marginal of XX.

Discrete case. For any xx with P(X=x)>0\mathbb{P}(X = x) > 0, the conditional mass function of YY given X=xX = x is

fY∣X(y∣x)  =  P(Y=y∣X=x)  =  fX,Y(x,y)fX(x),f_{Y \mid X}(y \mid x) \;=\; \mathbb{P}(Y = y \mid X = x) \;=\; \frac{f_{X,Y}(x,y)}{f_X(x)} ,

and the conditional distribution function is FY∣X(y∣x)=P(Y≤y∣X=x)F_{Y\mid X}(y \mid x) = \mathbb{P}(Y \le y \mid X = x). Both are undefined at any xx with P(X=x)=0\mathbb{P}(X=x) = 0, because the elementary conditional probability of Probability spaces conditions only on events of positive probability.

Continuous case. Here {X=x}\{X = x\} has probability zero and the elementary definition is unavailable. The way round it is to condition on the thickened event {x≤X≤x+h}\{x \le X \le x + h\}, which has probability ≈fX(x)h\approx f_X(x)h, and let h↓0h \downarrow 0:

P(Y≤y  ∣  x≤X≤x+h)  =  ∫−∞y∫xx+hfX,Y(u,v) du dv∫xx+hfX(u) du  →h↓0  ∫−∞yfX,Y(x,v)fX(x) dv.\mathbb{P}\bigl(Y \le y \;\big|\; x \le X \le x+h\bigr) \;=\; \frac{\int_{-\infty}^{y} \int_{x}^{x+h} f_{X,Y}(u,v)\,du\,dv}{\int_x^{x+h} f_X(u)\,du} \;\xrightarrow[h \downarrow 0]{}\; \int_{-\infty}^{y} \frac{f_{X,Y}(x,v)}{f_X(x)}\,dv .

The limit is taken as the definition: for any xx with fX(x)>0f_X(x) > 0, the conditional density and conditional distribution function of YY given X=xX = x are

fY∣X(y∣x)  =  fX,Y(x,y)fX(x),FY∣X(y∣x)  =  ∫−∞yfY∣X(v∣x) dv.f_{Y \mid X}(y \mid x) \;=\; \frac{f_{X,Y}(x,y)}{f_X(x)} , \qquad F_{Y \mid X}(y \mid x) \;=\; \int_{-\infty}^{y} f_{Y\mid X}(v \mid x)\,dv .

One formula, fY∣X=fX,Y/fXf_{Y\mid X} = f_{X,Y}/f_X, serves both cases. Riley, Hobson and Bence (Riley, Hobson & Bence (2006), §30.11.3, p. 1199) describe it as taking the slice of the joint density at the observed value and dividing by whatever is needed to make it integrate to 11; since ∫fX,Y(x,v) dv=fX(x)\int f_{X,Y}(x,v)\,dv = f_X(x), that divisor is exactly fX(x)f_X(x).

Conditional expectation. Suppose E∣Y∣<∞\mathbb{E}\lvert Y\rvert < \infty. For each xx with fX(x)>0f_X(x) > 0 put

ψ(x)  =  E(Y∣X=x)  =  {∑yy fY∣X(y∣x)(discrete),∫−∞∞y fY∣X(y∣x) dy(continuous).\psi(x) \;=\; \mathbb{E}(Y \mid X = x) \;=\; \begin{cases} \displaystyle\sum_{y} y\, f_{Y\mid X}(y \mid x) & \text{(discrete)},\\[2ex] \displaystyle\int_{-\infty}^{\infty} y\, f_{Y\mid X}(y \mid x)\,dy & \text{(continuous)}. \end{cases}

Then the conditional expectation of YY given XX is the random variable

E(Y∣X)  =  ψ(X),\mathbb{E}(Y \mid X) \;=\; \psi(X) ,

the composition of the function ψ\psi with the random variable XX. Its value at a sample point ω\omega is ψ(X(ω))\psi(X(\omega)). Grimmett and Stirzaker emphasise that although the phrase sounds like a number, the object is a random variable; the number is E(Y∣X=x)\mathbb{E}(Y\mid X=x) for a fixed xx.

Conditional variance. With ψ\psi as above and E(Y2)<∞\mathbb{E}(Y^2) < \infty, set v(x)=E((Y−ψ(x))2∣X=x)v(x) = \mathbb{E}\bigl((Y - \psi(x))^2 \mid X = x\bigr), the variance of the conditional distribution of YY given X=xX=x, and define the random variable var⁡(Y∣X)=v(X)\operatorname{var}(Y \mid X) = v(X). Equivalently var⁡(Y∣X)=E(Y2∣X)−(E(Y∣X))2\operatorname{var}(Y\mid X) = \mathbb{E}(Y^2 \mid X) - \bigl(\mathbb{E}(Y\mid X)\bigr)^2.

Everywhere below, an identity between conditional expectations is an identity between random variables and holds with probability 11; we follow Grimmett and Stirzaker in not repeating the qualification.

Definition(The rules of conditional expectation)AdaptedAdapted from Grimmett & Stirzaker (2020), §3.7, Theorem (3.7.4), Theorem (3.7.6) with eq. (3.7.7), and Exercises (3.7.1)(a)-(f), (3.7.2) and (3.7.4), pp. 72-74; Grimmett & Stirzaker (2020), §7.7, Lemmas (7.7.10) and (7.7.11), p. 381

Let XX, YY, ZZ be random variables with E∣Y∣,E∣Z∣<∞\mathbb{E}\lvert Y\rvert, \mathbb{E}\lvert Z\rvert < \infty, let a,b∈Ra, b \in \mathbb{R}, and let gg be a function for which the expectations written below exist.

  1. Partial averaging. E(ψ(X) g(X))  =  E(Y g(X))\displaystyle \mathbb{E}\bigl(\psi(X)\,g(X)\bigr) \;=\; \mathbb{E}\bigl(Y\,g(X)\bigr), where ψ(X)=E(Y∣X)\psi(X) = \mathbb{E}(Y\mid X).
  2. Tower property (first form). Taking g≡1g \equiv 1 in rule 1, E(E(Y∣X))  =  E(Y),that isE(Y)  =  ∑xE(Y∣X=x) P(X=x)\mathbb{E}\bigl(\mathbb{E}(Y \mid X)\bigr) \;=\; \mathbb{E}(Y) , \qquad\text{that is}\qquad \mathbb{E}(Y) \;=\; \sum_x \mathbb{E}(Y \mid X = x)\,\mathbb{P}(X = x) in the discrete case and E(Y)=∫E(Y∣X=x)fX(x) dx\mathbb{E}(Y) = \int \mathbb{E}(Y\mid X=x) f_X(x)\,dx in the continuous case.
  3. Linearity. E(aY+bZ∣X)=a E(Y∣X)+b E(Z∣X)\mathbb{E}(aY + bZ \mid X) = a\,\mathbb{E}(Y\mid X) + b\,\mathbb{E}(Z \mid X), and E(1∣X)=1\mathbb{E}(1 \mid X) = 1.
  4. Positivity. If Y≥0Y \ge 0 then E(Y∣X)≥0\mathbb{E}(Y \mid X) \ge 0.
  5. Pull-through. E(Y g(X)∣X)=g(X) E(Y∣X)\mathbb{E}\bigl(Y\,g(X) \mid X\bigr) = g(X)\,\mathbb{E}(Y \mid X): a function of the conditioning variable behaves as a constant.
  6. Independence. If XX and YY are independent then E(Y∣X)=E(Y)\mathbb{E}(Y\mid X) = \mathbb{E}(Y), a constant.
  7. Relabelling. E(Y∣h(X))=E(Y∣X)\mathbb{E}(Y \mid h(X)) = \mathbb{E}(Y \mid X) whenever hh is one-to-one.
  8. Tower property (general form). E(E(Y∣X,Z) ∣ X)=E(Y∣X)=E(E(Y∣X) ∣ X,Z)\mathbb{E}\bigl(\mathbb{E}(Y \mid X, Z) \,\big|\, X\bigr) = \mathbb{E}(Y \mid X) = \mathbb{E}\bigl(\mathbb{E}(Y\mid X) \,\big|\, X, Z\bigr). Conditioning twice, coarsely after finely or finely after coarsely, gives the coarser answer.
  9. Almost sure uniqueness. If φ(X)\varphi(X) and ψ(X)\psi(X) both satisfy rule 1 for every admissible gg, then P(φ(X)=ψ(X))=1\mathbb{P}(\varphi(X) = \psi(X)) = 1. Consequently rule 1 characterises E(Y∣X)\mathbb{E}(Y\mid X) and may be taken as its definition; Grimmett and Stirzaker say so explicitly and use that route for the general theory.
  10. Conditional variance formula. If E(Y2)<∞\mathbb{E}(Y^2) < \infty then var⁡(Y)  =  E(var⁡(Y∣X))  +  var⁡(E(Y∣X)).\operatorname{var}(Y) \;=\; \mathbb{E}\bigl(\operatorname{var}(Y \mid X)\bigr) \;+\; \operatorname{var}\bigl(\mathbb{E}(Y \mid X)\bigr) .
Definition(Conditional expectation is the best mean-square prediction)AdaptedAdapted from Grimmett & Stirzaker (2020), §7.9, Definition (7.9.5), Theorem (7.9.9), Projection theorem (7.9.14) and Theorem (7.9.17), pp. 388-391

Write ∥U∥2=E(U2)\lVert U \rVert_2 = \sqrt{\mathbb{E}(U^2)}, and let

H  =  { h(X)  :  h:R→R, E(h(X)2)<∞ }H \;=\; \bigl\{\, h(X) \;:\; h : \mathbb{R}\to\mathbb{R},\ \mathbb{E}\bigl(h(X)^2\bigr) < \infty \,\bigr\}

be the set of square-integrable functions of XX. An element Y^∈H\widehat Y \in H carries the name best predictor (in full, minimum mean-squared-error predictor, which is Grimmett and Stirzaker's term) when ∥Y−Y^∥2≤∥Y−Z∥2\lVert Y - \widehat Y\rVert_2 \le \lVert Y - Z\rVert_2 for every Z∈HZ \in H. Suppose E(Y2)<∞\mathbb{E}(Y^2) < \infty. Then:

  • (a) Existence and uniqueness. A best predictor exists, and it is unique up to a null event: if Y^\widehat Y and Y~\widetilde Y both attain the minimum then P(Y^=Y~)=1\mathbb{P}(\widehat Y = \widetilde Y) = 1.
  • (b) Orthogonality. For M∈HM \in H, the two statements E((Y−M)Z)=0  for all Z∈Hand∥Y−M∥2≤∥Y−Z∥2  for all Z∈H\mathbb{E}\bigl((Y - M)Z\bigr) = 0 \ \ \text{for all } Z \in H \qquad\text{and}\qquad \lVert Y - M\rVert_2 \le \lVert Y - Z\rVert_2 \ \ \text{for all } Z \in H are equivalent. This is the projection theorem: minimising the distance and being perpendicular to HH are the same condition.
  • (c) Identification. The best predictor of YY given XX is E(Y∣X)\mathbb{E}(Y\mid X), and the minimum value of the mean squared error is E((Y−E(Y∣X))2)  =  E(var⁡(Y∣X)).\mathbb{E}\Bigl(\bigl(Y - \mathbb{E}(Y\mid X)\bigr)^2\Bigr) \;=\; \mathbb{E}\bigl(\operatorname{var}(Y\mid X)\bigr) .

Because (c) holds for every pair X,YX, Y with E(Y2)<∞\mathbb{E}(Y^2)<\infty, whatever their types, Grimmett and Stirzaker point out that it can be adopted as the definition of E(Y∣X)\mathbb{E}(Y\mid X): the conditional expectation is the orthogonal projection of YY onto the functions of XX. That is the formulation which generalises.

Definition(The general definition, by conditioning on a sub-σ\sigma-field)AdaptedAdapted from Grimmett & Stirzaker (2020), §7.9, Definition (7.9.20) with eqs. (7.9.21)-(7.9.23), pp. 391-392; Folland (1999), §3.2, Exercise 17, p. 93

Let G⊆F\mathcal{G} \subseteq \mathcal{F} be a sub-σ\sigma-field. For YY with E(Y2)<∞\mathbb{E}(Y^2) < \infty, Grimmett and Stirzaker define E(Y∣G)\mathbb{E}(Y \mid \mathcal{G}) to be the G\mathcal{G}-measurable random variable with

E((Y−E(Y∣G))Z)=0for all G-measurable Z with E(Z2)<∞,\mathbb{E}\Bigl(\bigl(Y - \mathbb{E}(Y\mid\mathcal{G})\bigr) Z\Bigr) = 0 \quad\text{for all $\mathcal{G}$-measurable $Z$ with } \mathbb{E}(Z^2)<\infty ,

which they then show may equivalently be required only for the indicators Z=1GZ = \mathbf{1}_G, G∈GG \in \mathcal{G}; taking G=ΩG = \Omega recovers E(E(Y∣G))=E(Y)\mathbb{E}(\mathbb{E}(Y\mid\mathcal{G})) = \mathbb{E}(Y). Taking G\mathcal{G} to be the smallest σ\sigma-field making a family {Xi}\{X_i\} measurable returns the earlier notion, E(Y∣G)=E(Y∣Xi,i∈I)\mathbb{E}(Y\mid\mathcal{G}) = \mathbb{E}(Y \mid X_i, i \in I).

Folland (Folland (1999), §3.2, Exercise 17, p. 93) gives the construction that removes the second-moment hypothesis. On a σ\sigma-finite measure space (Ω,F,μ)(\Omega, \mathcal{F}, \mu) with sub-σ\sigma-algebra G\mathcal{G} and ν=μ∣G\nu = \mu|_{\mathcal{G}}, every f∈L1(μ)f \in L^1(\mu) admits a G\mathcal{G}-measurable g∈L1(ν)g \in L^1(\nu) with

∫Gf dμ  =  ∫Gg dνfor every G∈G,\int_G f \, d\mu \;=\; \int_G g \, d\nu \qquad \text{for every } G \in \mathcal{G} ,

and gg is determined up to a ν\nu-null set. Folland records that gg is what probability theory calls the conditional expectation of ff on G\mathcal{G}. Specialised to a probability measure this is E(Y∣G)\mathbb{E}(Y\mid\mathcal{G}), defined for every Y∈L1Y \in L^1 by exactly the partial-averaging property of rule 1, and existence comes from the Radon-Nikodym theorem (The Radon-Nikodym theorem) rather than from a projection.

Idea of the proofOriginal

Everything in this unit comes from one identity. Summing or integrating fY∣X(y∣x) fX(x)f_{Y\mid X}(y\mid x)\,f_X(x) over xx rebuilds the joint law, because by construction that product is fX,Y(x,y)f_{X,Y}(x,y). So averaging the conditional average over the conditioning variable undoes the conditioning: that is the tower property, and the pull-through and partial-averaging rules are the same computation with an extra factor g(x)g(x) carried along, which can leave the inner average because it does not depend on yy.

The prediction statement needs a second idea, geometric rather than algebraic. Square-integrable random variables form an inner-product space with (U,V)=E(UV)(U,V) = \mathbb{E}(UV), the functions of XX form a closed subspace HH of it, and the best predictor is the foot of the perpendicular from YY to HH. Existence of that foot is the standard closest-point argument, in which the parallelogram law turns a minimising sequence into a Cauchy sequence. Identifying the foot as E(Y∣X)\mathbb{E}(Y\mid X) is then one line: partial averaging says precisely that Y−E(Y∣X)Y - \mathbb{E}(Y\mid X) is orthogonal to every g(X)g(X).

Proof(Partial averaging, the tower property and the algebraic rules)AdaptedAdapted from Grimmett & Stirzaker (2020), §3.7, proofs of Theorems (3.7.4) and (3.7.6), pp. 72-73

We give the discrete argument; the continuous one is the same with sums replaced by integrals, which is legitimate because the conditional density was defined so that fY∣X(y∣x)fX(x)=fX,Y(x,y)f_{Y\mid X}(y\mid x) f_X(x) = f_{X,Y}(x,y) at every xx with fX(x)>0f_X(x) > 0, and the set {x:fX(x)=0}\{x : f_X(x) = 0\} contributes nothing to any of the integrals.

Rule 1. By the law of the unconscious statistician (Expectation, variance and covariance) applied to the function x↦ψ(x)g(x)x \mapsto \psi(x)g(x) of XX,

E(ψ(X)g(X))  =  ∑xψ(x) g(x) fX(x).\mathbb{E}\bigl(\psi(X)g(X)\bigr) \;=\; \sum_x \psi(x)\,g(x)\,f_X(x) .

Insert the definition ψ(x)=∑yy fY∣X(y∣x)\psi(x) = \sum_y y\, f_{Y\mid X}(y\mid x) and move g(x)fX(x)g(x) f_X(x) inside the inner sum:

E(ψ(X)g(X))  =  ∑x∑yy g(x) fY∣X(y∣x) fX(x)  =  ∑x,yy g(x) fX,Y(x,y),\mathbb{E}\bigl(\psi(X)g(X)\bigr) \;=\; \sum_x \sum_y y\,g(x)\, f_{Y\mid X}(y\mid x)\, f_X(x) \;=\; \sum_{x,y} y\,g(x)\, f_{X,Y}(x,y) ,

using fY∣XfX=fX,Yf_{Y\mid X}f_X = f_{X,Y}. The last double sum is E(Yg(X))\mathbb{E}(Y g(X)), again by the law of the unconscious statistician, now for the function (x,y)↦y g(x)(x,y)\mapsto y\,g(x) of the pair. The interchange of the two sums is justified by absolute convergence, which is the hypothesis that the expectations exist.

Rule 2. Put g≡1g \equiv 1 in rule 1. The right-hand side is E(Y)\mathbb{E}(Y) and the left-hand side is E(ψ(X))\mathbb{E}(\psi(X)), which written out is ∑xE(Y∣X=x)P(X=x)\sum_x \mathbb{E}(Y\mid X=x)\mathbb{P}(X=x).

Rules 3, 4, 6. Each holds at every fixed xx and therefore holds after substituting XX for xx. Linearity holds because E( ⋅∣X=x)\mathbb{E}(\,\cdot \mid X=x) is an expectation with respect to the probability mass function fY∣X(⋅∣x)f_{Y\mid X}(\cdot\mid x), and expectations are linear; the same remark gives E(1∣X=x)=1\mathbb{E}(1\mid X=x)=1 and E(Y∣X=x)≥0\mathbb{E}(Y\mid X=x)\ge0 for Y≥0Y\ge0. For rule 6, independence makes fX,Y=fXfYf_{X,Y} = f_X f_Y, hence fY∣X(y∣x)=fY(y)f_{Y\mid X}(y\mid x) = f_Y(y) for every xx with fX(x)>0f_X(x)>0, so ψ(x)=E(Y)\psi(x) = \mathbb{E}(Y) does not depend on xx.

Rule 5. Fix xx with fX(x)>0f_X(x) > 0. Conditional on {X=x}\{X = x\} the factor g(X)g(X) equals the constant g(x)g(x), so

E(Yg(X)∣X=x)=∑yy g(x) fY∣X(y∣x)=g(x) E(Y∣X=x).\mathbb{E}\bigl(Y g(X) \mid X = x\bigr) = \sum_y y\,g(x)\,f_{Y\mid X}(y \mid x) = g(x)\,\mathbb{E}(Y \mid X = x) .

Substituting XX for xx gives the claim.

Rule 7. If hh is one-to-one then the events {X=x}\{X = x\} and {h(X)=h(x)}\{h(X) = h(x)\} are the same event, so the two conditional distributions, and hence the two conditional expectations, coincide. Grimmett and Stirzaker make exactly this observation.

Rule 8. Write χ(x,z)=E(Y∣X=x,Z=z)\chi(x,z) = \mathbb{E}(Y \mid X = x, Z = z), so that E(Y∣X,Z)=χ(X,Z)\mathbb{E}(Y\mid X,Z) = \chi(X,Z). Conditioning on {X=x}\{X=x\} and using the definition twice,

E(χ(X,Z)∣X=x)=∑zχ(x,z) fZ∣X(z∣x)=∑z∑yy fX,Y,Z(x,y,z)fX,Z(x,z)⋅fX,Z(x,z)fX(x).\mathbb{E}\bigl(\chi(X,Z) \mid X = x\bigr) = \sum_z \chi(x,z)\, f_{Z\mid X}(z \mid x) = \sum_z \sum_y y \,\frac{f_{X,Y,Z}(x,y,z)}{f_{X,Z}(x,z)}\cdot\frac{f_{X,Z}(x,z)}{f_X(x)} .

The factor fX,Z(x,z)f_{X,Z}(x,z) cancels - this is the only step in the proof, and it is why the property holds - leaving ∑yy∑zfX,Y,Z(x,y,z)/fX(x)=∑yy fY∣X(y∣x)=ψ(x)\sum_y y \sum_z f_{X,Y,Z}(x,y,z)/f_X(x) = \sum_y y\, f_{Y\mid X}(y\mid x) = \psi(x). For the second equality in rule 8, note that E(Y∣X)\mathbb{E}(Y\mid X) is already a function of XX alone, hence a function of the pair (X,Z)(X,Z), so rule 5 with YY replaced by 11 returns it unchanged.

Rule 9. If E(φ(X)g(X))=E(ψ(X)g(X))\mathbb{E}(\varphi(X)g(X)) = \mathbb{E}(\psi(X)g(X)) for all admissible gg, write D=φ(X)−ψ(X)D = \varphi(X)-\psi(X) and choose g(x)=sign⁡(φ(x)−ψ(x))g(x) = \operatorname{sign}(\varphi(x)-\psi(x)), which is bounded. Then E∣D∣=E(Dg(X))=0\mathbb{E}\lvert D\rvert = \mathbb{E}(Dg(X)) = 0, and a non-negative random variable with zero mean vanishes with probability 11.

Rule 10. Abbreviate ψ=E(Y∣X)\psi = \mathbb{E}(Y\mid X) and v=var⁡(Y∣X)=E(Y2∣X)−ψ2v = \operatorname{var}(Y\mid X) = \mathbb{E}(Y^2\mid X) - \psi^2. Take expectations and use rule 2 twice:

E(v)=E(Y2)−E(ψ2),var⁡(ψ)=E(ψ2)−(Eψ)2=E(ψ2)−(EY)2.\mathbb{E}(v) = \mathbb{E}(Y^2) - \mathbb{E}(\psi^2), \qquad \operatorname{var}(\psi) = \mathbb{E}(\psi^2) - \bigl(\mathbb{E}\psi\bigr)^2 = \mathbb{E}(\psi^2) - \bigl(\mathbb{E}Y\bigr)^2 .

Adding the two displays cancels E(ψ2)\mathbb{E}(\psi^2) and leaves E(Y2)−(EY)2=var⁡(Y)\mathbb{E}(Y^2) - (\mathbb{E}Y)^2 = \operatorname{var}(Y). □\square

Proof(Best mean-square prediction)AdaptedAdapted from Grimmett & Stirzaker (2020), §7.9, proofs of Theorem (7.9.9), the Projection theorem (7.9.14) and Theorem (7.9.17), pp. 389-391

Step 1: HH is a closed linear space. A linear combination of square-integrable functions of XX is a square-integrable function of XX, by the Minkowski inequality, so HH is a linear space. It is closed in the norm ∥⋅∥2\lVert\cdot\rVert_2: if hn(X)h_n(X) is a Cauchy sequence in HH then it converges in mean square to some square-integrable limit, and a mean-square limit of functions of XX is again (almost surely equal to) a function of XX. This is the completeness of L2L^2 (L^p spaces).

Step 2: a closest point exists. Let d=inf⁡{∥Y−Z∥2:Z∈H}d = \inf\{\lVert Y - Z\rVert_2 : Z \in H\} and pick Z1,Z2,⋯∈HZ_1, Z_2, \dots \in H with ∥Y−Zn∥2→d\lVert Y - Z_n\rVert_2 \to d. For any A,B∈HA, B \in H the parallelogram law, applied to the vectors Y−AY-A and Y−BY-B, reads

∥A−B∥22  =  2∥Y−A∥22+2∥Y−B∥22−4∥Y−12(A+B)∥22;\lVert A - B\rVert_2^2 \;=\; 2\lVert Y-A\rVert_2^2 + 2\lVert Y-B\rVert_2^2 - 4\bigl\lVert Y - \tfrac12(A+B)\bigr\rVert_2^2 ;

expanding both sides as expectations verifies it. Take A=ZmA = Z_m, B=ZnB = Z_n. Since 12(Zm+Zn)∈H\tfrac12(Z_m+Z_n) \in H (here linearity of HH is used), the last term is at least 4d24d^2, so

∥Zm−Zn∥22  ≤  2(∥Y−Zm∥22−d2)+2(∥Y−Zn∥22−d2)  ⟶  0.\lVert Z_m - Z_n\rVert_2^2 \;\le\; 2\bigl(\lVert Y - Z_m\rVert_2^2 - d^2\bigr) + 2\bigl(\lVert Y-Z_n\rVert_2^2 - d^2\bigr) \;\longrightarrow\; 0 .

Thus (Zn)(Z_n) is Cauchy, and by closedness it converges in mean square to some Y^∈H\widehat Y \in H. The triangle inequality gives ∥Y−Y^∥2≤∥Y−Zn∥2+∥Zn−Y^∥2→d\lVert Y - \widehat Y\rVert_2 \le \lVert Y - Z_n\rVert_2 + \lVert Z_n - \widehat Y\rVert_2 \to d, so ∥Y−Y^∥2=d\lVert Y-\widehat Y\rVert_2 = d and Y^\widehat Y attains the minimum.

Step 3: the minimiser is unique up to a null event. If Y~∈H\widetilde Y \in H also attains dd, apply the parallelogram law with A=Y~A = \widetilde Y, B=Y^B = \widehat Y: the first two terms give 4d24d^2 and the last is at least 4d24d^2, so ∥Y~−Y^∥22≤0\lVert \widetilde Y - \widehat Y\rVert_2^2 \le 0. Hence E((Y~−Y^)2)=0\mathbb{E}((\widetilde Y - \widehat Y)^2) = 0 and the two agree with probability 11.

Step 4: minimising is the same as being orthogonal. Suppose M∈HM \in H satisfies E((Y−M)Z)=0\mathbb{E}((Y-M)Z) = 0 for all Z∈HZ \in H. For M′∈HM' \in H the difference M−M′M - M' lies in HH, so the cross term in

E((Y−M′)2)=E((Y−M)2)+2 E((Y−M)(M−M′))+E((M−M′)2)\mathbb{E}\bigl((Y-M')^2\bigr) = \mathbb{E}\bigl((Y-M)^2\bigr) + 2\,\mathbb{E}\bigl((Y-M)(M-M')\bigr) + \mathbb{E}\bigl((M-M')^2\bigr)

vanishes, leaving ∥Y−M′∥22=∥Y−M∥22+∥M−M′∥22≥∥Y−M∥22\lVert Y-M'\rVert_2^2 = \lVert Y-M\rVert_2^2 + \lVert M-M'\rVert_2^2 \ge \lVert Y-M\rVert_2^2: MM minimises. Conversely suppose MM minimises but E((Y−M)Z)=c>0\mathbb{E}((Y-M)Z) = c > 0 for some Z∈HZ \in H; rescaling ZZ we may take E(Z2)=1\mathbb{E}(Z^2)=1. Then M′=M+cZ∈HM' = M + cZ \in H has

E((Y−M′)2)=E((Y−M)2)−2c E((Y−M)Z)+c2=E((Y−M)2)−c2,\mathbb{E}\bigl((Y-M')^2\bigr) = \mathbb{E}\bigl((Y-M)^2\bigr) - 2c\,\mathbb{E}\bigl((Y-M)Z\bigr) + c^2 = \mathbb{E}\bigl((Y-M)^2\bigr) - c^2 ,

contradicting minimality. (If c<0c<0 replace ZZ by −Z-Z.) So a minimiser is orthogonal to HH.

Step 5: the projection is E(Y∣X)\mathbb{E}(Y\mid X). First, ψ(X)=E(Y∣X)\psi(X) = \mathbb{E}(Y\mid X) lies in HH: by the conditional Jensen inequality in the form ψ(x)2=E(Y∣X=x)2≤E(Y2∣X=x)\psi(x)^2 = \mathbb{E}(Y\mid X=x)^2 \le \mathbb{E}(Y^2 \mid X = x), which is the Cauchy-Schwarz inequality applied inside the conditional distribution, taking expectations gives E(ψ(X)2)≤E(Y2)<∞\mathbb{E}(\psi(X)^2) \le \mathbb{E}(Y^2) < \infty. Second, for any Z=h(X)∈HZ = h(X) \in H,

E((Y−ψ(X)) h(X))  =  E(Yh(X))−E(ψ(X)h(X))  =  0\mathbb{E}\bigl((Y - \psi(X))\,h(X)\bigr) \;=\; \mathbb{E}\bigl(Y h(X)\bigr) - \mathbb{E}\bigl(\psi(X) h(X)\bigr) \;=\; 0

by rule 1 with g=hg = h. So ψ(X)\psi(X) is orthogonal to HH, and by step 4 it minimises. Finally, by rules 2 and 5,

E((Y−ψ(X))2)=E(E((Y−ψ(X))2 ∣ X))=E(var⁡(Y∣X)),\mathbb{E}\bigl((Y-\psi(X))^2\bigr) = \mathbb{E}\Bigl(\mathbb{E}\bigl((Y-\psi(X))^2 \,\big|\, X\bigr)\Bigr) = \mathbb{E}\bigl(\operatorname{var}(Y\mid X)\bigr) ,

the inner conditional expectation being the variance of the conditional distribution because ψ(X)\psi(X) is its mean. □\square

Remark(Where the hypotheses are used, and what fails without them)Original
  • fX(x)>0f_X(x) > 0 is needed to define anything at xx. Conditioning is division by fX(x)f_X(x). At values the conditioning variable never takes, there is no conditional distribution, and E(Y∣X)\mathbb{E}(Y\mid X) is simply not specified there. This costs nothing, because the set {fX=0}\{f_X = 0\} has probability zero, but it is why every identity above is an identity "with probability 11" and no more.
  • The limiting definition in the continuous case is a choice, not a theorem. P(Y≤y∣X=x)\mathbb{P}(Y\le y \mid X=x) has no elementary meaning; we defined it as the limit of P(Y≤y∣x≤X≤x+h)\mathbb{P}(Y\le y\mid x\le X\le x+h). Conditioning the same event on a different family of shrinking sets can give a different answer. The standard warning case is a point on a sphere: conditioning on a shrinking band of latitude and conditioning on a shrinking wedge of longitude produce different "conditional distributions" of the other coordinate, because the two families of thick events shrink in different ways. Nothing below is affected, since we fix the family once and for all, but the notation P(⋅∣X=x)\mathbb{P}(\cdot \mid X=x) hides a convention.
  • E∣Y∣<∞\mathbb{E}\lvert Y\rvert<\infty is what rules 1-9 need; E(Y2)<∞\mathbb{E}(Y^2)<\infty is what the prediction theorem needs. Rule 10 and the whole of the projection argument use the second moment, in three places: to put ψ(X)\psi(X) in HH, to make the parallelogram law meaningful, and to make dd finite. For YY with E∣Y∣<∞\mathbb{E}\lvert Y\rvert < \infty but E(Y2)=∞\mathbb{E}(Y^2) = \infty - a Pareto variable with index 3/23/2, say - the conditional expectation still exists by the Folland construction above, and rules 1-9 still hold, but "closest in mean square" is vacuous because every candidate is at infinite distance.
  • Linearity of HH is used, and it is not free. Step 2 needs 12(Zm+Zn)∈H\tfrac12(Z_m+Z_n) \in H. If HH were replaced by a non-convex set of predictors - say, the functions of XX taking only the values 00 and 11 - the minimising sequence argument collapses and the closest point can fail to be unique.
  • Rule 5 is why the proof of rule 8 is a cancellation and not a computation. The only property of g(X)g(X) used is that it is already determined by the conditioning variable. Replace g(X)g(X) by g(Y)g(Y) and the rule is false: for X,YX, Y independent standard normals, E(Y⋅Y∣X)=1≠Y E(Y∣X)=0\mathbb{E}(Y\cdot Y\mid X) = 1 \ne Y\,\mathbb{E}(Y\mid X) = 0.
  • Uncorrelated is weaker than "conditional mean is constant", which is weaker than independence. Rule 6 goes one way only. Let XX be uniform on {−1,0,1}\{-1,0,1\} and Y=X2Y = X^2. Then E(Y∣X)=X2\mathbb{E}(Y\mid X) = X^2, not constant, yet cov⁡(X,Y)=E(X3)=0\operatorname{cov}(X,Y) = \mathbb{E}(X^3) = 0. Conversely E(Y∣X)=E(Y)\mathbb{E}(Y\mid X) = \mathbb{E}(Y) forces cov⁡(X,Y)=0\operatorname{cov}(X,Y)=0 by rules 1 and 2, but does not force independence, since it says nothing about E(Y2∣X)\mathbb{E}(Y^2\mid X).
Method(Computing a conditional expectation)Original
  1. Decide which variable is observed. Write down the joint law fX,Yf_{X,Y} of the observed XX and the unobserved YY. If the model is specified the other way round - XX has some law and, given X=xX = x, YY has some law - then fX,Y(x,y)=fX(x)fY∣X(y∣x)f_{X,Y}(x,y) = f_X(x) f_{Y\mid X}(y\mid x) is already the joint law and step 2 is unnecessary.
  2. Marginalise. Compute fX(x)=∑yfX,Y(x,y)f_X(x) = \sum_y f_{X,Y}(x,y) or ∫fX,Y(x,y) dy\int f_{X,Y}(x,y)\,dy, and note where it vanishes.
  3. Divide. Form fY∣X(y∣x)=fX,Y(x,y)/fX(x)f_{Y\mid X}(y\mid x) = f_{X,Y}(x,y)/f_X(x) and check that it integrates (or sums) to 11 in yy for each fixed xx. This catches most algebra slips at once.
  4. Average in yy. Compute ψ(x)=∫y fY∣X(y∣x) dy\psi(x) = \int y\,f_{Y\mid X}(y\mid x)\,dy. Recognising the conditional law as a standard distribution usually saves the integral: if fY∣X(⋅∣x)f_{Y\mid X}(\cdot\mid x) is exponential with rate λ(x)\lambda(x), then ψ(x)=1/λ(x)\psi(x) = 1/\lambda(x) with no work.
  5. Substitute the random variable. E(Y∣X)=ψ(X)\mathbb{E}(Y\mid X) = \psi(X). If what is wanted is E(Y)\mathbb{E}(Y), stop here and apply the tower property, E(Y)=∫ψ(x)fX(x) dx\mathbb{E}(Y) = \int \psi(x) f_X(x)\,dx, which is usually a one-dimensional integral in place of a two-dimensional one.
  6. Check. The tower property is a free consistency test: compute E(Y)\mathbb{E}(Y) both ways. If the second moment is wanted as well, the conditional variance formula gives a second independent check, since the two terms E(var⁡(Y∣X))\mathbb{E}(\operatorname{var}(Y\mid X)) and var⁡(E(Y∣X))\operatorname{var}(\mathbb{E}(Y\mid X)) are separately non-negative and must sum to var⁡(Y)\operatorname{var}(Y).
Example(A mixed exponential: conditioning, the tower property and the variance split)Original

A radioactive source is placed at a random distance from a counter, and the waiting time to the next recorded count is exponential with a rate that depends on the distance. Model this by letting the rate XX be uniform on [1,2][1,2] and, given X=xX = x, letting the waiting time YY be exponential with parameter xx. The joint density is then

fX,Y(x,y)  =  fX(x) fY∣X(y∣x)  =  1⋅xe−xy  =  xe−xy,1≤x≤2, y>0,f_{X,Y}(x,y) \;=\; f_X(x)\, f_{Y\mid X}(y\mid x) \;=\; 1 \cdot x e^{-xy} \;=\; x e^{-xy}, \qquad 1 \le x \le 2,\ y > 0 ,

and zero elsewhere. It is a density: ∫0∞xe−xy dy=1\int_0^\infty x e^{-xy}\,dy = 1 for each xx, and ∫121 dx=1\int_1^2 1\,dx = 1.

Step 1: the conditional law of YY given XX. It was given: fY∣X(y∣x)=xe−xyf_{Y\mid X}(y\mid x) = xe^{-xy} for y>0y>0, exponential with parameter xx. Hence, reading the mean and variance of an exponential off the standard list,

E(Y∣X=x)=1x,var⁡(Y∣X=x)=1x2,soE(Y∣X)=1X,var⁡(Y∣X)=1X2.\mathbb{E}(Y \mid X = x) = \frac{1}{x} , \qquad \operatorname{var}(Y\mid X = x) = \frac{1}{x^2} , \qquad\text{so}\qquad \mathbb{E}(Y\mid X) = \frac{1}{X}, \quad \operatorname{var}(Y\mid X) = \frac{1}{X^2} .

Step 2: the mean of YY, by the tower property.

E(Y)  =  E(E(Y∣X))  =  ∫121x dx  =  log⁡2  =  0.693147…\mathbb{E}(Y) \;=\; \mathbb{E}\bigl(\mathbb{E}(Y\mid X)\bigr) \;=\; \int_1^2 \frac{1}{x}\,dx \;=\; \log 2 \;=\; 0.693147\ldots

The direct route would be the double integral ∫12∫0∞y xe−xy dy dx\int_1^2\int_0^\infty y\,xe^{-xy}\,dy\,dx, whose inner integral is 1/x1/x: the same calculation, with the tower property making the first stage invisible.

Step 3: the variance of YY, both ways. For the second moment, E(Y2∣X=x)=2/x2\mathbb{E}(Y^2\mid X=x) = 2/x^2, so

E(Y2)  =  ∫122x2 dx  =  2[−1x]12  =  2(1−12)  =  1,var⁡(Y)  =  1−(log⁡2)2  =  0.519547…\mathbb{E}(Y^2) \;=\; \int_1^2 \frac{2}{x^2}\,dx \;=\; 2\Bigl[-\frac1x\Bigr]_1^2 \;=\; 2\Bigl(1-\tfrac12\Bigr) \;=\; 1 , \qquad \operatorname{var}(Y) \;=\; 1 - (\log 2)^2 \;=\; 0.519547\ldots

Now split it. The unexplained part is

E(var⁡(Y∣X))  =  ∫12dxx2  =  12  =  0.5,\mathbb{E}\bigl(\operatorname{var}(Y\mid X)\bigr) \;=\; \int_1^2 \frac{dx}{x^2} \;=\; \frac12 \;=\; 0.5 ,

and the part explained by knowing XX is

var⁡(E(Y∣X))  =  E(1X2)−(E1X)2  =  12−(log⁡2)2  =  0.019547…\operatorname{var}\bigl(\mathbb{E}(Y\mid X)\bigr) \;=\; \mathbb{E}\Bigl(\frac{1}{X^2}\Bigr) - \Bigl(\mathbb{E}\frac1X\Bigr)^2 \;=\; \frac12 - (\log 2)^2 \;=\; 0.019547\ldots

Their sum is 1−(log⁡2)21 - (\log 2)^2, matching var⁡(Y)\operatorname{var}(Y) exactly, as rule 10 requires. Only 3.8%3.8\% of the variance of the waiting time is attributable to not knowing the rate; the rest is the intrinsic randomness of the exponential.

Step 4: the best prediction and its error. By the theorem, the best mean-square prediction of YY from XX is Y^=1/X\widehat Y = 1/X, with mean squared error E(var⁡(Y∣X))=12\mathbb{E}(\operatorname{var}(Y\mid X)) = \boxed{\tfrac12}. Compare the best linear prediction a+bXa + bX. Here E(XY)=E(X E(Y∣X))=E(X⋅X−1)=1\mathbb{E}(XY) = \mathbb{E}(X\,\mathbb{E}(Y\mid X)) = \mathbb{E}(X \cdot X^{-1}) = 1 by rules 5 and 2, so

cov⁡(X,Y)=1−32log⁡2=−0.0397208…,var⁡(X)=112,\operatorname{cov}(X,Y) = 1 - \tfrac32\log 2 = -0.0397208\ldots, \qquad \operatorname{var}(X) = \tfrac1{12} ,

and the best linear predictor has mean squared error var⁡(Y)−cov⁡(X,Y)2/var⁡(X)=0.500614…\operatorname{var}(Y) - \operatorname{cov}(X,Y)^2/\operatorname{var}(X) = 0.500614\ldots The nonlinear predictor wins, as it must, but only just: over 1≤x≤21 \le x \le 2 the curve 1/x1/x is nearly straight.

Step 5: a check by a different route. Rule 2 applied to the indicator of an event gives P(Y>1)=E(P(Y>1∣X))=∫12e−x dx=e−1−e−2=0.2325442…\mathbb{P}(Y > 1) = \mathbb{E}(\mathbb{P}(Y>1\mid X)) = \int_1^2 e^{-x}\,dx = e^{-1}-e^{-2} = 0.2325442\ldots. Integrating the joint density directly, ∫12∫1∞xe−xy dy dx=∫12e−xdx\int_1^2\int_1^\infty x e^{-xy}\,dy\,dx = \int_1^2 e^{-x}dx, the same number. (All values here were confirmed symbolically.)

Application(Regression, filtering and coarse-graining)Original

Regression is conditional expectation. The regression function of YY on XX is by definition x↦E(Y∣X=x)x \mapsto \mathbb{E}(Y\mid X=x), and the theorem above is the reason least squares is the default fitting criterion: minimising mean squared error over all functions of the predictors returns the conditional mean, and minimising it over affine functions returns the line that statisticians call the regression line. The familiar decomposition of a total sum of squares into "explained" and "residual" parts is rule 10 estimated from data, and the coefficient of determination R2R^2 estimates var⁡(E(Y∣X))/var⁡(Y)\operatorname{var}(\mathbb{E}(Y\mid X))/\operatorname{var}(Y) - in the worked example, 0.0195/0.5195=3.8%0.0195/0.5195 = 3.8\%.

Filtering and data assimilation. A Kalman filter propagates exactly one object: the conditional distribution of the unobserved state given all observations so far. The update step is Bayes' theorem on conditional densities, the forecast step is the tower property, and the reported state estimate is the conditional mean because that is the estimate with least mean squared error. Weather and ocean models assimilate observations by the same logic on a very large state space, with ensembles standing in for the conditional distribution.

Coarse-graining in statistical physics. Integrating a Gibbs distribution over fast degrees of freedom at fixed slow ones produces a conditional distribution, and the resulting effective Hamiltonian is built from conditional expectations of the microscopic one. The conditional variance formula is the statement that the fluctuation of an observable splits into a within-cell part and a between-cell part - the decomposition behind block-spin renormalisation and behind the separation of thermal noise from sampling noise in a Monte Carlo estimate.

Variance reduction in simulation. If a quantity YY can be averaged analytically given some auxiliary variable XX, replacing the sampled YY by the computed E(Y∣X)\mathbb{E}(Y\mid X) leaves the mean unchanged (rule 2) and reduces the variance by exactly E(var⁡(Y∣X))\mathbb{E}(\operatorname{var}(Y\mid X)) (rule 10). This is conditional Monte Carlo, and it is free whenever the inner average is available in closed form.

Martingales. The defining property of a martingale, E(Sn+1∣X1,…,Xn)=Sn\mathbb{E}(S_{n+1}\mid X_1,\dots,X_n) = S_n, is a statement about conditional expectation, and the whole theory in Martingales runs on the tower property. The same is true of the Markov property in Discrete-time Markov chains, which says that conditioning on the whole past is the same as conditioning on the present.

Definition

The multivariate normal distribution

Adapted

Defines the N(μ,V)N(\mu, V) density on Rn\mathbb{R}^n, proves its normalisation, mean and covariance matrix by orthogonal diagonalisation, shows that linear images, marginals and conditionals are all normal with explicit parameters, and works a three-dimensional example whose conditional law is N(9/5,13/5)N(9/5, 13/5).

Prerequisites: Joint distributions and transformations, Expectation, variance and covariance, Spectral theorem for Hermitian matrices, Quadratic forms and the Rayleigh quotient, Gaussian integrals, Multiple integrals and change of variables

Note(Why this distribution and no other)Original

Three facts make the multivariate normal the working distribution of the physical sciences. It is the limit law of sums, by the central limit theorem, so it describes any quantity assembled from many small independent contributions. It is closed under every linear operation - sums, projections, rotations, marginalisation and conditioning all return normal laws - so a linear model with normal inputs has normal outputs and the bookkeeping never leaves the family. And it is determined entirely by a mean vector and a covariance matrix, so quoting a best-fit parameter set with its error matrix is a complete statement of the result, not a summary of one.

The price is one hypothesis that is easy to forget: jointly normal is much stronger than normal one coordinate at a time. The remark below gives a pair of standard normal variables that is not bivariate normal at all, and for which zero correlation does not give independence.

Definition(The multivariate normal density)AdaptedAdapted from Grimmett & Stirzaker (2020), §4.9, the discussion of (4.9.1)-(4.9.3) and Definition (4.9.4), pp. 131-132; Riley, Hobson & Bence (2006), §30.15.2, the form preceding (30.148) and eq. (30.148), pp. 1209-1210

Throughout, xx, μ\mu and tt are column vectors in Rn\mathbb{R}^n and MTM^{T} is the transpose of MM. A real symmetric n×nn\times n matrix VV is positive definite if uTVu>0u^{T}Vu > 0 for every u≠0u \ne 0; by the spectral theorem (Spectral theorem for Hermitian matrices) this holds exactly when all eigenvalues of VV are strictly positive, and then VV is invertible with det⁡V>0\det V > 0.

A random vector X=(X1,…,Xn)TX = (X_1,\dots,X_n)^{T} has the multivariate normal (or multinormal) distribution N(μ,V)N(\mu, V), with μ∈Rn\mu \in \mathbb{R}^n and VV symmetric positive definite, if its joint density is

f(x)  =  1(2π)n/2 (det⁡V)1/2 exp⁡(−12 (x−μ)TV−1(x−μ)),x∈Rn.f(x) \;=\; \frac{1}{(2\pi)^{n/2}\,(\det V)^{1/2}}\, \exp\Bigl(-\tfrac12\,(x-\mu)^{T}V^{-1}(x-\mu)\Bigr) , \qquad x \in \mathbb{R}^n .

The case μ=0\mu = 0, V=IV = I is the standard multivariate normal, a vector of nn independent N(0,1)N(0,1) variables. For n=1n = 1 the formula is the familiar N(μ,σ2)N(\mu,\sigma^2) density with V=(σ2)V = (\sigma^2). For n=2n=2, writing V=(σ12ρσ1σ2ρσ1σ2σ22)V = \begin{pmatrix}\sigma_1^2 & \rho\sigma_1\sigma_2\\ \rho\sigma_1\sigma_2 & \sigma_2^2\end{pmatrix} with ∣ρ∣<1\lvert\rho\rvert<1, it is the bivariate normal density

f(x1,x2)=12πσ1σ21−ρ2exp⁡(−12(1−ρ2)[(x1−μ1σ1) ⁣2−2ρ (x1−μ1)(x2−μ2)σ1σ2+(x2−μ2σ2) ⁣2]),f(x_1,x_2) = \frac{1}{2\pi\sigma_1\sigma_2\sqrt{1-\rho^2}} \exp\left(-\frac{1}{2(1-\rho^2)}\left[\Bigl(\frac{x_1-\mu_1}{\sigma_1}\Bigr)^{\!2} - 2\rho\,\frac{(x_1-\mu_1)(x_2-\mu_2)}{\sigma_1\sigma_2} + \Bigl(\frac{x_2-\mu_2}{\sigma_2}\Bigr)^{\!2}\right]\right) ,

which is the form Grimmett and Stirzaker (Grimmett & Stirzaker (2020), §4.5, Example (4.5.9), p. 113) write out; their standard case is μ=0\mu=0, σ1=σ2=1\sigma_1=\sigma_2=1.

A convention to watch. Grimmett and Stirzaker use row vectors and write the exponent as −12(x−μ)V−1(x−μ)′-\tfrac12 (x-\mu)V^{-1}(x-\mu)', with x′x' for the transpose; Riley, Hobson and Bence use column vectors and write −12(x−μ)TV−1(x−μ)-\tfrac12(x-\mu)^{T}V^{-1}(x-\mu), which is what we use. The two expressions are the same scalar, but every matrix identity below changes shape between them: a linear map is Y=XDY = XD in the row convention and Y=DTXY = D^{T}X in the column convention, and the induced covariance is D′VDD'VD either way. We follow the column convention of Riley, Hobson and Bence throughout and translate the statements we take from Grimmett and Stirzaker; no result depends on the choice.

The singular case det⁡V=0\det V = 0 is excluded by the definition, because V−1V^{-1} does not exist. It is covered by the alternative definition below.

Definition(The parameters, and the equivalent definition by linear combinations)AdaptedAdapted from Grimmett & Stirzaker (2020), §4.9, Theorem (4.9.5), Definition (4.9.7) and the discussion of the singular case, pp. 132-133; Grimmett & Stirzaker (2020), §5.8, Example (5.8.6), pp. 209-210; Riley, Hobson & Bence (2006), §30.15.2, the moment generating function and the identification $A=V^{-1}$, pp. 1209-1210

Let X∼N(μ,V)X \sim N(\mu, V) with VV positive definite. Then

  1. E(X)=μ\mathbb{E}(X) = \mu, that is E(Xi)=μi\mathbb{E}(X_i) = \mu_i for each ii;
  2. VV is the covariance matrix: vij=cov⁡(Xi,Xj)v_{ij} = \operatorname{cov}(X_i, X_j), so the diagonal entries are the variances and V=E((X−μ)(X−μ)T)V = \mathbb{E}\bigl((X-\mu)(X-\mu)^{T}\bigr);
  3. the moment generating function and the characteristic function are MX(t)=E(etTX)=exp⁡(tTμ+12tTVt),φX(t)=E(eitTX)=exp⁡(itTμ−12tTVt),M_X(t) = \mathbb{E}\bigl(e^{t^{T}X}\bigr) = \exp\Bigl(t^{T}\mu + \tfrac12 t^{T}Vt\Bigr) , \qquad \varphi_X(t) = \mathbb{E}\bigl(e^{it^{T}X}\bigr) = \exp\Bigl(it^{T}\mu - \tfrac12 t^{T}Vt\Bigr) , both valid for every t∈Rnt \in \mathbb{R}^n (see Generating functions and Characteristic functions);
  4. the quadratic form in the exponent is a chi-squared variable: (X−μ)TV−1(X−μ)∼χ2(n)(X-\mu)^{T}V^{-1}(X-\mu) \sim \chi^2(n). Riley, Hobson and Bence add that if the XiX_i are required to satisfy mm independent linear constraints ∑iciXi=0\sum_i c_iX_i = 0 then the same quadratic form is χ2(n−m)\chi^2(n-m).

An equivalent definition. Grimmett and Stirzaker also define the multivariate normal by the property that

aTX=a1X1+⋯+anXn  has a univariate normal distribution for every a∈Rn.a^{T}X = a_1X_1 + \cdots + a_nX_n \ \text{ has a univariate normal distribution for every } a \in \mathbb{R}^n .

Every XX with the density above satisfies this. The converse holds with one exception: if some non-trivial linear combination is degenerate, P(aTX=b)=1\mathbb{P}(a^{T}X = b) = 1 with a≠0a\ne0, then aTVa=var⁡(aTX)=0a^{T}Va = \operatorname{var}(a^{T}X) = 0, so VV is singular and no density exists. Such an XX is said to have a singular multivariate normal distribution; it lives on a proper affine subspace of Rn\mathbb{R}^n. When the distribution is non-singular the two definitions agree. The linear-combination definition is the more useful one in practice, because it needs no inverse and survives degeneracy.

Definition(Linear images, marginals and conditionals are normal)AdaptedAdapted from Grimmett & Stirzaker (2020), §4.9, Theorem (4.9.6) with the remark that the case $m<n$ is omitted, p. 133, and Exercises (4.9.3), (4.9.7) and (4.9.9), pp. 134-135; Grimmett & Stirzaker (2020), §4.6, Example (4.6.7), p. 119; Riley, Hobson & Bence (2006), §30.12, eqs. (30.140)-(30.141), p. 1205

Let X∼N(μ,V)X \sim N(\mu, V) on Rn\mathbb{R}^n.

  • (a) Affine images. Let DD be an n×mn\times m matrix of rank m≤nm \le n, let c∈Rmc \in \mathbb{R}^m, and set Y=DTX+cY = D^{T}X + c. Then Y∼N(DTμ+c,  DTVD)on Rm.Y \sim N\bigl(D^{T}\mu + c,\; D^{T}VD\bigr) \quad\text{on } \mathbb{R}^m . In particular every aTXa^{T}X is univariate normal with mean aTμa^{T}\mu and variance aTVaa^{T}Va, and the covariance law VY=SVXSTV_Y = SV_XS^{T} that Riley, Hobson and Bence derive for general linearly related variables is the special case of (a) in their notation. Grimmett and Stirzaker state (a) for m≤nm \le n and prove it for m=nm=n, remarking that the proof for m<nm<n is harder and referring elsewhere for it; we follow them and prove the m=nm=n case, then obtain the cases we need from the characteristic function.
  • (b) Marginals. Every sub-vector of XX is multivariate normal, with the corresponding sub-vector of μ\mu and the corresponding sub-matrix of VV. In particular each Xi∼N(μi,vii)X_i \sim N(\mu_i, v_{ii}).
  • (c) Conditionals. Split XX, μ\mu and VV into blocks of sizes pp and q=n−pq = n-p, X=(X1X2),μ=(μ1μ2),V=(V11V12V21V22),V21=V12T.X = \begin{pmatrix}X_1\\X_2\end{pmatrix}, \quad \mu = \begin{pmatrix}\mu_1\\\mu_2\end{pmatrix}, \quad V = \begin{pmatrix}V_{11} & V_{12}\\ V_{21} & V_{22}\end{pmatrix}, \qquad V_{21}=V_{12}^{T} . Then, conditional on X2=x2X_2 = x_2, the vector X1X_1 is multivariate normal: X1∣{X2=x2}  ∼  N(  μ1+V12V22−1(x2−μ2),    V11−V12V22−1V21  ).X_1 \mid \{X_2 = x_2\} \;\sim\; N\Bigl(\;\mu_1 + V_{12}V_{22}^{-1}(x_2-\mu_2),\;\; V_{11} - V_{12}V_{22}^{-1}V_{21}\;\Bigr) . The conditional mean is affine in the observed x2x_2; the conditional covariance S=V11−V12V22−1V21S = V_{11}-V_{12}V_{22}^{-1}V_{21}, the Schur complement of V22V_{22} in VV, does not depend on x2x_2 at all. Hence, in the language of Conditional expectation, E(X1∣X2)=μ1+V12V22−1(X2−μ2),var⁡(X1∣X2)=S (a constant matrix),\mathbb{E}(X_1 \mid X_2) = \mu_1 + V_{12}V_{22}^{-1}(X_2-\mu_2), \qquad \operatorname{var}(X_1\mid X_2) = S \ \text{(a constant matrix)} , so for jointly normal variables the best mean-square predictor is already the best linear predictor.
  • (d) Independence equals zero correlation. X1X_1 and X2X_2 are independent if and only if V12=0V_{12} = 0. Componentwise: jointly normal variables are independent exactly when they are uncorrelated.
  • (e) Sampling. If CC is any n×nn\times n matrix with CCT=VCC^{T} = V and WW is standard multivariate normal, then μ+CW∼N(μ,V)\mu + CW \sim N(\mu, V). Such a CC is automatically invertible, since (det⁡C)2=det⁡V>0(\det C)^2 = \det V > 0. Two standard choices of CC are the symmetric square root of VV and the Cholesky factor. Grimmett and Stirzaker state the Cholesky version in their row convention: with LL lower triangular and V=L′LV = L'L, the row vector Z=μ+XLZ = \mu + XL is N(μ,V)N(\mu,V); transposing gives C=LTC = L^{T} here.
Idea of the proofOriginal

One change of variables does nearly everything. Because VV is real symmetric, the spectral theorem supplies an orthogonal QQ with V=QΛQTV = Q\Lambda Q^{T} and Λ=diag⁡(λ1,…,λn)\Lambda = \operatorname{diag}(\lambda_1,\dots,\lambda_n). Setting y=QT(x−μ)y = Q^{T}(x-\mu) rotates the quadratic form into ∑iyi2/λi\sum_i y_i^2/\lambda_i and leaves the volume element alone, because ∣det⁡Q∣=1\lvert\det Q\rvert = 1. The density then factorises into nn one-dimensional Gaussians with variances λi\lambda_i, and every statement about the general case becomes a statement about independent one-dimensional Gaussians: the normalising constant is a product of nn Gaussian integrals, the mean is 00 by symmetry, the covariance matrix is Λ\Lambda rotated back, and positive definiteness is exactly the condition that makes all nn integrals converge.

Conditioning needs a second, purely algebraic device. The matrix VV factorises as a product of a lower-triangular, a block-diagonal and an upper-triangular matrix - block Gaussian elimination - and reading the factorisation off in the exponent completes the square in x1x_1 with x2x_2 held fixed. What is left over is a quadratic form in x2x_2 alone, which cancels against the marginal density, and the determinant splits in the same way. The conditional law drops out with no integration at all.

Proof(Normalisation, mean and covariance)AdaptedAdapted from Grimmett & Stirzaker (2020), §4.9, the evaluation of $\int K\exp(-\tfrac12 Q)$ and the symmetry argument, p. 132; Riley, Hobson & Bence (2006), §30.15.2, the worked integral (30.149), p. 1210

Let VV be symmetric positive definite with eigenvalues λ1,…,λn>0\lambda_1,\dots,\lambda_n > 0. By the spectral theorem (Spectral theorem for Hermitian matrices) there is an orthogonal QQ with V=QΛQTV = Q\Lambda Q^{T}, Λ=diag⁡(λi)\Lambda = \operatorname{diag}(\lambda_i), whence V−1=QΛ−1QTV^{-1} = Q\Lambda^{-1}Q^{T} and det⁡V=λ1⋯λn\det V = \lambda_1\cdots\lambda_n.

Step 1: the integral. Substitute y=QT(x−μ)y = Q^{T}(x-\mu), so x=μ+Qyx = \mu + Qy. The Jacobian determinant is det⁡Q=±1\det Q = \pm1, so dx=dydx = dy. The exponent becomes

(x−μ)TV−1(x−μ)=yTQTQΛ−1QTQy=yTΛ−1y=∑i=1nyi2λi,(x-\mu)^{T}V^{-1}(x-\mu) = y^{T}Q^{T}Q\Lambda^{-1}Q^{T}Qy = y^{T}\Lambda^{-1}y = \sum_{i=1}^{n}\frac{y_i^2}{\lambda_i} ,

using QTQ=IQ^{T}Q = I. Hence the integral of exp⁡(−12(x−μ)TV−1(x−μ))\exp(-\tfrac12(x-\mu)^{T}V^{-1}(x-\mu)) over Rn\mathbb{R}^n factorises, and by the one-dimensional Gaussian integral (Gaussian integrals)

∫Rne−12∑iyi2/λi dy  =  ∏i=1n∫−∞∞e−yi2/(2λi) dyi  =  ∏i=1n2πλi  =  (2π)n/2(det⁡V)1/2.\int_{\mathbb{R}^n} e^{-\frac12\sum_i y_i^2/\lambda_i}\,dy \;=\; \prod_{i=1}^{n}\int_{-\infty}^{\infty} e^{-y_i^2/(2\lambda_i)}\,dy_i \;=\; \prod_{i=1}^{n}\sqrt{2\pi\lambda_i} \;=\; (2\pi)^{n/2}(\det V)^{1/2} .

So the stated constant makes ff integrate to 11. This is the step that needs positive definiteness: if some λi≤0\lambda_i \le 0 the corresponding factor diverges (for λi<0\lambda_i<0) or is undefined (for λi=0\lambda_i=0), and no constant can repair it.

Step 2: the mean. With Y=QT(X−μ)Y = Q^{T}(X-\mu), step 1 shows that the density of YY is ∏i(2πλi)−1/2e−yi2/2λi\prod_i (2\pi\lambda_i)^{-1/2}e^{-y_i^2/2\lambda_i}, a product of N(0,λi)N(0,\lambda_i) densities. So the YiY_i are independent, each with mean 00 and variance λi\lambda_i; each is integrable because a Gaussian has all moments. Hence E(Y)=0\mathbb{E}(Y) = 0 and, by linearity, E(X)=μ+Q E(Y)=μ\mathbb{E}(X) = \mu + Q\,\mathbb{E}(Y) = \mu. (Grimmett and Stirzaker reach the same conclusion from the symmetry f(x)=f(−x)f(x) = f(-x) of the centred density.)

Step 3: the covariance matrix. cov⁡(Y)=Λ\operatorname{cov}(Y) = \Lambda, since the YiY_i are independent with variances λi\lambda_i. Then X−μ=QYX - \mu = QY, and for any matrix AA and vector ZZ with mean 00, E(AZ(AZ)T)=A E(ZZT)AT\mathbb{E}(AZ(AZ)^{T}) = A\,\mathbb{E}(ZZ^{T})A^{T}. Therefore

E((X−μ)(X−μ)T)=QΛQT=V,\mathbb{E}\bigl((X-\mu)(X-\mu)^{T}\bigr) = Q\Lambda Q^{T} = V ,

that is cov⁡(Xi,Xj)=vij\operatorname{cov}(X_i,X_j) = v_{ij}.

Step 4: the transforms. For the moment generating function, complete the square. With u=x−μu = x-\mu,

tTx−12uTV−1u=tTμ+tTu−12uTV−1u=tTμ+12tTVt−12(u−Vt)TV−1(u−Vt),t^{T}x - \tfrac12 u^{T}V^{-1}u = t^{T}\mu + t^{T}u - \tfrac12 u^{T}V^{-1}u = t^{T}\mu + \tfrac12 t^{T}Vt - \tfrac12 (u - Vt)^{T}V^{-1}(u-Vt) ,

as expanding the last bracket confirms, using the symmetry of V−1V^{-1}. Integrating f(x)etTxf(x)e^{t^{T}x} over xx therefore leaves exp⁡(tTμ+12tTVt)\exp(t^{T}\mu + \tfrac12 t^{T}Vt) times the integral of a density centred at μ+Vt\mu + Vt, which is 11. This is the form Riley, Hobson and Bence (Riley, Hobson & Bence (2006), §30.15.2, p. 1209) obtain, with their A=V−1A = V^{-1}. The characteristic function follows by analytic continuation to imaginary argument, exactly as in the one-dimensional case (Characteristic functions); it is the result Grimmett and Stirzaker (Grimmett & Stirzaker (2020), §5.8, Example (5.8.6), pp. 209-210) obtain by this same rotation.

Step 5: the chi-squared statement. In the coordinates of step 1, (X−μ)TV−1(X−μ)=∑iYi2/λi(X-\mu)^{T}V^{-1}(X-\mu) = \sum_i Y_i^2/\lambda_i, and Yi/λiY_i/\sqrt{\lambda_i} are independent N(0,1)N(0,1). A sum of nn squared independent standard normals is χ2(n)\chi^2(n) by definition. □\square

Proof(Affine images, marginals, conditionals and independence)AdaptedAdapted from Grimmett & Stirzaker (2020), §4.9, proof of Theorem (4.9.6) for $m=n$, p. 133

(a) Affine images, invertible case. Let DD be n×nn\times n and invertible, Y=DTX+cY = D^{T}X + c. The map x↦y=DTx+cx \mapsto y = D^{T}x + c is a bijection of Rn\mathbb{R}^n with inverse x=(DT)−1(y−c)x = (D^{T})^{-1}(y-c) and Jacobian determinant ∣det⁡D∣−1\lvert\det D\rvert^{-1}, so by the change of variables formula (Multiple integrals and change of variables) the density of YY is f((DT)−1(y−c)) ∣det⁡D∣−1f\bigl((D^{T})^{-1}(y-c)\bigr)\,\lvert\det D\rvert^{-1}. Put W=DTVDW = D^{T}VD and ν=DTμ+c\nu = D^{T}\mu + c. Then W−1=D−1V−1(DT)−1W^{-1} = D^{-1}V^{-1}(D^{T})^{-1} and, with z=y−νz = y - \nu,

((DT)−1z)TV−1((DT)−1z)=zTD−1V−1(DT)−1z=zTW−1z,\bigl((D^{T})^{-1}z\bigr)^{T}V^{-1}\bigl((D^{T})^{-1}z\bigr) = z^{T}D^{-1}V^{-1}(D^{T})^{-1}z = z^{T}W^{-1}z ,

while det⁡W=(det⁡D)2det⁡V\det W = (\det D)^2\det V, so ∣det⁡D∣−1(det⁡V)−1/2=(det⁡W)−1/2\lvert\det D\rvert^{-1}(\det V)^{-1/2} = (\det W)^{-1/2}. The density of YY is therefore the N(ν,W)N(\nu, W) density. Positive definiteness of WW is inherited: uTWu=(Du)TV(Du)>0u^{T}Wu = (Du)^{T}V(Du) > 0 for u≠0u \ne 0 since DD is invertible.

(a) Affine images, general rank. For DD of rank m<nm < n, compute the characteristic function of Y=DTX+cY = D^{T}X + c directly from step 4 above: for s∈Rms \in \mathbb{R}^m,

φY(s)=E(eisT(DTX+c))=eisTc φX(Ds)=exp⁡(isT(DTμ+c)−12sTDTVDs),\varphi_Y(s) = \mathbb{E}\bigl(e^{is^{T}(D^{T}X+c)}\bigr) = e^{is^{T}c}\,\varphi_X(Ds) = \exp\Bigl(i s^{T}(D^{T}\mu + c) - \tfrac12 s^{T}D^{T}VDs\Bigr) ,

which is the characteristic function of N(DTμ+c, DTVD)N(D^{T}\mu + c,\, D^{T}VD); the matrix DTVDD^{T}VD is positive definite because Ds≠0Ds \ne 0 for s≠0s\ne0 when DD has rank mm. By the uniqueness half of the inversion theorem (Characteristic functions) the distributions agree. Grimmett and Stirzaker state this case without proof, referring to another text; the characteristic-function argument is the standard way to supply it.

(b) Marginals. Take DD in (a) to be the n×pn\times p matrix whose columns are the standard basis vectors ei1,…,eipe_{i_1},\dots,e_{i_p} of the chosen coordinates and c=0c=0. It has rank pp, DTμD^{T}\mu is the corresponding sub-vector of μ\mu, and DTVDD^{T}VD is the corresponding p×pp\times p sub-matrix of VV.

(c) Conditionals. Write u=x1−μ1u = x_1-\mu_1, v=x2−μ2v = x_2-\mu_2 and S=V11−V12V22−1V21S = V_{11}-V_{12}V_{22}^{-1}V_{21}. Block Gaussian elimination factorises VV as

V=(IV12V22−10I)(S00V22)(I0V22−1V21I),V = \begin{pmatrix} I & V_{12}V_{22}^{-1}\\ 0 & I\end{pmatrix} \begin{pmatrix} S & 0\\ 0 & V_{22}\end{pmatrix} \begin{pmatrix} I & 0\\ V_{22}^{-1}V_{21} & I\end{pmatrix} ,

as multiplying out confirms, the (1,1)(1,1) block being S+V12V22−1V21=V11S + V_{12}V_{22}^{-1}V_{21} = V_{11}. Two consequences follow at once, because the outer factors are triangular with unit diagonal and so have determinant 11 and easily inverted:

det⁡V=det⁡S⋅det⁡V22,V−1=(I0−V22−1V21I)(S−100V22−1)(I−V12V22−10I).\det V = \det S \cdot \det V_{22} , \qquad V^{-1} = \begin{pmatrix} I & 0\\ -V_{22}^{-1}V_{21} & I\end{pmatrix} \begin{pmatrix} S^{-1} & 0\\ 0 & V_{22}^{-1}\end{pmatrix} \begin{pmatrix} I & -V_{12}V_{22}^{-1}\\ 0 & I\end{pmatrix} .

Applying the second display to (u,v)(u,v) and writing w=u−V12V22−1vw = u - V_{12}V_{22}^{-1}v gives the completed square

(x−μ)TV−1(x−μ)  =  wTS−1w  +  vTV22−1v.(x-\mu)^{T}V^{-1}(x-\mu) \;=\; w^{T}S^{-1}w \;+\; v^{T}V_{22}^{-1}v .

(SS is positive definite: it is the inverse of the top-left block of V−1V^{-1}, which is positive definite because VV is.) The marginal density of X2X_2 is the N(μ2,V22)N(\mu_2, V_{22}) density, by (b). Dividing, and using det⁡V=det⁡Sdet⁡V22\det V = \det S\det V_{22} to split the constant,

fX1∣X2(x1∣x2)=f(x)fX2(x2)=1(2π)p/2(det⁡S)1/2exp⁡(−12wTS−1w),f_{X_1\mid X_2}(x_1\mid x_2) = \frac{f(x)}{f_{X_2}(x_2)} = \frac{1}{(2\pi)^{p/2}(\det S)^{1/2}}\exp\bigl(-\tfrac12 w^{T}S^{-1}w\bigr) ,

which is the N(μ1+V12V22−1(x2−μ2), S)N(\mu_1 + V_{12}V_{22}^{-1}(x_2-\mu_2),\,S) density, since w=x1−(μ1+V12V22−1(x2−μ2))w = x_1 - \bigl(\mu_1+V_{12}V_{22}^{-1}(x_2-\mu_2)\bigr). No integration was performed: the whole content is the factorisation of VV.

(d) Independence. If V12=0V_{12}=0 then S=V11S = V_{11} and the conditional density of X1X_1 given X2=x2X_2=x_2 does not depend on x2x_2, so f=fX1fX2f = f_{X_1}f_{X_2} and the blocks are independent. Conversely independent blocks have cov⁡(X1i,X2j)=0\operatorname{cov}(X_{1i},X_{2j})=0, which is V12=0V_{12}=0.

(e) Sampling. If W∼N(0,I)W \sim N(0,I) and CCT=VCC^{T}=V then μ+CW\mu + CW has mean μ\mu and covariance CICT=VC I C^{T} = V. Taking determinants in CCT=VCC^{T}=V gives (det⁡C)2=det⁡V(\det C)^2 = \det V, which is strictly positive because VV is positive definite, so CC is invertible and (a) applies with DT=CD^{T} = C: the law is N(μ,V)N(\mu, V). (If VV is only non-negative definite, CC may be singular and (a) no longer applies, but μ+CW\mu+CW is still multivariate normal in the linear-combination sense, since aT(μ+CW)=aTμ+(CTa)TWa^{T}(\mu+CW) = a^{T}\mu + (C^{T}a)^{T}W is univariate normal for every aa.) □\square

Remark(Where the hypotheses are used, and the trap of marginal normality)Original
  • Positive definiteness is needed for the density and nowhere else. It enters exactly once, in step 1, to make the nn Gaussian integrals converge; everything downstream inherits it. Merely non-negative definite VV still defines a perfectly good distribution through the characteristic function exp⁡(itTμ−12tTVt)\exp(it^{T}\mu - \tfrac12 t^{T}Vt), but that distribution is concentrated on an affine subspace of dimension rank⁡V\operatorname{rank}V and has no density on Rn\mathbb{R}^n. The simplest instance is X2=X1X_2 = X_1 with X1∼N(0,1)X_1\sim N(0,1): the law of (X1,X2)(X_1,X_2) sits on a line, V=(1111)V = \begin{pmatrix}1&1\\1&1\end{pmatrix} is singular, and det⁡V=0\det V = 0 kills the normalising constant.
  • Invertibility of V22V_{22}, not of VV, is what conditioning needs. The factorisation in (c) uses V22−1V_{22}^{-1} and nothing else. If the conditioning block is itself degenerate, the observed coordinates carry a deterministic relation and one of them must be dropped before conditioning.
  • Jointly normal is strictly stronger than marginally normal. Grimmett and Stirzaker (Grimmett & Stirzaker (2020), §4.9, Exercise (4.9.5), pp. 134-135) set this exercise: let X∼N(0,1)X \sim N(0,1), fix a>0a>0, and let Y=XY = X when ∣X∣<a\lvert X\rvert < a and Y=−XY = -X when ∣X∣≥a\lvert X\rvert \ge a. Then YY is again N(0,1)N(0,1), since the transformation reflects a symmetric density about the origin on part of its range; yet ∣Y∣=∣X∣\lvert Y\rvert = \lvert X\rvert always, so the pair is confined to two lines and has no bivariate normal density. Their ρ(a)=cov⁡(X,Y)\rho(a) = \operatorname{cov}(X,Y) runs continuously from −1-1 (at a=0a=0, where Y=−XY=-X) to +1+1 (as a→∞a\to\infty, where Y=XY=X), so some intermediate aa makes XX and YY uncorrelated while they remain completely dependent. Statement (d) is therefore about jointly normal variables and collapses without that hypothesis.
  • Normality of every linear combination is the right hypothesis, and pairwise checks do not suffice. Verifying that X1X_1, X2X_2 and X1+X2X_1+X_2 are each normal does not make (X1,X2)(X_1,X_2) bivariate normal; the definition quantifies over all aa, and the example above fails it at a=(1,1)Ta=(1,1)^{T} or a=(1,−1)Ta=(1,-1)^{T} depending on the cut-off.
  • The conditional covariance being constant is special to the normal family. For a general joint law var⁡(Y∣X)\operatorname{var}(Y\mid X) depends on XX, and the best predictor is a curve rather than a line. Here both degeneracies happen at once, which is precisely why least-squares linear regression is exactly optimal under a normal model and only approximately so otherwise.
  • A check on the conditional formula. For the standard trivariate normal with unit variances and correlations ρ1=ρ(X,Y)\rho_1 = \rho(X,Y), ρ2=ρ(Y,Z)\rho_2 = \rho(Y,Z), ρ3=ρ(Z,X)\rho_3 = \rho(Z,X), statement (c) with X1=ZX_1 = Z and X2=(X,Y)TX_2 = (X,Y)^{T} gives V12=(ρ3,ρ2)V_{12} = (\rho_3,\rho_2) and V22−1=(1−ρ12)−1(1−ρ1−ρ11)V_{22}^{-1} = (1-\rho_1^2)^{-1}\begin{pmatrix}1&-\rho_1\\-\rho_1&1\end{pmatrix}, hence E(Z∣X,Y)=(ρ3−ρ1ρ2)X+(ρ2−ρ1ρ3)Y1−ρ12,var⁡(Z∣X,Y)=1−ρ12−ρ22−ρ32+2ρ1ρ2ρ31−ρ12,\mathbb{E}(Z\mid X,Y) = \frac{(\rho_3-\rho_1\rho_2)X + (\rho_2-\rho_1\rho_3)Y}{1-\rho_1^2}, \quad \operatorname{var}(Z\mid X,Y) = \frac{1-\rho_1^2-\rho_2^2-\rho_3^2+2\rho_1\rho_2\rho_3}{1-\rho_1^2} , which is exactly what Grimmett and Stirzaker (Grimmett & Stirzaker (2020), §4.9, Exercise (4.9.9), p. 135) ask the reader to show. Their ρ2\rho_2 and ρ3\rho_3 are labelled cyclically, as that agreement fixes. The bivariate case p=q=1p=q=1 with unit variances reduces to E(Y∣X)=ρX\mathbb{E}(Y\mid X) = \rho X and var⁡(Y∣X)=1−ρ2\operatorname{var}(Y\mid X) = 1-\rho^2, which is their Example (4.6.7) (Grimmett & Stirzaker (2020), §4.6, Example (4.6.7), p. 119).
Method(Working with a multivariate normal)Original
  1. Write down μ\mu and VV, and check VV. It must be symmetric; it must be positive definite if a density is wanted. Cheap checks: every diagonal entry positive, every 2×22\times2 principal minor positive, det⁡V>0\det V > 0. A full check is Sylvester's criterion or a Cholesky factorisation, which fails exactly when VV is not positive definite (Quadratic forms and the Rayleigh quotient).
  2. Reduce to the standard case when you need an integral. Either rotate, Y=QT(X−μ)Y = Q^{T}(X-\mu) with QQ from the spectral theorem, or whiten, W=C−1(X−μ)W = C^{-1}(X-\mu) with CCT=VCC^{T}=V. Both turn the problem into one about independent N(0,1)N(0,1) variables.
  3. For any linear function, do not integrate. Read the answer off (a): DTX+cD^{T}X+c is normal with mean DTμ+cD^{T}\mu+c and covariance DTVDD^{T}VD. Sums, differences, averages and projections are all of this form.
  4. For a marginal, delete rows and columns. Keep the entries of μ\mu and VV belonging to the coordinates retained; discard the rest. No integration.
  5. For a conditional, use the Schur complement. Order the coordinates so that the observed ones come last, form S=V11−V12V22−1V21S = V_{11}-V_{12}V_{22}^{-1}V_{21}, and read off the conditional mean μ1+V12V22−1(x2−μ2)\mu_1 + V_{12}V_{22}^{-1}(x_2-\mu_2) and covariance SS.
  6. Check. Three identities cost nothing and catch most errors: det⁡V=det⁡S⋅det⁡V22\det V = \det S\cdot\det V_{22}; the conditional variance of any coordinate must be no larger than its unconditional variance; and setting V12=0V_{12}=0 must return the marginal.
  7. To simulate, factor once. Compute the Cholesky factor CC with CCT=VCC^{T}=V once, then each sample is μ+CW\mu + CW with WW a fresh vector of independent standard normals.
Example(A three-dimensional normal: marginal, conditional and a tail probability)Original

Take n=3n=3 with

μ=(1−12),V=(421231112).\mu = \begin{pmatrix}1\\-1\\2\end{pmatrix}, \qquad V = \begin{pmatrix}4 & 2 & 1\\ 2 & 3 & 1\\ 1 & 1 & 2\end{pmatrix} .

Step 1: is VV a legitimate covariance matrix? It is symmetric. Its leading principal minors are 4>04 > 0, det⁡(4223)=8>0\det\begin{pmatrix}4&2\\2&3\end{pmatrix} = 8 > 0 and

det⁡V=4(3⋅2−1⋅1)−2(2⋅2−1⋅1)+1(2⋅1−3⋅1)=20−6−1=13>0,\det V = 4(3\cdot2 - 1\cdot1) - 2(2\cdot2-1\cdot1) + 1(2\cdot1-3\cdot1) = 20 - 6 - 1 = 13 > 0 ,

so VV is positive definite by Sylvester's criterion. (Numerically its eigenvalues are 1.307981.30798, 1.643101.64310, 6.048926.04892; they sum to 9=tr⁡V9 = \operatorname{tr}V and multiply to 13=det⁡V13 = \det V, two checks at once.) Hence X∼N(μ,V)X \sim N(\mu,V) has the density of the definition, with normalising constant (2π)−3/213−1/2=0.0176100(2\pi)^{-3/2}13^{-1/2} = 0.0176100.

Step 2: a marginal. By (b), (X1,X2)T∼N ⁣((1−1),(4223))(X_1,X_2)^{T} \sim N\!\left(\begin{pmatrix}1\\-1\end{pmatrix}, \begin{pmatrix}4&2\\2&3\end{pmatrix}\right), so X1∼N(1,4)X_1\sim N(1,4), X2∼N(−1,3)X_2\sim N(-1,3) and ρ(X1,X2)=2/4⋅3=1/3=0.57735\rho(X_1,X_2) = 2/\sqrt{4\cdot3} = 1/\sqrt3 = 0.57735.

Step 3: condition X1X_1 on the other two. Take p=1p=1, q=2q=2, so

V11=(4),V12=(2  1),V22=(3112),det⁡V22=5,V22−1=15(2−1−13).V_{11} = (4), \qquad V_{12} = (2\ \ 1), \qquad V_{22} = \begin{pmatrix}3&1\\1&2\end{pmatrix}, \qquad \det V_{22} = 5, \qquad V_{22}^{-1} = \frac15\begin{pmatrix}2&-1\\-1&3\end{pmatrix}.

Then

V12V22−1=15 (2  1)(2−1−13)=15 (3  1),V_{12}V_{22}^{-1} = \frac15\,(2\ \ 1)\begin{pmatrix}2&-1\\-1&3\end{pmatrix} = \frac15\,(3\ \ 1) ,

and the Schur complement is

S=V11−V12V22−1V21=4−15(3  1)(21)=4−75=135=2.6.S = V_{11} - V_{12}V_{22}^{-1}V_{21} = 4 - \frac15(3\ \ 1)\begin{pmatrix}2\\1\end{pmatrix} = 4 - \frac{7}{5} = \frac{13}{5} = 2.6 .

Observe x2=(0,3)Tx_2 = (0,3)^{T}, so x2−μ2=(1,1)Tx_2 - \mu_2 = (1,1)^{T} and the conditional mean is

μ1+V12V22−1(x2−μ2)=1+15(3+1)=95=1.8.\mu_1 + V_{12}V_{22}^{-1}(x_2-\mu_2) = 1 + \frac15(3+1) = \frac95 = 1.8 .

Therefore

 X1∣{X2=0, X3=3} ∼ N ⁣(95, 135).\boxed{\,X_1 \mid \{X_2 = 0,\ X_3 = 3\} \ \sim\ N\!\left(\tfrac95,\ \tfrac{13}{5}\right).}

Step 4: the checks. The determinant identity holds: det⁡S⋅det⁡V22=135⋅5=13=det⁡V\det S\cdot\det V_{22} = \tfrac{13}{5}\cdot 5 = 13 = \det V. The conditional variance 2.62.6 is smaller than the unconditional variance 44, as observing correlated coordinates must make it. And the conditional mean has moved up from 11 to 1.81.8, consistent with X2X_2 and X3X_3 both having been observed above their means while both covariances with X1X_1 are positive. A Monte Carlo run of 4×1064\times10^{6} draws, keeping those with X2X_2 and X3X_3 within 0.050.05 of the conditioning values, gave a sample mean 1.8191.819 and sample variance 2.6852.685 from 21062106 retained draws, agreeing with 1.81.8 and 2.62.6 to within the sampling error.

Step 5: a probability. With the conditional law in hand,

P(X1≤3∣X2=0,X3=3)=Φ ⁣(3−9/513/5)=Φ(0.744208)=0.771625.\mathbb{P}\bigl(X_1 \le 3 \mid X_2 = 0, X_3 = 3\bigr) = \Phi\!\left(\frac{3 - 9/5}{\sqrt{13/5}}\right) = \Phi(0.744208) = 0.771625 .

The unconditional answer is Φ((3−1)/2)=Φ(1)=0.841345\Phi((3-1)/2) = \Phi(1) = 0.841345. Conditioning has therefore made the value 33 less surprising, not more: the upper tail P(X1>3)\mathbb{P}(X_1 > 3) rises from 0.1586550.158655 to 0.2283750.228375, and the standardised distance from the centre falls from z=1z = 1 to z=0.744208z = 0.744208. Two effects compete, and the one that wins is the shift of the centre. Observing X2X_2 and X3X_3 above their means pulls the mean of X1X_1 up from 11 to 1.81.8, which moves 33 closer; it also shrinks the standard deviation from 22 to 13/5=1.612452\sqrt{13/5} = 1.612452, which on its own would move 33 further away in units of the spread. The break-even point is the conditional mean that would leave zz at 11 with the new spread, namely 3−1.612452=1.3875483 - 1.612452 = 1.387548; the actual conditional mean 1.81.8 is larger than that, so the mean shift dominates. All numerical values here were computed and cross-checked symbolically.

Application(Error ellipses, least squares, Gaussian fields and filters)Original

Error matrices and confidence regions. A fit reports parameters θ^\hat\theta with a covariance matrix VV, and the standard interpretation is that θ^\hat\theta is approximately N(θ,V)N(\theta, V). Statement 4 above then says that (θ^−θ)TV−1(θ^−θ)(\hat\theta-\theta)^{T}V^{-1}(\hat\theta-\theta) is χ2(n)\chi^2(n), which is where contours of constant Δχ2\Delta\chi^2 as confidence regions come from: the 1σ1\sigma, 2σ2\sigma ellipsoids are level sets of the quadratic form, with axes along the eigenvectors of VV and semi-axes proportional to λi\sqrt{\lambda_i}. Marginalising a parameter away is statement (b) - delete its row and column - while fixing it is statement (c), and the two give different error bars on the remaining parameters, the conditional one always smaller. Confusing the two is a common source of understated uncertainties.

Linear least squares. With normal errors, the maximum-likelihood estimate minimises a quadratic form and is itself a linear function of the data, hence normal by (a); its covariance matrix is the usual (ATΣ−1A)−1(A^{T}\Sigma^{-1}A)^{-1}. Statement (c) is the reason linear regression is optimal and not merely convenient in this setting.

Gaussian random fields. A field ϕ(x)\phi(x) whose finite-dimensional distributions are multivariate normal is specified completely by a mean function and a two-point correlation function; this is the standard model for the cosmic microwave background, for turbulence at fixed scale, and for the Gaussian free field. Conditioning on measurements at some points to predict the field elsewhere is statement (c) applied to the covariance kernel - in geostatistics and machine learning the same formula is called kriging, or Gaussian process regression.

Kalman filtering and data assimilation. Because a normal prior through a linear model with normal noise gives a normal posterior, the entire filtering recursion reduces to updating a mean vector and a covariance matrix by statements (a) and (c). This is why the Kalman filter is finite-dimensional while general nonlinear filtering is not.

Equilibrium statistical mechanics. A system of harmonic degrees of freedom at temperature TT has Boltzmann weight exp⁡(−12qTKq/kBT)\exp(-\tfrac12 q^{T}Kq/k_BT), which is exactly the N(0,kBT K−1)N(0, k_BT\,K^{-1}) density. Equipartition, the fluctuation-dissipation relation between the response matrix K−1K^{-1} and the covariance of the displacements, and normal-mode decomposition are statements 2, 3 and the rotation of step 1 respectively. The Ornstein-Uhlenbeck process of Stochastic differential equations has multivariate normal finite-dimensional laws for the same reason.

Generating and characteristic functions

2

Method

Generating functions

Adapted

Encodes a distribution in its probability, moment and cumulant generating functions, turns convolution into multiplication and random sums into composition, and applies the composition rule to branching processes, extracting the extinction probability 1/21/2 for a worked offspring law.

Prerequisites: Expectation, variance and covariance, Random variables and distributions, Conditional expectation, Power series

Note(What a generating function buys)Original

A distribution on {0,1,2,… }\{0,1,2,\dots\} is an infinite list of numbers. Packing that list into the coefficients of a power series replaces three awkward operations by three easy ones:

operation on distributions operation on generating functions
convolution (adding independent variables) multiplication
summing a random number of copies composition
extracting moments differentiating at one point

The third is a convenience. The first two are the reason the method exists: a convolution is a sum over all the ways a total can be split, and a power series multiplies by doing exactly that bookkeeping. Everything in this unit, including the entire theory of branching processes, follows from those two lines of the table.

Three transforms are in use, and the difference between them is only a change of variable. The probability generating function G(s)=E(sX)G(s)=\mathbb{E}(s^{X}) handles variables on the non-negative integers. The moment generating function M(t)=E(etX)M(t)=\mathbb{E}(e^{tX}), obtained by putting s=ets=e^{t}, handles any variable but may be infinite. The characteristic function φ(t)=E(eitX)\varphi(t)=\mathbb{E}(e^{itX}), which exists always, is the subject of Characteristic functions.

Definition(The three generating functions)AdaptedAdapted from Grimmett & Stirzaker (2020), §5.1, Definition (5.1.10) and the change of variable at eq. (5.1.21), pp. 170, 172, and §5.7, Definition (5.7.1), p. 203; Riley, Hobson & Bence (2006), §30.7.1, eq. (30.71), p. 1158, §30.7.2, eq. (30.85), p. 1162, and §30.7.4, eq. (30.92), p. 1166; Arfken, Weber & Harris (2013), §23.2, eq. (23.32), p. 1141

Let XX be a random variable with mass function ff or density ff.

Probability generating function. If XX takes values in {0,1,2,… }\{0,1,2,\dots\}, its probability generating function is

GX(s)  =  E(sX)  =  ∑n=0∞sn P(X=n).G_X(s) \;=\; \mathbb{E}\bigl(s^{X}\bigr) \;=\; \sum_{n=0}^{\infty} s^{n}\,\mathbb{P}(X = n) .

The series has non-negative coefficients summing to 11, so it converges absolutely for ∣s∣≤1\lvert s\rvert \le 1 at least; its radius of convergence RR satisfies R≥1R \ge 1. Riley, Hobson and Bence write it ΦX(t)\Phi_X(t) and Grimmett and Stirzaker GX(s)G_X(s); the object is the same.

Moment generating function. For any real random variable,

MX(t)  =  E(etX)  =  {∑ietxif(xi)(discrete),∫−∞∞etxf(x) dx(continuous),M_X(t) \;=\; \mathbb{E}\bigl(e^{tX}\bigr) \;=\; \begin{cases} \sum_i e^{tx_i} f(x_i) & \text{(discrete)},\\ \int_{-\infty}^{\infty} e^{tx} f(x)\,dx & \text{(continuous)}, \end{cases}

defined at those real tt for which the sum or integral is finite. Always MX(0)=1M_X(0)=1. Where both exist, MX(t)=GX(et)M_X(t) = G_X(e^{t}). Physicists write MX(t)=⟨etX⟩M_X(t) = \langle e^{tX}\rangle, as Arfken, Weber and Harris (Arfken, Weber & Harris (2013), §23.2, eq. (23.32), p. 1141) do. Grimmett and Stirzaker note that MXM_X is a Laplace transform of the distribution up to the sign of the exponent: the usual Laplace transform of a density carries e−txe^{-tx}, this one carries e+txe^{+tx}.

Cumulant generating function. Wherever MXM_X is finite and positive on a neighbourhood of the origin,

KX(t)  =  log⁡MX(t)  =  κ1t+κ2t22!+κ3t33!+⋯ ,K_X(t) \;=\; \log M_X(t) \;=\; \kappa_1 t + \kappa_2\frac{t^2}{2!} + \kappa_3\frac{t^3}{3!} + \cdots ,

and the coefficients κk\kappa_k are the cumulants of XX. There is no constant term because MX(0)=1M_X(0)=1.

Joint generating functions. For two variables on the non-negative integers, GX1,X2(s1,s2)=E(s1X1s2X2)G_{X_1,X_2}(s_1,s_2) = \mathbb{E}\bigl(s_1^{X_1}s_2^{X_2}\bigr), and likewise MX1,X2(t1,t2)=E(et1X1+t2X2)M_{X_1,X_2}(t_1,t_2) = \mathbb{E}\bigl(e^{t_1X_1+t_2X_2}\bigr) for general variables.

Method(The rules)AdaptedAdapted from Grimmett & Stirzaker (2020), §5.1, eq. (5.1.16), Theorem (5.1.18) with eq. (5.1.19), the uniqueness statement (5.1.13)-(5.1.14), Theorems (5.1.23), (5.1.25) and (5.1.29), pp. 170-174, and §5.7, properties (a)-(c) and Remark (5.7.10), pp. 203, 206; Riley, Hobson & Bence (2006), §30.7.1, eqs. (30.74)-(30.76) and (30.80)-(30.84), pp. 1158-1162, and §30.7.2, eqs. (30.86)-(30.90), pp. 1163-1164

Let XX, YY be random variables and let a,ba,b be real constants.

For probability generating functions (X,YX,Y on the non-negative integers):

  1. Boundary values. GX(0)=P(X=0)G_X(0) = \mathbb{P}(X=0) and GX(1)=1G_X(1) = 1.
  2. Recovery. P(X=n)=GX(n)(0)/n!\mathbb{P}(X=n) = G_X^{(n)}(0)/n!. In particular GXG_X determines the distribution: two variables with the same probability generating function on some interval (−R′,R′)(-R',R') with R′>0R'>0 have the same mass function.
  3. Factorial moments. E(X(X−1)⋯(X−k+1))=GX(k)(1)\mathbb{E}\bigl(X(X-1)\cdots(X-k+1)\bigr) = G_X^{(k)}(1), where G(k)(1)G^{(k)}(1) means lim⁡s↑1G(k)(s)\lim_{s\uparrow1}G^{(k)}(s) when the radius of convergence is exactly 11. Hence E(X)=GX′(1),var⁡(X)=GX′′(1)+GX′(1)−GX′(1)2.\mathbb{E}(X) = G_X'(1), \qquad \operatorname{var}(X) = G_X''(1) + G_X'(1) - G_X'(1)^2 .
  4. Sums. If XX and YY are independent then GX+Y(s)=GX(s) GY(s)G_{X+Y}(s) = G_X(s)\,G_Y(s); for nn independent summands the generating functions multiply, and for nn independent copies of one variable GSn=(GX)nG_{S_n} = (G_X)^{n}.
  5. Random sums. Let X1,X2,…X_1,X_2,\dots be independent, identically distributed with common generating function GXG_X, and let N≥0N \ge 0 be an integer-valued random variable independent of all the XiX_i, with generating function GNG_N. Then S=X1+⋯+XNS = X_1 + \cdots + X_N (an empty sum being 00) has GS(s)  =  GN(GX(s)).G_S(s) \;=\; G_N\bigl(G_X(s)\bigr) . Grimmett and Stirzaker record the mnemonic that fixes the order of composition: if N≡nN \equiv n is constant then GN(s)=snG_N(s)=s^{n} and the formula returns GX(s)nG_X(s)^{n}, as rule 4 demands.
  6. Independence. The factorisation GX1,X2(s1,s2)=GX1(s1) GX2(s2)G_{X_1,X_2}(s_1,s_2) = G_{X_1}(s_1)\,G_{X_2}(s_2), holding at every pair (s1,s2)(s_1,s_2), is equivalent to independence of X1X_1 and X2X_2 - not merely implied by it.
  7. Defective variables. If P(X=∞)>0\mathbb{P}(X=\infty) > 0 then GX(s)=E(sX)G_X(s) = \mathbb{E}(s^{X}) still converges for ∣s∣<1\lvert s\rvert<1 and lim⁡s↑1GX(s)=1−P(X=∞)<1\lim_{s\uparrow1}G_X(s) = 1 - \mathbb{P}(X=\infty) < 1. A probability generating function with G(1−)<1G(1^-)<1 is the signature of a defective distribution.

For moment generating functions (any real XX, wherever the functions are finite):

  1. Moments. If MXM_X is finite on an open interval containing 00, then all moments exist, MXM_X has the convergent expansion MX(t)=∑k≥0E(Xk)tk/k!M_X(t) = \sum_{k\ge0}\mathbb{E}(X^{k})t^{k}/k! there, and E(Xk)=MX(k)(0)\mathbb{E}(X^{k}) = M_X^{(k)}(0); in particular var⁡(X)=MX′′(0)−MX′(0)2\operatorname{var}(X) = M_X''(0) - M_X'(0)^2.
  2. Affine changes. MaX+b(t)=ebtMX(at)M_{aX+b}(t) = e^{bt}M_X(at). Taking b=−μb=-\mu with μ=EX\mu = \mathbb{E}X produces the generator of the moments about the mean.
  3. Sums. If X1,…,XmX_1,\dots,X_m are independent, with mm a fixed integer, then M∑i≤mciXi(t)=∏i≤mMXi(cit)M_{\sum_{i\le m} c_iX_i}(t) = \prod_{i\le m} M_{X_i}(c_it). For a random number of summands, with NN and the identically distributed XiX_i as in rule 5, MS(t)=GN(MX(t))M_S(t) = G_N\bigl(M_X(t)\bigr).
  4. Cumulants. KX+Y=KX+KYK_{X+Y} = K_X + K_Y for independent X,YX,Y, and κ1=E(X)\kappa_1 = \mathbb{E}(X), κ2=var⁡(X)\kappa_2 = \operatorname{var}(X). For X∼N(μ,σ2)X\sim N(\mu,\sigma^2), KX(t)=μt+12σ2t2K_X(t) = \mu t + \tfrac12\sigma^2t^2, so κ1=μ\kappa_1=\mu, κ2=σ2\kappa_2=\sigma^2, and every cumulant from the third on vanishes.
  5. Uniqueness, with a caveat. If MX=MYM_X = M_Y and both are finite on a neighbourhood of 00, then XX and YY have the same distribution. Riley, Hobson and Bence state this and say a rigorous proof lies outside their scope. Grimmett and Stirzaker add the warning that the moments alone do not always determine a distribution: there exist distinct distribution functions all of whose moments agree, the standard example being built from the log-normal. Finiteness of MM near the origin is their simplest sufficient condition for a distribution to be determined by its moments.
Method(Branching processes)AdaptedAdapted from Grimmett & Stirzaker (2020), §5.4, the modelling assumptions (a)-(b), Theorem (5.4.1), Lemma (5.4.2) and Theorem (5.4.5), pp. 192-195

A branching process is a population in which each individual, independently of all others, produces a random number of offspring with a common mass function ff and probability generating function GG. Write ZnZ_n for how many individuals generation nn contains, take Z0=1Z_0 = 1, and put Gn(s)=E(sZn)G_n(s) = \mathbb{E}(s^{Z_n}), μ=E(Z1)=G′(1)\mu = \mathbb{E}(Z_1) = G'(1) and σ2=var⁡(Z1)\sigma^2 = \operatorname{var}(Z_1).

  1. Iteration. Gm+n(s)=Gm(Gn(s))G_{m+n}(s) = G_m\bigl(G_n(s)\bigr), so GnG_n is the nn-fold composite of GG with itself and G1=GG_1 = G.
  2. Moments. E(Zn)=μn,var⁡(Zn)={nσ2,μ=1,σ2(μn−1)μn−1μ−1,μ≠1.\mathbb{E}(Z_n) = \mu^{n}, \qquad \operatorname{var}(Z_n) = \begin{cases} n\sigma^{2}, & \mu = 1,\\[1ex] \dfrac{\sigma^{2}(\mu^{n}-1)\mu^{n-1}}{\mu-1}, & \mu \ne 1. \end{cases}
  3. Extinction. As n→∞n\to\infty, P(Zn=0)\mathbb{P}(Z_n = 0) increases to the probability η\eta of ultimate extinction, and η\eta is the smallest non-negative root of s=G(s)s = G(s). Moreover η=1\eta = 1 if μ<1\mu < 1, η<1\eta < 1 if μ>1\mu > 1, and in the critical case μ=1\mu = 1 extinction is certain, η=1\eta=1, so long as the offspring law is not concentrated at a single value, that is, so long as σ2>0\sigma^{2}>0.
Idea of the proofOriginal

Why a product? Expanding GX(s)GY(s)G_X(s)G_Y(s) and collecting the coefficient of sns^{n} gives ∑kP(X=k)P(Y=n−k)\sum_{k} \mathbb{P}(X=k)\mathbb{P}(Y=n-k), which is precisely the number of ways X+YX+Y can equal nn weighted by their probabilities - the convolution. The power series does the sum over splittings automatically, because that is what multiplying polynomials means. Equivalently and more quickly: sXs^{X} and sYs^{Y} are independent when XX and YY are, so the expectation of their product factorises.

Why a composition? For a random sum, condition on NN. Given N=nN=n the sum has generating function GX(s)nG_X(s)^{n}, so averaging over nn gives ∑nGX(s)nP(N=n)\sum_n G_X(s)^{n}\mathbb{P}(N=n) - and that sum is GNG_N evaluated at the number GX(s)G_X(s). Substituting a generating function into a generating function is the same operation as randomising the number of terms.

Branching processes are then immediate: generation n+mn+m is a random sum over the individuals of generation mm, each contributing an independent copy of an nn-generation descendant count, so generation sizes compose. Extinction is the fixed point of that composition, and the geometry of a convex increasing curve meeting the diagonal decides whether the fixed point is 11 or something smaller - which is why the mean family size μ=G′(1)\mu = G'(1), the slope at the diagonal point s=1s=1, is what separates the cases.

Proof(The rules)AdaptedAdapted from Grimmett & Stirzaker (2020), §5.1, the convolution computation (5.1.6), the proof of Theorem (5.1.18) by Abel's theorem, eq. (5.1.19), and the proofs of Theorems (5.1.23) and (5.1.25), pp. 169-174; Riley, Hobson & Bence (2006), §30.7.1, eqs. (30.74)-(30.76), p. 1158

Rules 1 and 2. Setting s=0s=0 in the series leaves the constant term, P(X=0)\mathbb{P}(X=0); setting s=1s=1 sums the mass function, giving 11. Rule 2 is the standard uniqueness statement for power series: inside the disc of convergence a power series may be differentiated term by term any number of times, and evaluating the nnth derivative at 00 kills every term but one (Power series).

Rule 3. For ∣s∣<1\lvert s\rvert < 1, differentiating kk times term by term,

GX(k)(s)  =  ∑i≥ki(i−1)⋯(i−k+1) s i−k P(X=i).G_X^{(k)}(s) \;=\; \sum_{i \ge k} i(i-1)\cdots(i-k+1)\, s^{\,i-k}\, \mathbb{P}(X=i) .

Every coefficient here is non-negative, so Abel's theorem applies: as s↑1s \uparrow 1 the sum tends to ∑ii(i−1)⋯(i−k+1)P(X=i)\sum_i i(i-1)\cdots(i-k+1)\mathbb{P}(X=i), whether that is finite or +∞+\infty. That sum is E(X(X−1)⋯(X−k+1))\mathbb{E}(X(X-1)\cdots(X-k+1)) by the law of the unconscious statistician (Expectation, variance and covariance). Abel's theorem is exactly what is needed here, because when R=1R=1 one has no right to evaluate the series at the endpoint without it. For the variance, take k=1,2k=1,2:

var⁡(X)=E(X2)−E(X)2=E(X(X−1))+E(X)−E(X)2=G′′(1)+G′(1)−G′(1)2.\operatorname{var}(X) = \mathbb{E}(X^2)-\mathbb{E}(X)^2 = \mathbb{E}\bigl(X(X-1)\bigr) + \mathbb{E}(X) - \mathbb{E}(X)^2 = G''(1)+G'(1)-G'(1)^2 .

Rule 4. If XX and YY are independent then so are the random variables sXs^{X} and sYs^{Y}, being functions of independent variables, and the expectation of a product of independent variables is the product of the expectations:

GX+Y(s)=E(sX+Y)=E(sXsY)=E(sX) E(sY).G_{X+Y}(s) = \mathbb{E}\bigl(s^{X+Y}\bigr) = \mathbb{E}\bigl(s^{X}s^{Y}\bigr) = \mathbb{E}(s^{X})\,\mathbb{E}(s^{Y}) .

The same conclusion comes from multiplying the two series and recognising the coefficient of sns^{n} as the convolution ∑k=0nP(X=k)P(Y=n−k)\sum_{k=0}^{n}\mathbb{P}(X=k)\mathbb{P}(Y=n-k), which is P(X+Y=n)\mathbb{P}(X+Y=n); Riley, Hobson and Bence present the argument in that order, justifying the interchange of the two summations by the geometry of the index set. Independence is used once and is indispensable: see the remark.

Rule 5. Condition on NN and use the tower property (Conditional expectation):

GS(s)=E(sS)=E(E(sS  ∣  N))=∑n≥0E(sX1+⋯+Xn)P(N=n),G_S(s) = \mathbb{E}\bigl(s^{S}\bigr) = \mathbb{E}\Bigl(\mathbb{E}\bigl(s^{S}\;\big|\;N\bigr)\Bigr) = \sum_{n\ge0}\mathbb{E}\bigl(s^{X_1+\cdots+X_n}\bigr)\mathbb{P}(N=n) ,

where the inner conditional expectation was replaced by an unconditional one because NN is independent of the XiX_i. By rule 4 applied n−1n-1 times the nnth term is GX(s)nP(N=n)G_X(s)^{n}\mathbb{P}(N=n), and summing over nn gives ∑nGX(s)nP(N=n)=GN(GX(s))\sum_n G_X(s)^{n}\mathbb{P}(N=n) = G_N(G_X(s)), since 0≤GX(s)≤10 \le G_X(s)\le1 for 0≤s≤10\le s\le 1 puts the argument inside the disc of convergence of GNG_N.

Rule 6. If X1,X2X_1,X_2 are independent the argument of rule 4 applies to s1X1s_1^{X_1} and s2X2s_2^{X_2}. Conversely, if the joint generating function factorises then comparing the coefficient of s1is2js_1^{i}s_2^{j} on the two sides gives P(X1=i,X2=j)=P(X1=i)P(X2=j)\mathbb{P}(X_1=i,X_2=j) = \mathbb{P}(X_1=i)\mathbb{P}(X_2=j) for every i,ji,j, which is independence.

Rule 7. The series ∑nsnP(X=n)\sum_n s^{n}\mathbb{P}(X=n) omits the value +∞+\infty entirely, since s∞=0s^{\infty}=0 for ∣s∣<1\lvert s\rvert<1; letting s↑1s\uparrow1 and applying Abel's theorem to the non-negative coefficients gives ∑n<∞P(X=n)=1−P(X=∞)\sum_{n<\infty}\mathbb{P}(X=n) = 1-\mathbb{P}(X=\infty).

Rules 8-11. Rule 8 is the substitution s=ets = e^{t} together with the expansion

MX(t)=E(∑k≥0(tX)kk!)=∑k≥0tkk! E(Xk),M_X(t) = \mathbb{E}\Bigl(\sum_{k\ge0}\frac{(tX)^{k}}{k!}\Bigr) = \sum_{k\ge0}\frac{t^{k}}{k!}\,\mathbb{E}(X^{k}) ,

the interchange of expectation and sum being justified when MXM_X is finite on a neighbourhood of 00; this is the derivation Arfken, Weber and Harris (Arfken, Weber & Harris (2013), §23.2, eq. (23.32), p. 1141) give. Rule 9 is E(et(aX+b))=ebtE(e(at)X)\mathbb{E}(e^{t(aX+b)}) = e^{bt}\mathbb{E}(e^{(at)X}). Rule 10 repeats the argument of rules 4 and 5 with etXe^{tX} in place of sXs^{X}. Rule 11 follows from rule 10 by taking logarithms, and the Gaussian values from K(t)=log⁡exp⁡(μt+12σ2t2)K(t) = \log\exp(\mu t+\tfrac12\sigma^2t^2), which is already a polynomial, so the coefficients beyond t2t^2 are zero. □\square

Proof(The branching process theorems)AdaptedAdapted from Grimmett & Stirzaker (2020), §5.4, proofs of Theorem (5.4.1), Lemma (5.4.2) and Theorem (5.4.5), pp. 193-195

Iteration. Each member of generation m+nm+n descends from exactly one member of generation mm. Writing WiW_i for the number of generation-(m+n)(m+n) descendants of the iith member of generation mm, we have Zm+n=W1+⋯+WZmZ_{m+n} = W_1 + \cdots + W_{Z_m}. The WiW_i are independent, by the independence assumption on family sizes; they are identically distributed, each with the law of ZnZ_n started from a single ancestor; and ZmZ_m is a function of the family sizes in generations 00 to m−1m-1 only, whereas each WiW_i is a function of the family sizes of generation mm onwards, so ZmZ_m is independent of the whole sequence W1,W2,…W_1,W_2,\dots. Rule 5 therefore applies and gives Gm+n=Gm∘GnG_{m+n} = G_m \circ G_n. Taking m=1m=1 and iterating, Gn=G∘G∘⋯∘GG_n = G\circ G\circ\cdots\circ G (nn factors).

Moments. Differentiate Gn(s)=G(Gn−1(s))G_n(s) = G\bigl(G_{n-1}(s)\bigr) by the chain rule and let s↑1s\uparrow1. Since Gn−1(1)=1G_{n-1}(1)=1,

Gn′(1)=G′(1) Gn−1′(1)=μ Gn−1′(1),G_n'(1) = G'(1)\,G_{n-1}'(1) = \mu\,G_{n-1}'(1) ,

so E(Zn)=μn\mathbb{E}(Z_n) = \mu^{n} by induction from E(Z0)=1\mathbb{E}(Z_0)=1. Differentiating once more,

Gn′′(1)=G′′(1) Gn−1′(1)2+G′(1) Gn−1′′(1)=G′′(1)μ2(n−1)+μ Gn−1′′(1).G_n''(1) = G''(1)\,G_{n-1}'(1)^2 + G'(1)\,G_{n-1}''(1) = G''(1)\mu^{2(n-1)} + \mu\,G_{n-1}''(1) .

Write vn=var⁡(Zn)=Gn′′(1)+μn−μ2nv_n = \operatorname{var}(Z_n) = G_n''(1)+\mu^{n}-\mu^{2n}, substitute Gn′′(1)=vn−μn+μ2nG_n''(1) = v_n - \mu^n + \mu^{2n} and G′′(1)=σ2−μ+μ2G''(1) = \sigma^2 - \mu + \mu^2 into the last display, and the terms in μn\mu^{n}, μ2n−1\mu^{2n-1} and μ2n\mu^{2n} all cancel, leaving the one-term recursion

vn=μ vn−1+σ2μ2n−2,v0=0.v_n = \mu\,v_{n-1} + \sigma^{2}\mu^{2n-2} , \qquad v_0 = 0 .

Unrolling it gives vn=σ2(μ2n−2+μ2n−3+⋯+μn−1)=σ2μn−1(1+μ+⋯+μn−1)v_n = \sigma^{2}\bigl(\mu^{2n-2} + \mu^{2n-3} + \cdots + \mu^{n-1}\bigr) = \sigma^{2}\mu^{n-1}\bigl(1+\mu+\cdots+\mu^{n-1}\bigr), which is nσ2n\sigma^2 when μ=1\mu=1 and σ2μn−1(μn−1)/(μ−1)\sigma^2\mu^{n-1}(\mu^{n}-1)/(\mu-1) otherwise.

Extinction. The events {Zn=0}\{Z_n = 0\} increase with nn, because an empty generation has empty descendants; so ηn=P(Zn=0)\eta_n = \mathbb{P}(Z_n=0) is non-decreasing and, by continuity of probability along increasing sequences, ηn↑η=P(some Zn=0)=P(extinction)\eta_n \uparrow \eta = \mathbb{P}(\text{some }Z_n = 0) = \mathbb{P}(\text{extinction}). Now ηn=Gn(0)=G(Gn−1(0))=G(ηn−1)\eta_n = G_n(0) = G(G_{n-1}(0)) = G(\eta_{n-1}), and GG is continuous on [0,1][0,1], so letting n→∞n\to\infty gives

η=G(η):\eta = G(\eta) :

the extinction probability is a fixed point. It is the smallest non-negative one: if ψ≥0\psi \ge 0 satisfies ψ=G(ψ)\psi = G(\psi), then, because GG has non-negative coefficients and so is non-decreasing on [0,1][0,1], η1=G(0)≤G(ψ)=ψ\eta_1 = G(0) \le G(\psi) = \psi, and inductively ηn=G(ηn−1)≤G(ψ)=ψ\eta_n = G(\eta_{n-1}) \le G(\psi) = \psi; letting n→∞n\to\infty gives η≤ψ\eta\le\psi.

For the three cases, note that G′′(s)=E(Z1(Z1−1)sZ1−2)≥0G''(s) = \mathbb{E}\bigl(Z_1(Z_1-1)s^{Z_1-2}\bigr) \ge 0 on [0,1][0,1], so GG is convex there, and G(1)=1G(1)=1. A convex function on [0,1][0,1] that equals 11 at s=1s=1 meets the diagonal y=sy=s in at most one further point.

  • If μ=G′(1)>1\mu = G'(1) > 1 then G(s)<sG(s) < s for ss slightly below 11, while G(0)=P(Z1=0)≥0G(0) = \mathbb{P}(Z_1=0) \ge 0; so G(s)−sG(s)-s changes sign on [0,1)[0,1) and there is a root η<1\eta<1.
  • If μ<1\mu < 1 then G(s)>sG(s) > s for all s∈[0,1)s\in[0,1) - by convexity the chord from (s,G(s))(s,G(s)) to (1,1)(1,1) has slope at most G′(1)=μ<1G'(1)=\mu<1, which forces G(s)≥1−μ(1−s)>sG(s) \ge 1-\mu(1-s) > s - so the only fixed point in [0,1][0,1] is 11 and η=1\eta=1.
  • If μ=1\mu = 1 and σ2>0\sigma^2 > 0 then GG is strictly convex (strict convexity is exactly σ2>0\sigma^2>0 here, since σ2=0\sigma^2=0 with μ=1\mu=1 means Z1≡1Z_1\equiv1 and G(s)=sG(s)=s), so G(s)>sG(s) > s on [0,1)[0,1) and again η=1\eta=1. In the degenerate case σ2=0\sigma^2=0, μ=1\mu=1, every individual has exactly one child, G(s)=sG(s)=s, every point is a fixed point and the population never dies: the smallest non-negative root is 00, which is the correct extinction probability. □\square
Remark(Where the hypotheses are used, and where the method breaks)Original
  • Rule 4 needs independence, not merely zero correlation. Let XX be Bernoulli with parameter 12\tfrac12 and Y=1−XY = 1-X. Then GX(s)=GY(s)=12(1+s)G_X(s)=G_Y(s)=\tfrac12(1+s), so the product is 14(1+s)2\tfrac14(1+s)^2, the generating function of a bin(2,12)\mathrm{bin}(2,\tfrac12) variable. But X+Y≡1X+Y\equiv1, with generating function ss. The two disagree everywhere except at s=1s=1.
  • Rule 5 needs NN independent of the XiX_i, and the proof shows exactly why. The step that replaces E(sX1+⋯+Xn∣N=n)\mathbb{E}(s^{X_1+\cdots+X_n}\mid N=n) by E(sX1+⋯+Xn)\mathbb{E}(s^{X_1+\cdots+X_n}) is the only use of that hypothesis, and it fails if the number of terms is chosen after looking at them. If X1,X2,…X_1,X_2,\dots are independent Bernoulli(12)(\tfrac12) and N=1+X1N = 1 + X_1, then S=X1+⋯+XNS = X_1 + \cdots + X_N can be enumerated in four equally likely cases. If X1=0X_1=0 then N=1N=1 and S=X1=0S = X_1 = 0; if X1=1X_1=1 then N=2N=2 and S=1+X2S = 1 + X_2, which is 11 or 22 according to X2X_2. Hence P(S=0)=12\mathbb{P}(S=0)=\tfrac12, P(S=1)=14\mathbb{P}(S=1)=\tfrac14, P(S=2)=14\mathbb{P}(S=2)=\tfrac14 and GS(s)=12+14s+14s2G_S(s)=\tfrac12+\tfrac14 s+\tfrac14 s^{2}, whereas GN(u)=12(u+u2)G_N(u) = \tfrac12(u+u^2) gives GN(GX(s))=12(1+s2+(1+s)24)=38+12s+18s2G_N(G_X(s)) = \tfrac12\bigl(\tfrac{1+s}2 + \tfrac{(1+s)^2}4\bigr) = \tfrac38 + \tfrac12 s + \tfrac18 s^{2}. The two agree at s=1s=1, as both must, and nowhere else: the formula is wrong here because NN was chosen after looking at X1X_1.
  • The moment generating function can fail to exist. MX(t)=∞M_X(t)=\infty for every t≠0t\ne0 when XX is Cauchy, and for every t>0t>0 when XX is log-normal or has any heavy tail; rules 8-12 are then empty, and the characteristic function of Characteristic functions is the right tool. Riley, Hobson and Bence note that boundedness of XX guarantees existence for all tt; the honest general statement is that MXM_X is finite on an interval containing 00, possibly the single point {0}\{0\}.
  • Moments do not always determine a distribution. Grimmett and Stirzaker state this explicitly and point to the log-normal: there are distinct distribution functions with identical moments of every order. So "matching all the moments" is not by itself a proof that two laws agree; what is needed is rule 12's hypothesis that MM is finite near the origin, or a characteristic-function argument.
  • A terminology clash to be aware of. Arfken, Weber and Harris (Arfken, Weber & Harris (2013), §23.2, p. 1141) define the higher moments about the mean in their eq. (23.31), then introduce ⟨etX⟩\langle e^{tX}\rangle and remark that the moments it generates are taken relative to x=0x=0 rather than to the expectation value, calling those quantities central moments. Everywhere else in this handbook, and in Expectation, variance and covariance, central moment means a moment about the mean, E((X−EX)k)\mathbb{E}((X-\mathbb{E}X)^{k}), and MXM_X as defined above generates the moments about the origin; rule 9 with b=−μb=-\mu is what converts between them. We follow the handbook's usage and record Arfken, Weber and Harris's wording so that a reader moving between the two is not caught out.
  • The critical branching case is genuinely delicate. With μ=1\mu=1 and σ2>0\sigma^2>0 the population dies out with probability 11 even though E(Zn)=1\mathbb{E}(Z_n)=1 for every nn; the mean is held up by ever rarer, ever larger survivals, and var⁡(Zn)=nσ2\operatorname{var}(Z_n)=n\sigma^2 grows without bound. This is why the theorem must say "provided the variance is strictly positive": the one excluded case, Z1≡1Z_1\equiv1, has μ=1\mu=1 and never dies.
  • Abel's theorem is doing real work in rule 3. For a variable with E(X)=∞\mathbb{E}(X)=\infty - say P(X=n)∝n−2\mathbb{P}(X=n)\propto n^{-2} - the radius of convergence is exactly 11, GG is finite on [0,1][0,1], and G′(s)→+∞G'(s)\to+\infty as s↑1s\uparrow1. Rule 3 reports this correctly as E(X)=+∞\mathbb{E}(X)=+\infty only because Abel's theorem permits the limit to be taken.
Method(Using a generating function)Original
  1. Choose the transform. Non-negative integer values and questions about probabilities: use G(s)=E(sX)G(s)=\mathbb{E}(s^{X}). Real values, or questions about moments: use M(t)=E(etX)M(t)=\mathbb{E}(e^{tX}), after checking it is finite near 00. Heavy tails or a limit theorem: use the characteristic function instead.
  2. Build it from the pieces. Write the quantity of interest as a sum of independent variables (multiply), as a sum of a random number of them (compose), or as an affine function (rule 9). Almost never sum the defining series directly.
  3. Recognise the answer. Keep a short table: Bernoulli(p)(p) gives q+psq+ps; bin(n,p)\mathrm{bin}(n,p) gives (q+ps)n(q+ps)^{n}; Poisson(λ)(\lambda) gives eλ(s−1)e^{\lambda(s-1)}; geometric on {1,2,… }\{1,2,\dots\} gives ps/(1−qs)ps/(1-qs); N(μ,σ2)N(\mu,\sigma^2) has M(t)=exp⁡(μt+12σ2t2)M(t)=\exp(\mu t+\tfrac12\sigma^2t^2); exponential(λ)(\lambda) has M(t)=λ/(λ−t)M(t)=\lambda/(\lambda-t) for t<λt<\lambda. By uniqueness, matching one of these identifies the distribution.
  4. Extract what you need. Probabilities: P(X=n)=G(n)(0)/n!\mathbb{P}(X=n) = G^{(n)}(0)/n!, or read off the coefficient of sns^n in a closed form expanded as a series. Moments: differentiate at s=1s=1 (factorial moments) or at t=0t=0 (ordinary moments). Cumulants: expand log⁡M\log M.
  5. Check. G(1)=1G(1)=1 and M(0)=1M(0)=1 always; G(0)G(0) must equal P(X=0)\mathbb{P}(X=0); G′(1)G'(1) must be the mean you expect; and in a composite model the answer must reduce to the known one when the randomness is switched off (for example, NN constant in rule 5).
  6. For a branching process, write down GG, compute μ=G′(1)\mu=G'(1), and solve s=G(s)s=G(s) on [0,1][0,1]; the smallest non-negative root is the extinction probability, and μ≶1\mu \lessgtr 1 tells you in advance whether it is 11.
Example(A branching process with a quadratic offspring generating function)Original

A neutron entering a block of fissile material is absorbed, and the absorption produces 00, 11 or 22 further neutrons with probabilities

p0=14,p1=14,p2=12.p_0 = \tfrac14, \qquad p_1 = \tfrac14, \qquad p_2 = \tfrac12 .

Each neutron behaves independently and in the same way, so the generations of neutrons form a branching process with Z0=1Z_0=1 and

G(s)  =  14+14s+12s2.G(s) \;=\; \tfrac14 + \tfrac14 s + \tfrac12 s^{2} .

(Check: G(1)=14+14+12=1G(1) = \tfrac14+\tfrac14+\tfrac12 = 1, and G(0)=14=p0G(0)=\tfrac14=p_0.)

Step 1: the mean and variance of a family.

μ=G′(1)=14+1=54=1.25,G′′(1)=1,σ2=G′′(1)+G′(1)−G′(1)2=1+54−2516=1116=0.6875.\mu = G'(1) = \tfrac14 + 1 = \tfrac54 = 1.25 , \qquad G''(1) = 1 , \qquad \sigma^{2} = G''(1)+G'(1)-G'(1)^{2} = 1 + \tfrac54 - \tfrac{25}{16} = \tfrac{11}{16} = 0.6875 .

Since μ>1\mu > 1 the chain is supercritical and extinction is not certain.

Step 2: the second generation, explicitly. By the iteration rule, G2=G∘GG_2 = G\circ G. Substituting,

G2(s)=14+14(14+14s+12s2)+12(14+14s+12s2)2=1132+18s+932s2+18s3+18s4.G_2(s) = \tfrac14 + \tfrac14\Bigl(\tfrac14+\tfrac14 s+\tfrac12 s^2\Bigr) + \tfrac12\Bigl(\tfrac14+\tfrac14 s+\tfrac12 s^2\Bigr)^{2} = \tfrac{11}{32} + \tfrac18 s + \tfrac{9}{32}s^{2} + \tfrac18 s^{3} + \tfrac18 s^{4} .

The five coefficients sum to 1132+432+932+432+432=1\tfrac{11}{32}+\tfrac{4}{32}+\tfrac{9}{32}+\tfrac{4}{32}+\tfrac{4}{32} = 1, as they must, and they are the mass function of Z2Z_2: for instance P(Z2=3)=18\mathbb{P}(Z_2 = 3) = \tfrac18. The degree is 44, correct because at most two neutrons each produce at most two.

Step 3: moments of later generations, two ways. From G2G_2 directly, G2′(1)=18+2⋅932+3⋅18+4⋅18=2516G_2'(1) = \tfrac18+2\cdot\tfrac9{32}+3\cdot\tfrac18+4\cdot\tfrac18 = \tfrac{25}{16}, and G2′′(1)+G2′(1)−G2′(1)2=495256G_2''(1)+G_2'(1)-G_2'(1)^2 = \tfrac{495}{256}. From the general formulas,

E(Z2)=μ2=2516=1.5625,var⁡(Z2)=σ2(μ2−1)μμ−1=1116⋅916⋅5414=495256=1.93359,\mathbb{E}(Z_2) = \mu^{2} = \tfrac{25}{16} = 1.5625 , \qquad \operatorname{var}(Z_2) = \frac{\sigma^{2}(\mu^{2}-1)\mu}{\mu-1} = \frac{\tfrac{11}{16}\cdot\tfrac{9}{16}\cdot\tfrac54}{\tfrac14} = \frac{495}{256} = 1.93359 ,

the same numbers. For the third generation, E(Z3)=μ3=12564=1.953125\mathbb{E}(Z_3) = \mu^{3} = \tfrac{125}{64} = 1.953125 and

var⁡(Z3)=σ2(μ3−1)μ2μ−1=1116⋅6164⋅251614=167754096=4.09546.\operatorname{var}(Z_3) = \frac{\sigma^{2}(\mu^{3}-1)\mu^{2}}{\mu-1} = \frac{\tfrac{11}{16}\cdot\tfrac{61}{64}\cdot\tfrac{25}{16}}{\tfrac14} = \frac{16775}{4096} = 4.09546 .

Step 4: the extinction probability. Solve s=G(s)s = G(s):

s=14+14s+12s2  ⟺  4s=1+s+2s2  ⟺  2s2−3s+1=0  ⟺  (2s−1)(s−1)=0,s = \tfrac14+\tfrac14 s+\tfrac12 s^2 \iff 4s = 1 + s + 2s^{2} \iff 2s^{2}-3s+1 = 0 \iff (2s-1)(s-1) = 0 ,

with roots s=12s = \tfrac12 and s=1s=1. The smallest non-negative root is

 η  =  12 .\boxed{\ \eta \;=\; \tfrac12\ }.

So a single initial neutron sets off a chain reaction that dies out with probability 12\tfrac12 and grows without bound with probability 12\tfrac12. This is consistent with μ>1\mu>1, which guarantees η<1\eta<1.

Step 5: a check on the convergence. The theorem says ηn=Gn(0)\eta_n = G_n(0) increases to η\eta. Iterating ηn=G(ηn−1)\eta_n = G(\eta_{n-1}) from η0=0\eta_0=0:

η1=14=0.25,η2=1132=0.34375,η3=8092048=0.395020,η4=0.426775,η5=0.447762,η6=0.462186,\eta_1 = \tfrac14 = 0.25,\quad \eta_2 = \tfrac{11}{32} = 0.34375,\quad \eta_3 = \tfrac{809}{2048} = 0.395020,\quad \eta_4 = 0.426775,\quad \eta_5 = 0.447762,\quad \eta_6 = 0.462186 ,

increasing towards 0.50.5, as predicted. Note how slowly: the convergence rate is G′(η)=14+η=34G'(\eta) = \tfrac14+\eta = \tfrac34 per generation. (The value η2=1132\eta_2 = \tfrac{11}{32} agrees with the constant term of G2G_2 computed in step 2, an independent check. All the numbers in this example were verified symbolically.)

Step 6: what happens if the material is made slightly less reactive. Replace p2p_2 by 14\tfrac14 and p1p_1 by 12\tfrac12: then G(s)=14+12s+14s2G(s) = \tfrac14+\tfrac12 s+\tfrac14 s^2, μ=12+12=1\mu = \tfrac12+\tfrac12 = 1, and σ2=12+1−1=12>0\sigma^2 = \tfrac12+1-1 = \tfrac12 > 0. The fixed-point equation becomes 4s=1+2s+s24s = 1+2s+s^2, that is (s−1)2=0(s-1)^2 = 0, with the single root s=1s=1: extinction is now certain, although the expected population size is exactly 11 in every generation. The transition between η=12\eta=\tfrac12 and η=1\eta=1 is entirely controlled by μ\mu crossing 11 - the criticality condition of a chain reaction.

Application(Chain reactions, queues, polymers and epidemics)Original

Nuclear chain reactions. The example above is the standard neutron-multiplication model: μ\mu is the effective multiplication factor kk of reactor physics, and the three regimes μ<1\mu<1, μ=1\mu=1, μ>1\mu>1 are subcritical, critical and supercritical. The extinction probability η\eta is the chance that a single stray neutron fails to start a divergent chain, which is why reactor startup is a statistical rather than a deterministic event and why source neutrons are deliberately supplied. Electromagnetic and hadronic cascades in detectors, and photon multiplication in a photomultiplier dynode chain, are modelled the same way, with the generating function of the per-stage gain composed once per stage.

Compound Poisson totals. Rule 5 with NN Poisson is the compound Poisson model: total charge deposited by a Poisson number of independent scattering events, total claim size in insurance, total shot noise in a photodiode. The random sum formula gives the transform immediately, and expanding log⁡MS\log M_S gives the cumulants of the total in one line - the basis of Campbell's theorem for shot noise.

Queues and recurrence times. The equilibrium queue length of an M/G/1 queue is found by writing a balance relation between generating functions and solving it; the first-return time of a random walk is obtained in the same way, and Random walks uses the convolution rule to turn the renewal relation between return probabilities into an algebraic one.

Polymers and percolation. The size distribution of a branched polymer cluster is a branching process in the mean-field approximation, and the gel point - the onset of an infinite connected cluster - is precisely the critical point μ=1\mu=1. The same calculation gives the percolation threshold on a tree and the giant-component threshold in a random network, where μ\mu is the mean number of further edges reached from an edge.

Epidemics. In the early stage of an outbreak, infections form a branching process whose mean offspring number is the basic reproduction number R0R_0. The extinction theorem says that an outbreak started by one case fizzles out with probability 11 if R0≤1R_0 \le 1, and with probability η<1\eta<1 given by the smallest root of s=G(s)s=G(s) if R0>1R_0>1 - a statement about the whole offspring distribution, not just its mean, which is why superspreading (large σ2\sigma^2 at fixed μ\mu) raises the chance of early extinction while leaving R0R_0 unchanged.

Large deviations. The cumulant generating function K(t)=log⁡M(t)K(t) = \log M(t) is the object whose Legendre transform is the rate function of Large deviations and Cramer's theorem, and the exponential Markov bound of Markov, Chebyshev, Jensen and Chernoff inequalities is an inequality about MM directly.

Theorem

Characteristic functions

Adapted

Defines φX(t)=E(eitX)\varphi_X(t)=\mathbb{E}(e^{itX}), proves that it is bounded, uniformly continuous and non-negative definite and that it turns independent sums into products and affine maps into phases, states the inversion and continuity theorems and the moment expansion, and inverts sin⁡2t/t2\sin^2 t/t^2 to the triangular density as a worked check.

Prerequisites: Expectation, variance and covariance, Generating functions, Fourier inversion, Convergence of random variables

Note(Why a complex exponential)Original

The moment generating function M(t)=E(etX)M(t)=\mathbb{E}(e^{tX}) of Generating functions does everything one wants - until the integral diverges, which it does for the Cauchy distribution at every t≠0t\ne0 and for any heavy-tailed law on half the line. Replacing the real exponential by eitXe^{itX} cures this at a stroke: ∣eitX∣=1\lvert e^{itX}\rvert = 1, so the expectation exists for every random variable and every real tt, with no hypothesis whatever. Riley, Hobson and Bence (Riley, Hobson & Bence (2006), §30.7.3, p. 1166) give exactly this as the reason for preferring the characteristic function.

What is gained is not only safety. The characteristic function is the Fourier transform of the distribution - Folland (Folland (1999), §10.1, p. 314) lists the two names as translations of one another in his dictionary between analysts' and probabilists' usage - so the whole apparatus of Fourier inversion becomes available: the distribution can be recovered from φ\varphi, convolution becomes multiplication, and convergence of distributions becomes pointwise convergence of transforms. That last equivalence, the continuity theorem, is what makes the proof of the central limit theorem three lines long.

One warning about words. In analysis, "characteristic function" means the indicator function χE\chi_E of a set; Folland's dictionary records the clash. In this chapter the term always means E(eitX)\mathbb{E}(e^{itX}).

Definition(The characteristic function)AdaptedAdapted from Grimmett & Stirzaker (2020), §5.7, Definition (5.7.2) with the surrounding discussion and Definition (5.7.7), pp. 204-205; Riley, Hobson & Bence (2006), §30.7.3, eq. (30.91) and the relation $C_X(t)=M_X(it)$, pp. 1165-1166

The characteristic function of a real random variable XX is the function φX:R→C\varphi_X : \mathbb{R}\to\mathbb{C},

φX(t)  =  E(eitX)  =  E(cos⁡tX)  +  i E(sin⁡tX),\varphi_X(t) \;=\; \mathbb{E}\bigl(e^{itX}\bigr) \;=\; \mathbb{E}\bigl(\cos tX\bigr) \;+\; i\,\mathbb{E}\bigl(\sin tX\bigr) ,

the second expression being the definition of the expectation of a complex-valued random variable and showing that φX(t)\varphi_X(t) is defined for every tt, since cos⁡tX\cos tX and sin⁡tX\sin tX are bounded. Equivalently φX(t)=∫Reitx dF(x)\varphi_X(t) = \int_{\mathbb{R}} e^{itx}\,dF(x), which reads ∑jeitxjP(X=xj)\sum_j e^{itx_j}\mathbb{P}(X=x_j) in the discrete case and ∫eitxf(x) dx\int e^{itx}f(x)\,dx in the continuous case. Riley, Hobson and Bence write it CX(t)C_X(t) and record the relation to the moment generating function,

φX(t)=MX(it)wherever MX is defined,\varphi_X(t) = M_X(it) \qquad\text{wherever } M_X \text{ is defined} ,

so that any identity for MM transfers by substituting itit for tt - with the caveat of the remark below that this substitution needs justification, since MM may be finite nowhere but the origin.

Relation to the Fourier transform. If XX has density ff then, in the convention of The Fourier transform where f^(k)=∫f(x)e−ikxdx\hat f(k)=\int f(x)e^{-ikx}dx,

φX(t)  =  f^(−t),sof(x)  =  12π∫−∞∞f^(k)eikx dk  =  12π∫−∞∞φX(t) e−itx dt.\varphi_X(t) \;=\; \hat f(-t) , \qquad\text{so}\qquad f(x) \;=\; \frac{1}{2\pi}\int_{-\infty}^{\infty}\hat f(k)e^{ikx}\,dk \;=\; \frac{1}{2\pi}\int_{-\infty}^{\infty}\varphi_X(t)\,e^{-itx}\,dt .

The probabilists' sign convention is the opposite of the handbook's forward transform, and this is the only difference. Reed and Simon carry an extra (2π)−n/2(2\pi)^{-n/2}: their transform of a measure is μ^(λ)=(2π)−n/2∫e−iλxdμ(x)\hat\mu(\lambda) = (2\pi)^{-n/2}\int e^{-i\lambda x}d\mu(x), so for the distribution of XX in one dimension μ^(λ)=(2π)−1/2φX(−λ)\hat\mu(\lambda) = (2\pi)^{-1/2}\varphi_X(-\lambda).

Joint characteristic function. For random variables XX and YY on the same probability space,

φX,Y(s,t)  =  E(eisX+itY),\varphi_{X,Y}(s,t) \;=\; \mathbb{E}\bigl(e^{isX + itY}\bigr) ,

and similarly for a random vector XX on Rn\mathbb{R}^n, φX(t)=E(eitTX)\varphi_X(t) = \mathbb{E}\bigl(e^{it^{T}X}\bigr) for t∈Rnt \in \mathbb{R}^n.

Non-negative definiteness. A function ϕ:R→C\phi:\mathbb{R}\to\mathbb{C} is non-negative definite if

∑j,k=1nϕ(tj−tk) zj zk‾  ≥  0\sum_{j,k=1}^{n} \phi(t_j - t_k)\, z_j\, \overline{z_k} \;\ge\; 0

for every nn, all real t1,…,tnt_1,\dots,t_n and all complex z1,…,znz_1,\dots,z_n. Reed and Simon call a bounded continuous ϕ\phi with this property a function of positive type, and record three immediate consequences of the definition: ϕ(0)≥0\phi(0)\ge0, ϕ(−x)=ϕ(x)‾\phi(-x) = \overline{\phi(x)} and ∣ϕ(x)∣≤ϕ(0)\lvert\phi(x)\rvert\le\phi(0).

Theorem(Basic properties)AdaptedAdapted from Grimmett & Stirzaker (2020), §5.7, Theorem (5.7.3)(a)-(c) with the attribution of the converse to Bochner, Theorems (5.7.5) and (5.7.6), Theorem (5.7.8) with eq. (5.7.9), pp. 204-206, and Problem (5.12.22), p. 234; Reed & Simon (1980), §IX.2, Theorem IX.9, p. 330

Let XX, YY be random variables and a,b∈Ra, b \in \mathbb{R}.

  1. Normalisation and bound. φX(0)=1\varphi_X(0) = 1 and ∣φX(t)∣≤1\lvert\varphi_X(t)\rvert \le 1 for every tt.
  2. Uniform continuity. φX\varphi_X is uniformly continuous on R\mathbb{R} - for every XX, with no moment hypothesis.
  3. Non-negative definiteness. φX\varphi_X is non-negative definite in the sense above.
  4. Bochner's theorem (the converse). Properties 1-3 are not merely necessary but sufficient: whenever ϕ\phi is continuous, non-negative definite and normalised by ϕ(0)=1\phi(0)=1, some random variable has ϕ\phi for its characteristic function - and by the uniqueness statement below that variable's distribution is the only one with this ϕ\phi. Grimmett and Stirzaker state this and give no proof. Reed and Simon (Reed & Simon (1980), §IX.2, Theorem IX.9, p. 330) prove the measure-theoretic version: on Rn\mathbb{R}^{n}, the cone they call the functions of positive type is precisely the image of the finite positive measures under their Fourier transform. Translating by μ^(λ)=(2π)−1/2φ(−λ)\hat\mu(\lambda)=(2\pi)^{-1/2}\varphi(-\lambda) and normalising at the origin turns their theorem into the statement above.
  5. Affine images. φaX+b(t)=eitb φX(at)\varphi_{aX+b}(t) = e^{itb}\,\varphi_X(at).
  6. Independent sums. If XX and YY are independent then φX+Y(t)=φX(t) φY(t)\varphi_{X+Y}(t) = \varphi_X(t)\,\varphi_Y(t).
  7. Independence criterion. Independence of XX and YY is equivalent to the factorisation φX,Y(s,t)=φX(s)φY(t)\varphi_{X,Y}(s,t) = \varphi_X(s)\varphi_Y(t) holding at every pair of real arguments s,ts,t. It is not enough that φX+Y(t)=φX(t)φY(t)\varphi_{X+Y}(t) = \varphi_X(t)\varphi_Y(t) for all tt, which is the statement with s=ts=t only; Grimmett and Stirzaker flag this explicitly and set the construction of a counterexample as an exercise.
  8. Symmetry. φX(−t)=φX(t)‾\varphi_X(-t) = \overline{\varphi_X(t)} always; and XX has the same distribution as −X-X if and only if φX\varphi_X is real-valued, that is Im⁡φX≡0\operatorname{Im}\varphi_X \equiv 0.
  9. Stability of the class. If φ\varphi is a characteristic function then so are φ‾\overline\varphi, φ2\varphi^2, ∣φ∣2\lvert\varphi\rvert^2 and Re⁡φ\operatorname{Re}\varphi; but ∣φ∣\lvert\varphi\rvert need not be one.
Theorem(Moments)AdaptedAdapted from Grimmett & Stirzaker (2020), §5.7, Theorem (5.7.4)(a)-(b), p. 205, Remark (5.7.10) and Theorem (5.7.12), p. 206, and Problem (5.12.30), p. 234; Riley, Hobson & Bence (2006), §30.7.3, the moment formula, p. 1166

Let φ=φX\varphi = \varphi_X and let k≥1k \ge 1 be an integer.

  • (a) From derivatives to moments. If φ(k)(0)\varphi^{(k)}(0) exists then E∣Xk∣<∞\mathbb{E}\lvert X^{k}\rvert < \infty when kk is even, and E∣Xk−1∣<∞\mathbb{E}\lvert X^{k-1}\rvert < \infty when kk is odd. Note what this does and does not promise: an odd derivative buys only the moment one order below it.
  • (b) From moments to the expansion. If E∣Xk∣<∞\mathbb{E}\lvert X^{k}\rvert<\infty then φ(t)  =  ∑j=0kE(Xj)j! (it)j  +  o(tk)(t→0),andφ(k)(0)  =  ik E(Xk).\varphi(t) \;=\; \sum_{j=0}^{k}\frac{\mathbb{E}(X^{j})}{j!}\,(it)^{j} \;+\; o(t^{k}) \qquad (t\to0) , \qquad\text{and}\qquad \varphi^{(k)}(0) \;=\; i^{k}\,\mathbb{E}(X^{k}) . Riley, Hobson and Bence write the second relation as E(Xn)=(−i)nφ(n)(0)\mathbb{E}(X^{n}) = (-i)^{n}\varphi^{(n)}(0), which is the same statement.
  • (c) Joint moments. im+n E(XmYn)=∂m+nφX,Y∂sm ∂tn∣s=t=0\displaystyle i^{m+n}\,\mathbb{E}(X^{m}Y^{n}) = \frac{\partial^{m+n}\varphi_{X,Y}}{\partial s^{m}\,\partial t^{n}}\bigg|_{s=t=0}, subject to the appropriate differentiability.
  • (d) The moment problem. The moments do not always determine the distribution: Grimmett and Stirzaker record that distinct distribution functions can have identical moments of every order, the usual example being built from the log-normal, and that no simple necessary and sufficient condition is known. The simplest condition they offer as sufficient: M(t)=E(etX)M(t)=\mathbb{E}(e^{tX}) should be finite throughout some neighbourhood of the origin. They also state, as a theorem whose proof they omit, that for a>0a>0 the three conditions "∣M(t)∣<∞\lvert M(t)\rvert<\infty for ∣t∣<a\lvert t\rvert<a", "φ\varphi is analytic on the strip ∣Im⁡z∣<a\lvert\operatorname{Im}z\rvert<a" and "lim sup⁡k(∣mk∣/k!)1/k≤1/a\limsup_k (\lvert m_k\rvert/k!)^{1/k}\le 1/a" are equivalent, and that under any of them MM extends analytically with φ(t)=M(it)\varphi(t)=M(it).

Grimmett and Stirzaker state (a) and (b) without proof, remarking that it is Taylor's theorem for a function of a complex variable and referring the reader to other texts; we follow them.

Theorem(Inversion and continuity)AdaptedAdapted from Grimmett & Stirzaker (2020), §5.9, Theorem (5.9.1) with the integrability condition, Inversion theorem (5.9.2), Corollary (5.9.3) with its footnote, the two-dimensional formula, and Continuity theorem (5.9.5), pp. 212-214; Riley, Hobson & Bence (2006), §30.7.3, the inverse transform, p. 1166; Folland (1999), §8.3, Theorem 8.26 and Corollary 8.27, pp. 252-253

Inversion, density form. If XX is continuous with density ff and characteristic function φ\varphi, then

f(x)  =  12π∫−∞∞e−itx φ(t) dtf(x) \;=\; \frac{1}{2\pi}\int_{-\infty}^{\infty} e^{-itx}\,\varphi(t)\,dt

at every xx at which ff is differentiable. This is the Fourier inversion theorem of Fourier inversion written in probabilists' notation; where the integral does not converge absolutely it is read as a principal value. Absolute integrability, ∫−∞∞∣φ(t)∣ dt<∞\int_{-\infty}^{\infty}\lvert\varphi(t)\rvert\,dt < \infty, suffices to place φ\varphi among the transforms of variables possessing a density; it is not required. Folland (Folland (1999), §8.3, Theorem 8.26, p. 252) states the underlying L1L^1 theorem with the hypothesis that both the function and its transform are integrable, the conclusion holding almost everywhere.

Inversion, general form. Let XX have distribution function FF and characteristic function φ\varphi, and define F‾(x)=12(F(x)+lim⁡y↑xF(y))\overline F(x) = \tfrac12\bigl(F(x) + \lim_{y\uparrow x}F(y)\bigr), the midpoint value at a jump. Then for all a<ba<b,

F‾(b)−F‾(a)  =  lim⁡N→∞∫−NNe−iat−e−ibt2πit φ(t) dt.\overline F(b) - \overline F(a) \;=\; \lim_{N\to\infty}\int_{-N}^{N}\frac{e^{-iat}-e^{-ibt}}{2\pi i t}\,\varphi(t)\,dt .

No assumption is made about the type of XX: this holds for discrete, continuous and mixed distributions alike.

Uniqueness. Agreement of two characteristic functions at every real argument is equivalent to agreement of the two distribution functions everywhere. Grimmett and Stirzaker add a footnote worth keeping: agreement of φX\varphi_X and φY\varphi_Y on a bounded interval does not force FX=FYF_X=F_Y, and they give an example.

Joint inversion. If X,YX,Y have joint density ff and joint characteristic function φ\varphi, then at every point of differentiability of ff,

f(x,y)  =  14π2∬R2e−isxe−ity φ(s,t) ds dt,f(x,y) \;=\; \frac{1}{4\pi^{2}}\iint_{\mathbb{R}^{2}} e^{-isx}e^{-ity}\,\varphi(s,t)\,ds\,dt ,

from which the independence criterion 7 follows.

Continuity theorem. Let F1,F2,…F_1,F_2,\dots be distribution functions with characteristic functions φ1,φ2,…\varphi_1,\varphi_2,\dots.

  • (a) Suppose Fn→FF_n\to F, where FF is a distribution function whose characteristic function is φ\varphi. Then φn(t)→φ(t)\varphi_n(t)\to\varphi(t) at every real tt.
  • (b) Conversely, suppose the pointwise limit φ(t)=lim⁡n→∞φn(t)\varphi(t)=\lim_{n\to\infty}\varphi_n(t) exists at every real tt, and that this limit function is continuous at the origin. Then there is a distribution function FF whose characteristic function is φ\varphi, and Fn→FF_n\to F.

Here Fn→FF_n\to F means convergence at every continuity point of FF, the mode of Convergence of random variables. Grimmett and Stirzaker refer the proofs of the inversion and continuity theorems to other texts; we do the same.

Theorem(The standard characteristic functions)AdaptedAdapted from Grimmett & Stirzaker (2020), §5.8, Examples (5.8.1)-(5.8.5) and (5.8.8), pp. 208-211, for the Bernoulli, binomial, exponential, Cauchy, normal, gamma and chi-squared rows; Grimmett & Stirzaker (2020), §5.8, Example (5.8.6), pp. 209-210, for $N(0,V)$, extended to $N(\mu,V)$ by Theorem (5.7.6); Grimmett & Stirzaker (2020), §5.1, Examples (5.1.17)(a) and (d), p. 171, for the point-mass and Poisson probability generating functions $s^{c}$ and $e^{\lambda(s-1)}$, converted by $\varphi_X(t)=G_X(e^{it})$
distribution density or mass function φ(t)\varphi(t)
point mass at cc P(X=c)=1\mathbb{P}(X=c)=1 eitce^{itc}
Bernoulli(p)(p) P(X=1)=p\mathbb{P}(X=1)=p, P(X=0)=q\mathbb{P}(X=0)=q q+peitq + pe^{it}
bin(n,p)\mathrm{bin}(n,p) (nk)pkqn−k\binom{n}{k}p^kq^{n-k} (q+peit)n(q+pe^{it})^{n}
Poisson(λ)(\lambda) e−λλk/k!e^{-\lambda}\lambda^{k}/k! exp⁡(λ(eit−1))\exp\bigl(\lambda(e^{it}-1)\bigr)
exponential(λ)(\lambda) λe−λx\lambda e^{-\lambda x}, x≥0x\ge0 λ/(λ−it)\lambda/(\lambda - it)
gamma Γ(λ,s)\Gamma(\lambda,s) λsxs−1e−λx/Γ(s)\lambda^{s}x^{s-1}e^{-\lambda x}/\Gamma(s), x≥0x\ge0 (λ/(λ−it))s\bigl(\lambda/(\lambda-it)\bigr)^{s}
χ2(d)=Γ(12,d2)\chi^{2}(d) = \Gamma(\tfrac12,\tfrac d2) (1−2it)−d/2(1-2it)^{-d/2}
N(0,1)N(0,1) (2π)−1/2e−x2/2(2\pi)^{-1/2}e^{-x^{2}/2} e−t2/2e^{-t^{2}/2}
N(μ,σ2)N(\mu,\sigma^{2}) exp⁡(iμt−12σ2t2)\exp\bigl(i\mu t - \tfrac12\sigma^{2}t^{2}\bigr)
Cauchy 1/(π(1+x2))1/\bigl(\pi(1+x^{2})\bigr) e−∣t∣e^{-\lvert t\rvert}
N(μ,V)N(\mu, V) on Rn\mathbb{R}^{n} exp⁡(itTμ−12tTVt)\exp\bigl(it^{T}\mu - \tfrac12 t^{T}Vt\bigr)

Two entries deserve comment. The Cauchy characteristic function e−∣t∣e^{-\lvert t\rvert} has a corner at the origin: its one-sided derivatives there are +1+1 from the left and −1-1 from the right, so φ′(0)\varphi'(0) does not exist. Statement (b) read backwards then confirms that the Cauchy law has no mean, since E∣X∣<∞\mathbb{E}\lvert X\rvert<\infty would have forced φ′(0)=i E(X)\varphi'(0)=i\,\mathbb{E}(X) to exist. The implication runs in that direction only: statement (a) at k=1k=1 is vacuous (see the remark below), so the absence of a mean does not by itself prevent a characteristic function from being differentiable at 00, and the corner here has to be read off the formula rather than deduced from the missing moment. And the normal entry is obtained, as Grimmett and Stirzaker emphasise, not by substituting s=its=it into M(s)=es2/2M(s)=e^{s^{2}/2} as if ii were real, but by analytic continuation, which their Remark (5.7.11) licenses; they warn twice against treating ii as a real number, noting that for the exponential distribution the illegitimate substitution happens to give the right answer and for the Cauchy distribution it gives nothing at all.

Idea of the proofOriginal

Each of the three basic properties has a one-line reason. Boundedness: the integrand has modulus 11, so the average does too at worst. Uniform continuity: the increment φ(t+h)−φ(t)\varphi(t+h)-\varphi(t) is E(eitX(eihX−1))\mathbb{E}\bigl(e^{itX}(e^{ihX}-1)\bigr), whose modulus is bounded by E∣eihX−1∣\mathbb{E}\lvert e^{ihX}-1\rvert, a quantity depending on hh alone and tending to 00 because the integrand is bounded by 22 and tends to 00 pointwise. Non-negative definiteness: the double sum is literally the expected squared modulus of ∑jzjeitjX\sum_j z_je^{it_jX}, and a squared modulus cannot be negative.

The rules for sums and affine maps are the exponential law ea+b=eaebe^{a+b}=e^ae^b plus the factorisation of expectations over independent variables - the same two facts that made generating functions multiply in Generating functions. The deep results, inversion and continuity, are not proved here: inversion is the Fourier inversion theorem, and continuity rests on it. What this unit supplies is the dictionary that lets those analytic theorems be read as statements about distributions.

Proof(The basic properties, and the rules for sums and affine maps)AdaptedAdapted from Grimmett & Stirzaker (2020), §5.7, proofs of Theorem (5.7.3)(a)-(c), Theorem (5.7.5) and Theorem (5.7.6), pp. 204-205; Reed & Simon (1980), §IX.2, the positivity computation and its three consequences, p. 329

Property 1. φX(0)=E(e0)=E(1)=1\varphi_X(0)=\mathbb{E}(e^{0})=\mathbb{E}(1)=1. For the bound, ∣E(Z)∣≤E∣Z∣\lvert\mathbb{E}(Z)\rvert \le \mathbb{E}\lvert Z\rvert for a complex random variable ZZ, and ∣eitx∣=1\lvert e^{itx}\rvert = 1 for real t,xt,x, so ∣φX(t)∣≤E∣eitX∣=1\lvert\varphi_X(t)\rvert \le \mathbb{E}\lvert e^{itX}\rvert = 1.

Property 2. Fix hh and estimate

∣φX(t+h)−φX(t)∣=∣E(eitX(eihX−1))∣≤E∣eihX−1∣  =:  ϵ(h),\bigl\lvert\varphi_X(t+h)-\varphi_X(t)\bigr\rvert = \bigl\lvert\mathbb{E}\bigl(e^{itX}(e^{ihX}-1)\bigr)\bigr\rvert \le \mathbb{E}\bigl\lvert e^{ihX}-1\bigr\rvert \;=:\; \epsilon(h) ,

using ∣eitX∣=1\lvert e^{itX}\rvert=1 again. The right-hand side does not involve tt, so uniform continuity will follow once ϵ(h)→0\epsilon(h)\to0. Set Yh=∣eihX−1∣Y_h = \lvert e^{ihX}-1\rvert. Then 0≤Yh≤20 \le Y_h \le 2 for every hh, and Yh→0Y_h \to 0 pointwise as h→0h\to0 because u↦eiuu\mapsto e^{iu} is continuous at 00. The bounded convergence theorem (Dominated convergence) therefore gives E(Yh)→0\mathbb{E}(Y_h)\to0. This is where the boundedness of the integrand does the work that no moment hypothesis could: nothing was assumed about XX.

Property 3. Let t1,…,tnt_1,\dots,t_n be real and z1,…,znz_1,\dots,z_n complex, and put W=∑jzjeitjXW = \sum_{j} z_j e^{it_jX}. Then

∣W∣2=WW‾=∑j,kzjzk‾ ei(tj−tk)X,\lvert W\rvert^{2} = W\overline W = \sum_{j,k} z_j\overline{z_k}\,e^{i(t_j-t_k)X} ,

since eitkX‾=e−itkX\overline{e^{it_kX}} = e^{-it_kX}. Taking expectations term by term - a finite sum, so no interchange issue arises - gives

0  ≤  E(∣W∣2)  =  ∑j,kzjzk‾ φX(tj−tk),0 \;\le\; \mathbb{E}\bigl(\lvert W\rvert^{2}\bigr) \;=\; \sum_{j,k} z_j\overline{z_k}\,\varphi_X(t_j-t_k) ,

which is the claim. Reed and Simon run the same computation for a finite measure and then read off the three consequences of positivity by specialising: n=1n=1 gives φ(0)≥0\varphi(0)\ge0, and n=2n=2 with t1=xt_1=x, t2=0t_2=0 forces the 2×22\times2 matrix (φ(0)φ(x)φ(−x)φ(0))\begin{pmatrix}\varphi(0)&\varphi(x)\\ \varphi(-x)&\varphi(0)\end{pmatrix} to be self-adjoint with non-negative determinant, giving φ(−x)=φ(x)‾\varphi(-x)=\overline{\varphi(x)} and ∣φ(x)∣≤φ(0)\lvert\varphi(x)\rvert\le\varphi(0). With φ(0)=1\varphi(0)=1 this reproves property 1 and the first half of property 8.

Property 5. φaX+b(t)=E(eit(aX+b))=eitb E(ei(at)X)=eitbφX(at)\varphi_{aX+b}(t) = \mathbb{E}\bigl(e^{it(aX+b)}\bigr) = e^{itb}\,\mathbb{E}\bigl(e^{i(at)X}\bigr) = e^{itb}\varphi_X(at), the constant eitbe^{itb} coming out of the expectation because it is not random.

Property 6. If XX and YY are independent then so are the complex random variables eitXe^{itX} and eitYe^{itY}, being functions of XX and of YY separately. Expanding both into real and imaginary parts, multiplying out, applying E(UV)=E(U)E(V)\mathbb{E}(UV)=\mathbb{E}(U)\mathbb{E}(V) to each of the four real products, and reassembling gives

φX+Y(t)=E(eitXeitY)=E(eitX)E(eitY)=φX(t)φY(t).\varphi_{X+Y}(t) = \mathbb{E}\bigl(e^{itX}e^{itY}\bigr) = \mathbb{E}\bigl(e^{itX}\bigr)\mathbb{E}\bigl(e^{itY}\bigr) = \varphi_X(t)\varphi_Y(t) .

This is the route Grimmett and Stirzaker indicate; the detour through real and imaginary parts is needed because the factorisation theorem for expectations is stated for real variables.

Property 7, forward direction. The argument of property 6 with eisXe^{isX} and eitYe^{itY} gives the factorisation of φX,Y\varphi_{X,Y}. For the converse one inverts the joint characteristic function and finds that the joint distribution function factorises; this uses the two-dimensional inversion formula and we do not reproduce it.

Property 8. φX(t)‾=E(eitX‾)=E(e−itX)=φX(−t)\overline{\varphi_X(t)} = \mathbb{E}\bigl(\overline{e^{itX}}\bigr) = \mathbb{E}\bigl(e^{-itX}\bigr) = \varphi_X(-t). By property 5 with a=−1a=-1, b=0b=0, the characteristic function of −X-X is φX(−t)=φX(t)‾\varphi_X(-t) = \overline{\varphi_X(t)}. So XX and −X-X have the same characteristic function exactly when φX=φX‾\varphi_X = \overline{\varphi_X}, that is when φX\varphi_X is real; by uniqueness, that happens exactly when XX and −X-X have the same distribution.

Property 9. φ‾=φ−X\overline\varphi = \varphi_{-X} by property 8. If X′X' is an independent copy of XX then φ2=φX+X′\varphi^{2} = \varphi_{X+X'} and ∣φ∣2=φφ‾=φX−X′\lvert\varphi\rvert^{2} = \varphi\overline\varphi = \varphi_{X-X'}, both by property 6. Finally Re⁡φ=12(φ+φ‾)\operatorname{Re}\varphi = \tfrac12(\varphi+\overline\varphi) is the characteristic function of the variable equal to XX or to −X-X with probability 12\tfrac12 each, independently of XX, since a mixture of distributions has the corresponding mixture of characteristic functions. That ∣φ∣\lvert\varphi\rvert need not be a characteristic function is Grimmett and Stirzaker's exercise, and is why the square in ∣φ∣2\lvert\varphi\rvert^{2} matters. □\square

Remark(Where the hypotheses are used, and four traps)Original
  • Property 6 uses independence and property 7 shows that the converse needs more. The single-variable identity φX+Y=φXφY\varphi_{X+Y}=\varphi_X\varphi_Y is the factorisation of the joint characteristic function evaluated only on the diagonal s=ts=t, and a function of two variables is not determined by its values on a line. Grimmett and Stirzaker make this point at their eq. (5.7.9) and ask the reader to construct dependent XX, YY satisfying it. So "the transform of the sum is the product of the transforms" is evidence of independence, never a proof of it.
  • Continuity of the limit at t=0t=0 is indispensable in the continuity theorem, and failure is not a technicality. Let Z∼N(0,1)Z\sim N(0,1) and Xn=nZX_n = nZ. By property 5, φn(t)=e−n2t2/2\varphi_n(t) = e^{-n^{2}t^{2}/2}, which converges pointwise to the function equal to 11 at t=0t=0 and 00 elsewhere. That limit is not continuous at 00, and correspondingly there is no limiting distribution: Fn(x)→12F_n(x)\to\tfrac12 for every fixed xx, and 12\tfrac12 is not a distribution function. The probability mass has escaped to ±∞\pm\infty, and the discontinuity of the limit at the origin is exactly the signal that it did.
  • An odd derivative buys one moment less than you expect. Statement (a) says that the existence of φ′(0)\varphi'(0) gives only E∣X0∣<∞\mathbb{E}\lvert X^{0}\rvert<\infty, which is no information at all; it does not give E∣X∣<∞\mathbb{E}\lvert X\rvert<\infty. Even derivatives are different: φ′′(0)\varphi''(0) existing does force E(X2)<∞\mathbb{E}(X^{2})<\infty. The asymmetry is real and is why the hypothesis of the central limit theorem is a finite variance and not a finite mean plus a differentiable transform.
  • Characteristic functions that agree on an interval need not agree. Uniqueness requires agreement on all of R\mathbb{R}. Grimmett and Stirzaker's footnote to Corollary (5.9.3) records that agreement on a bounded interval is not enough and points to their Problem (5.12.27)(b) (Grimmett & Stirzaker (2020), §5.12, Problem 27(b), p. 234), which supplies the pair: one continuous distribution and one discrete distribution whose characteristic functions coincide on [−π,π][-\pi,\pi] and then part company, the discrete one being periodic. So matching transforms over a finite band of frequencies identifies nothing.
  • The modulus is not a characteristic function. Property 9 gives ∣φ∣2\lvert\varphi\rvert^{2} but stops there; Grimmett and Stirzaker's exercise asks for an example where ∣φ∣\lvert\varphi\rvert fails. The class of characteristic functions is a convex set, closed under products and under conjugation, but not under square roots. It is not a cone: every characteristic function satisfies φ(0)=1\varphi(0)=1, so λφ\lambda\varphi is again one only for λ=1\lambda=1. The cone is Reed and Simon's larger class of functions of positive type, of which the characteristic functions are exactly the members normalised at the origin.
  • φ(t)=M(it)\varphi(t)=M(it) is a theorem, not a definition. Riley, Hobson and Bence state the relation flatly, and it is correct wherever MM is finite. But MM may be finite only at t=0t=0 - the Cauchy case - and then the formula says nothing, while φ(t)=e−∣t∣\varphi(t)=e^{-\lvert t\rvert} exists and is perfectly well behaved. Grimmett and Stirzaker's Theorem (5.7.12) states the precise conditions under which the analytic continuation is legitimate: ∣M(t)∣<∞\lvert M(t)\rvert<\infty for ∣t∣<a\lvert t\rvert<a is equivalent to φ\varphi being analytic on the strip ∣Im⁡z∣<a\lvert\operatorname{Im}z\rvert<a. Treating ii as a real number inside an integral is not a proof even when the answer is right, a point they make twice.
  • Two notational hazards. The analysts' "characteristic function" is the indicator function, as Folland's dictionary records; and the probabilists' sign convention ∫e+itxdF\int e^{+itx}dF is opposite to this handbook's forward Fourier transform, while Reed and Simon add a factor (2π)−n/2(2\pi)^{-n/2}. Any formula imported from a Fourier text must be converted before use, by the dictionary given in the definition block.
Method(Using characteristic functions)Original
  1. Write down φ\varphi for each ingredient, from the table or by direct integration. For a density supported on a half-line, the integral is usually a contour integral or a Laplace transform in disguise; for a bounded discrete variable it is a finite sum.
  2. Combine. Independent sums multiply (property 6); affine maps contribute a phase and rescale the argument (property 5); mixtures mix. A standardised sum (Sn−nμ)/(σn)(S_n - n\mu)/(\sigma\sqrt n) therefore has characteristic function e−itnμ/σ[φX(t/(σn))]ne^{-it\sqrt n\mu/\sigma}\bigl[\varphi_X\bigl(t/(\sigma\sqrt n)\bigr)\bigr]^{n}, which is the opening line of the proof of the central limit theorem.
  3. Identify or invert. If the result is in the table, uniqueness finishes the job. Otherwise, if ∫∣φ∣<∞\int\lvert\varphi\rvert<\infty, recover the density from f(x)=12π∫e−itxφ(t) dtf(x)=\tfrac1{2\pi}\int e^{-itx}\varphi(t)\,dt; for a lattice variable, use the general inversion formula or extract the coefficient directly.
  4. For a limit, take the pointwise limit of φn\varphi_n and check continuity at 00. If the limit is continuous at the origin, the continuity theorem converts it into convergence in distribution. If it is not, there is no limit law and mass is escaping.
  5. For moments, expand near 00. Match coefficients against ∑jE(Xj)(it)j/j!\sum_j \mathbb{E}(X^{j})(it)^{j}/j!; the coefficient of tjt^{j} is ijE(Xj)/j!i^{j}\mathbb{E}(X^{j})/j!.
  6. Check. φ(0)=1\varphi(0)=1 and ∣φ(t)∣≤1\lvert\varphi(t)\rvert\le1 must hold; if XX is real and symmetric, φ\varphi must be real and even; the small-tt expansion must reproduce the mean and variance you already know; and a corner or other non-smoothness at t=0t=0 signals an infinite moment of the corresponding order.
Example(The sum of two uniforms, by inversion)Original

Let XX and YY be independent, each uniform on [−1,1][-1,1], and let S=X+YS = X+Y.

Step 1: the characteristic function of one summand. The density is 12\tfrac12 on [−1,1][-1,1], so for t≠0t\ne0

φX(t)=∫−1112eitx dx=12⋅eit−e−itit=sin⁡tt,\varphi_X(t) = \int_{-1}^{1}\frac12 e^{itx}\,dx = \frac{1}{2}\cdot\frac{e^{it}-e^{-it}}{it} = \frac{\sin t}{t} ,

and φX(0)=1\varphi_X(0)=1, which is the limit of sin⁡t/t\sin t/t, so φX(t)=sinc⁡t\varphi_X(t) = \operatorname{sinc} t is continuous everywhere. Two checks: φX\varphi_X is real and even, as property 8 requires for a symmetric variable, and ∣φX(t)∣≤1\lvert\varphi_X(t)\rvert\le1.

Step 2: the characteristic function of the sum. By property 6,

φS(t)=φX(t)φY(t)=sin⁡2tt2.\varphi_S(t) = \varphi_X(t)\varphi_Y(t) = \frac{\sin^{2}t}{t^{2}} .

Step 3: moments from the expansion. Using sin⁡t/t=1−t2/6+t4/120−⋯\sin t/t = 1 - t^{2}/6 + t^{4}/120 - \cdots and squaring,

φS(t)=1−t23+2t445+O(t6).\varphi_S(t) = 1 - \frac{t^{2}}{3} + \frac{2t^{4}}{45} + O(t^{6}) .

Matching against ∑jE(Sj)(it)j/j!\sum_j \mathbb{E}(S^{j})(it)^{j}/j!: the coefficient of t2t^{2} is −E(S2)/2-\mathbb{E}(S^{2})/2, so E(S2)=2/3\mathbb{E}(S^{2}) = 2/3; the coefficient of t4t^{4} is E(S4)/24\mathbb{E}(S^{4})/24, so

E(S4)=24⋅245=1615=1.06667.\mathbb{E}(S^{4}) = 24\cdot\frac{2}{45} = \frac{16}{15} = 1.06667 .

Both agree with a direct computation: var⁡(X)=13\operatorname{var}(X)=\tfrac13 so E(S2)=13+13=23\mathbb{E}(S^{2}) = \tfrac13+\tfrac13 = \tfrac23, and E(S4)=E(X4)+6E(X2)E(Y2)+E(Y4)=15+6⋅19+15=1615\mathbb{E}(S^{4}) = \mathbb{E}(X^{4}) + 6\mathbb{E}(X^{2})\mathbb{E}(Y^{2}) + \mathbb{E}(Y^{4}) = \tfrac15 + 6\cdot\tfrac19 + \tfrac15 = \tfrac{16}{15}, the odd cross terms vanishing by symmetry.

Step 4: recover the density by inversion. Here ∣φS(t)∣≤min⁡(1,t−2)\lvert\varphi_S(t)\rvert \le \min(1, t^{-2}) is integrable, so the density form of the inversion theorem applies:

fS(z)  =  12π∫−∞∞e−itz sin⁡2tt2 dt  =  12π∫−∞∞cos⁡(tz) sin⁡2tt2 dt,f_S(z) \;=\; \frac{1}{2\pi}\int_{-\infty}^{\infty} e^{-itz}\,\frac{\sin^{2}t}{t^{2}}\,dt \;=\; \frac{1}{2\pi}\int_{-\infty}^{\infty} \cos(tz)\,\frac{\sin^{2}t}{t^{2}}\,dt ,

the sine part dropping out because the rest of the integrand is even. Evaluating,

  fS(z)  =  2−∣z∣4for ∣z∣≤2,fS(z)=0 otherwise.  \boxed{\;f_S(z) \;=\; \frac{2-\lvert z\rvert}{4}\quad\text{for }\lvert z\rvert\le2, \qquad f_S(z)=0 \text{ otherwise.}\;}

This is the triangular density on [−2,2][-2,2], which is also what the convolution of two uniform densities gives directly - the independent confirmation that the inversion was done correctly.

Step 5: numerical checks. At z=0z=0 the formula predicts fS(0)=12f_S(0)=\tfrac12, and indeed 12π∫sin⁡2t/t2 dt=12π⋅π=12\tfrac1{2\pi}\int \sin^{2}t/t^{2}\,dt = \tfrac{1}{2\pi}\cdot\pi = \tfrac12. At z=12z=\tfrac12 it predicts (2−0.5)/4=0.375(2-0.5)/4 = 0.375, and numerical quadrature of the inversion integral gives 0.374930.37493, agreeing to the accuracy of the quadrature. Finally

P(∣S∣≤1)=∫−112−∣z∣4 dz=2∫012−z4 dz=12(2−12)=34=0.75.\mathbb{P}\bigl(\lvert S\rvert \le 1\bigr) = \int_{-1}^{1}\frac{2-\lvert z\rvert}{4}\,dz = 2\int_{0}^{1}\frac{2-z}{4}\,dz = \frac12\Bigl(2 - \frac12\Bigr) = \frac34 = 0.75 .

(Every value in this example was verified symbolically and, where an integral was involved, numerically as well.)

Step 6: a contrast. Repeat the calculation with XX and YY independent Cauchy variables. Then φX(t)=e−∣t∣\varphi_X(t)=e^{-\lvert t\rvert}, so φS(t)=e−2∣t∣\varphi_{S}(t) = e^{-2\lvert t\rvert} and, by property 5, the average Z=12SZ = \tfrac12 S has φZ(t)=φS(t/2)=e−∣t∣\varphi_Z(t) = \varphi_S(t/2) = e^{-\lvert t\rvert}: the average of two independent Cauchy variables is again Cauchy, with no narrowing whatever. Grimmett and Stirzaker set this as a problem and ask why it does not violate the law of large numbers; the answer is that the Cauchy law has no mean, so Laws of large numbers does not apply. The corner of e−∣t∣e^{-\lvert t\rvert} at t=0t=0 is where that failure is visible.

Application(Limit theorems, lineshapes and scattering)Original

The central limit theorem and its relatives. The standard proof - expand φ\varphi to second order, raise to the nnth power, take the limit, apply the continuity theorem - is carried out in The central limit theorem. The same three steps give the Poisson limit of the binomial, the convergence of a standardised Poisson or gamma variable to the normal, and the stable laws that arise when the variance is infinite; the Cauchy calculation in step 6 above is the simplest stable law other than the normal.

Infinitely divisible laws and Lévy processes. A law is infinitely divisible when φ=(φn)n\varphi = (\varphi_n)^{n} for a characteristic function φn\varphi_n, at every nn; the Lévy-Khinchin formula classifies all such φ\varphi. These are exactly the laws that can be the increment distributions of a process with stationary independent increments, which is how Brownian motion and the jump processes of mathematical finance and of anomalous diffusion are built.

Spectral lineshapes. The intensity profile of a spectral line is the Fourier transform of the correlation function of the emitting dipole, which is a characteristic function in disguise. Doppler broadening, which convolves the emission with a Maxwellian velocity distribution, multiplies transforms and gives a Gaussian profile; collisional broadening gives a Lorentzian, which is the Cauchy density, with the non-differentiability of e−∣t∣e^{-\lvert t\rvert} at the origin corresponding to the infinite second moment of a Lorentzian line. A Voigt profile is the convolution of the two, and is handled by multiplying e−σ2t2/2e^{-\sigma^{2}t^{2}/2} by e−γ∣t∣e^{-\gamma\lvert t\rvert}.

Scattering and structure factors. In diffraction from a disordered medium, the scattered amplitude at wavevector qq is E(eiq⋅R)\mathbb{E}(e^{iq\cdot R}) for the distribution of scatterer positions RR - a characteristic function evaluated at the momentum transfer. The Debye-Waller factor e−q2⟨u2⟩/2e^{-q^{2}\langle u^{2}\rangle/2} is exactly the characteristic function of a Gaussian displacement, and the intermediate scattering function measured in neutron spin-echo experiments is φΔR(τ)(q)\varphi_{\Delta R(\tau)}(q) for the displacement over time τ\tau.

Random walks and Fourier methods. The position after nn steps of a random walk has characteristic function φstep(t)n\varphi_{\text{step}}(t)^{n}, so lattice Green functions, recurrence criteria and first-passage results in Random walks are all obtained by contour integration of a power of one transform. The same device, in the form of the structure function, underlies the numerical solution of master equations by Fourier transform.