Tutorials › Stochastic Processes › Taking Out What Is Known

Random Variables, Expectation and Conditional Expectation · Tutorial 22 of 994

Taking Out What Is Known

Learn to identify what is known under conditioning, justify taking it outside an expectation, and check the rule in discrete and continuous models.

Intermediate 12 min read

What You'll Learn

  • State the pull-out identity and the integrability conditions that make it valid.
  • Prove the identity on each positive-probability atom of a finite partition.
  • Apply the rule when conditioning on a discrete random variable.
  • Derive the corresponding calculation from a conditional density.
  • Distinguish a known factor from an independent factor or an arbitrary random variable.

What “Known” Means Under Conditioning

Conditional expectation summarizes an average using specified information. If a factor is already determined by that information, it does not need to be averaged again: it can be kept outside the conditional expectation. The important qualification is “already determined.” A factor that is random overall may be known once we condition, while a factor that is not determined by the conditioning information generally cannot be taken out.

Work on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). For a sigma-algebra \(\mathcal{G}\subseteq\mathcal{F}\), the conditional expectation \(\mathbb{E}[Y\mid\mathcal{G}]\) of an integrable random variable \(Y\) is a \(\mathcal{G}\)-measurable random variable satisfying \(\mathbb{E}[\mathbf{1}_A\mathbb{E}[Y\mid\mathcal{G}]]=\mathbb{E}[\mathbf{1}_A Y]\) for every \(A\in\mathcal{G}\). It is unique up to equality almost surely. Thus all identities between conditional expectations below mean equality almost surely.

Definition: A random variable \(Z\) is known under conditioning on \(\mathcal{G}\) when \(Z\) is \(\mathcal{G}\)-measurable. In the pull-out identity, assume \(Y\) is integrable and \(\mathbb{E}|ZY|<\infty\). Then \(Z\mathbb{E}[Y\mid\mathcal{G}]\) is integrable, and \(\mathbb{E}[ZY\mid\mathcal{G}]=Z\mathbb{E}[Y\mid\mathcal{G}]\) almost surely.

The product integrability condition matters when \(Z\) is unbounded: it ensures that the conditional expectation on the left exists. It also ensures that the right-hand side is integrable. For example, the identity always applies when \(Z\) is bounded and \(Y\) is integrable. If \(Z\) is not bounded, check \(\mathbb{E}|ZY|<\infty\) before using the rule.

The Identity on a Finite Partition

Let \(\mathcal{G}\) be generated by a finite partition \(A_1,\ldots,A_r\) of \(\Omega\), where the sets are disjoint and their union is \(\Omega\). On every atom \(A_k\) with \(\mathbb{P}(A_k)>0\), the conditional expectation is constant and equals \(\mathbb{E}[Y\mid A_k]=\mathbb{E}[\mathbf{1}_{A_k}Y]/\mathbb{P}(A_k)\). Atoms of probability zero do not affect an almost-sure identity; a version of the conditional expectation can be assigned any value there.

Theorem (Pulling out a known factor on a finite partition): Suppose \(Y\) is integrable, \(Z\) is constant on each atom of a finite partition generating \(\mathcal{G}\), and \(\mathbb{E}|ZY|<\infty\). Then \(\mathbb{E}[ZY\mid\mathcal{G}]=Z\mathbb{E}[Y\mid\mathcal{G}]\) almost surely.

Proof. Fix an atom \(A_k\) of positive probability. Since \(Z\) is constant on \(A_k\), write its value there as \(z_k\). The conditional expectation of the product on this atom is \(\mathbb{E}[\mathbf{1}_{A_k}ZY]/\mathbb{P}(A_k)=z_k\mathbb{E}[\mathbf{1}_{A_k}Y]/\mathbb{P}(A_k)\). The last expression is \(z_k\mathbb{E}[Y\mid A_k]\), which is the value of \(Z\mathbb{E}[Y\mid\mathcal{G}]\) on \(A_k\). This holds on every positive-probability atom. The union of the zero-probability atoms has probability zero because there are finitely many, so the equality holds almost surely. \(\square\)

Worked Example: A Factor Constant on Each Partition Atom

Let \(\Omega=\{\omega_1,\omega_2,\omega_3,\omega_4\}\), with probability \(1/4\) on each outcome. Let the conditioning partition be \(A=\{\omega_1,\omega_2\}\) and \(B=\{\omega_3,\omega_4\}\). Suppose \(Y\) takes the values \(1,3,2,6\), respectively, and \(Z=2\) on \(A\) and \(Z=-1\) on \(B\). The factor \(Z\) is known from the partition.

On \(A\), \(\mathbb{P}(A)=2/4=1/2\) and \(\mathbb{E}[Y\mid A]=((1/4)\cdot1+(1/4)\cdot3)/(1/2)=1\). On \(B\), \(\mathbb{P}(B)=1/2\) and \(\mathbb{E}[Y\mid B]=((1/4)\cdot2+(1/4)\cdot6)/(1/2)=4\). Thus \(\mathbb{E}[Y\mid\mathcal{G}]\) is \(2\) on \(A\) and \(4\) on \(B\).

For the product, \(ZY\) takes values \(2,6,-2,-6\). Its conditional mean on \(A\) is \((2+6)/2=4\), and on \(B\) it is \((-2-6)/2=-4\). Pulling out \(Z\) gives \(2\cdot2=4\) on \(A\) and \((-1)\cdot4=-4\) on \(B\), as required.

Check: The unconditional product mean is \((2+6-2-6)/4=0\). The mean of the conditional product is \((1/2)\cdot4+(1/2)\cdot(-4)=0\), agreeing with it.

Conditioning on a Discrete Random Variable

If \(U\) is a discrete random variable, conditioning on \(U\) means conditioning on the sigma-algebra generated by \(U\). A random variable of the form \(h(U)\) is known under this conditioning. For each value \(u\) with \(\mathbb{P}(U=u)>0\), the conditional expectation is computed using the conditional distribution given \(U=u\). The partition result applies to any finite collection of such values; for countably many values, the same calculation holds separately on each positive-probability event \(\{U=u\}\).

Proof for the countable discrete case. On an event \(\{U=u\}\) of positive probability, \(h(U)=h(u)\) is constant. Therefore \(\mathbb{E}[ZY\mid U=u]=\mathbb{E}[h(u)Y\mid U=u]=h(u)\mathbb{E}[Y\mid U=u]\), by the defining conditional-mean calculation on that event. The union of the countably many zero-probability events \(\{U=u\}\) has probability zero, since its probability is at most the sum of their probabilities, which is zero. Hence the identity holds almost surely.

Worked Example: A Product Given a Discrete Variable

Let \(U\) take values \(1\) and \(2\), with probabilities \(1/3\) and \(2/3\). Given \(U=1\), let \(Y\) equal \(0\) or \(2\), each with probability \(1/2\). Given \(U=2\), let \(Y\) equal \(1\) with probability \(1/4\) and \(5\) with probability \(3/4\). Each conditional probability row sums to \(1\): \(1/2+1/2=1\) and \(1/4+3/4=1\). Take \(Z=U+1\), which is known when \(U\) is given.

For \(U=1\), the conditional mean is \(\mathbb{E}[Y\mid U=1]=(1/2)\cdot0+(1/2)\cdot2=1\). For \(U=2\), it is \(\mathbb{E}[Y\mid U=2]=(1/4)\cdot1+(3/4)\cdot5=1/4+15/4=4\). The factor \(Z\) is \(2\) when \(U=1\) and \(3\) when \(U=2\). Therefore the pull-out identity gives conditional product means \(2\cdot1=2\) and \(3\cdot4=12\), respectively.

Directly, when \(U=1\), \(ZY\) is \(0\) or \(4\), each with conditional probability \(1/2\), so its conditional mean is \(2\). When \(U=2\), \(ZY\) is \(3\) or \(15\), with conditional probabilities \(1/4\) and \(3/4\); its conditional mean is \((1/4)\cdot3+(3/4)\cdot15=3/4+45/4=12\).

Check: The unconditional mean of \(ZY\) is \((1/3)\cdot2+(2/3)\cdot12=2/3+8=26/3\). The unconditional mean obtained from the conditional product means is also \(26/3\).

Why the Identity Holds in General

The finite-partition computation extends to any conditioning sigma-algebra. Here are the key steps of the argument. First, for bounded \(\mathcal{G}\)-measurable \(Z\), the defining property of conditional expectation gives \(\mathbb{E}[\mathbf{1}_A ZY]=\mathbb{E}[\mathbf{1}_A Z\mathbb{E}[Y\mid\mathcal{G}]]\) for every \(A\in\mathcal{G}\). To see this, the defining property first gives the equality when \(\mathbf{1}_A Z\) is a simple \(\mathcal{G}\)-measurable function, by adding the equalities on its level sets. A bounded measurable function can be approximated by bounded simple functions, and the expectations converge because \(Y\) and \(\mathbb{E}[Y\mid\mathcal{G}]\) are integrable. Thus \(Z\mathbb{E}[Y\mid\mathcal{G}]\) satisfies the defining property for \(\mathbb{E}[ZY\mid\mathcal{G}]\).

For unbounded \(Z\), use the bounded truncations \(Z_m=\max(-m,\min(Z,m))\). They are \(\mathcal{G}\)-measurable and converge to \(Z\). Under \(\mathbb{E}|ZY|<\infty\), the truncation error satisfies \(\mathbb{E}|(Z_m-Z)Y|\to0\), by dominated convergence: it converges pointwise to zero and is bounded by \(|ZY|\). Also \(\mathbb{E}[|Z||\mathbb{E}[Y\mid\mathcal{G}]|]\leq\mathbb{E}|ZY|\). Indeed, \(|\mathbb{E}[Y\mid\mathcal{G}]|\leq\mathbb{E}[|Y|\mid\mathcal{G}]\); multiplying by the bounded \(\mathcal{G}\)-measurable variable \(|Z|\wedge m\), using the bounded-factor identity, and then taking \(m\) to infinity proves the inequality. Consequently both sides of the bounded-factor identity converge in \(L^1\) to the corresponding sides with \(Z\), proving the stated general identity.

For conditioning through a density, the same rule can be seen directly from conditional integration. Suppose \(X\) has density \(f_X\), and \(Y\) has conditional density \(f_{Y\mid X}(y\mid x)\) for \(f_X\)-almost every \(x\). If the relevant integrals exist, then \(\mathbb{E}[Y\mid X=x]=\int y f_{Y\mid X}(y\mid x)\,dy\). Since \(h(X)=h(x)\) when \(X=x\), the conditional integral for the product is \(\int h(x)y f_{Y\mid X}(y\mid x)\,dy=h(x)\int y f_{Y\mid X}(y\mid x)\,dy\). This establishes the pull-out rule for such conditional-density calculations. Conditional densities and their conditional expectations need only be specified for almost every \(x\) under the distribution of \(X\); values where \(f_X(x)=0\) do not change the almost-sure identity.

Worked Example: Pulling Out a Function of a Continuous Variable

Let \(X\) be uniform on \((0,1)\). Given \(X=x\), let \(Y\) be uniform on \((0,x)\), for \(0<x<1\). The conditional density is \(f_{Y\mid X}(y\mid x)=1/x\) for \(0<y<x\), and zero otherwise. Its integral is \(\int_0^x(1/x)\,dy=1\). Take \(Z=X^2\), a factor known when \(X\) is given.

First compute the conditional mean of \(Y\): \(\mathbb{E}[Y\mid X=x]=\int_0^x y(1/x)\,dy=(1/x)(x^2/2)=x/2\). Thus the pull-out rule predicts \(\mathbb{E}[X^2Y\mid X]=X^2(X/2)=X^3/2\).

Direct conditional integration gives \(\mathbb{E}[X^2Y\mid X=x]=\int_0^x x^2y(1/x)\,dy=x\int_0^x y\,dy=x(x^2/2)=x^3/2\). The two calculations agree for every \(x\) in the model's range. Averaging over \(X\), the conditional answer has mean \(\int_0^1(x^3/2)\,dx=1/8\).

Check: The joint density is \(1/x\) on \(0<y<x<1\), since \(f_X(x)=1\). Direct integration gives \(\mathbb{E}[X^2Y]=\int_0^1\int_0^x x^2y(1/x)\,dy\,dx=\int_0^1x^3/2\,dx=1/8\), the same value.

Common Missteps and Practical Checks

The rule is about information, not independence. A variable \(Z\) can depend strongly on \(Y\) and still be pulled out if \(Z\) is measurable with respect to the conditioning information. Conversely, independence alone does not mean \(Z\) is known after conditioning on some other variable.

Common mistake. In the discrete example, one might incorrectly write \(\mathbb{E}[(U+1)Y\mid U=2]=3\mathbb{E}[Y]\), using the unconditional mean of \(Y\). The unconditional mean is \(\mathbb{E}[Y]=(1/3)\cdot1+(2/3)\cdot4=3\), so that incorrect calculation gives \(3\cdot3=9\). The correct calculation uses the conditional mean given \(U=2\): \(\mathbb{E}[(U+1)Y\mid U=2]=3\mathbb{E}[Y\mid U=2]=3\cdot4=12\). The known factor is pulled out, but the remaining expectation stays conditional.

Another error is to pull out a factor that is not known. In general, \(\mathbb{E}[ZY\mid\mathcal{G}]\) cannot be replaced by \(Z\mathbb{E}[Y\mid\mathcal{G}]\) unless \(Z\) is \(\mathcal{G}\)-measurable (or some additional, separately justified condition applies). Before using the identity, check three things: what information is being conditioned on, whether the proposed factor is measurable with respect to it, and whether the product is integrable.

Check Your Understanding

For each question, identify what is known under the conditioning and state any integrability or positive-probability condition needed.

  1. On a finite partition, \(Z\) has value \(5\) on an atom \(A\) with \(\mathbb{P}(A)>0\), and \(\mathbb{E}[Y\mid A]=-2\). Find \(\mathbb{E}[ZY\mid A]\).
  2. If \(U\) is discrete and \(h\) is a function, write the pull-out identity for \(\mathbb{E}[h(U)Y\mid U]\).
  3. In the continuous example, replace \(X^2\) by \(X\). Compute \(\mathbb{E}[XY\mid X=x]\) from the conditional density.
  4. Why is \(3\mathbb{E}[Y]\) not the correct calculation for \(\mathbb{E}[(U+1)Y\mid U=2]\) in the discrete example?
  5. State the product-integrability condition used for an unbounded known factor \(Z\).