CS70 Guide
Search…
CS70 Guide
Welcome
LaTeX Reference
Discrete Math
Overview
Propositional Logic
Proofs
Stable Matching
Graphs
Modular Arithmetic
RSA Cryptography
Polynomials
Countability
Computability
Probability
Overview
Counting
Discrete Probability
Discrete Random Variables
Hashing and the Union Bound
Expectation and Variance
Conditional Probability and Bayes' Rule
Concentration Inequalities
Continuous Probability
Markov Chains
Extra Probability
Linear Transformations
Conditional Expectation and Variance
The Beta Family
The Gamma Family
Multivariate Normal
Prediction and Regression
Sums
Powered By
GitBook
Conditional Expectation and Variance
Properties:
Conditional Expectation
E
(
X
∣
Y
)
E(X|Y)
E
(
X
∣
Y
)
is the conditional expectation of
X
X
X
given
Y
Y
Y
E
(
X
∣
Y
=
y
)
E(X|Y=y)
E
(
X
∣
Y
=
y
)
is a fixed value, but
E
(
X
∣
Y
)
E(X|Y)
E
(
X
∣
Y
)
is a random variable (it is a function of
Y
Y
Y
)
Iterated expectation:
E
(
E
(
X
∣
Y
)
)
=
E
(
X
)
E(E(X|Y)) = E(X)
E
(
E
(
X
∣
Y
))
=
E
(
X
)
Additivity:
E
(
Y
+
Z
∣
X
)
=
E
(
Y
∣
X
)
+
E
(
Z
∣
X
)
E(Y+Z | X) = E(Y|X) + E(Z|X)
E
(
Y
+
Z
∣
X
)
=
E
(
Y
∣
X
)
+
E
(
Z
∣
X
)
does not work
on the right hand side:
E
(
Y
∣
X
+
Z
)
≠
E
(
Y
∣
X
)
+
E
(
Y
∣
Z
)
E(Y | X+Z) \ne E(Y|X) + E(Y|Z)
E
(
Y
∣
X
+
Z
)
=
E
(
Y
∣
X
)
+
E
(
Y
∣
Z
)
Linearity:
E
(
a
X
+
b
∣
Y
)
=
a
E
(
X
∣
Y
)
+
b
E(aX + b | Y) = aE(X|Y) + b
E
(
a
X
+
b
∣
Y
)
=
a
E
(
X
∣
Y
)
+
b
Conditioning on the same variable:
E
(
g
(
S
)
T
∣
S
)
=
g
(
S
)
E
(
T
∣
S
)
E(g(S)T | S) = g(S)E(T|S)
E
(
g
(
S
)
T
∣
S
)
=
g
(
S
)
E
(
T
∣
S
)
Conditional Variance
If
V
a
r
(
Y
)
Var(Y)
Va
r
(
Y
)
is difficult to find directly, we can use the
variance decomposition
to condition the variance on another variable.
V
a
r
(
Y
)
=
E
(
V
a
r
(
Y
∣
X
)
)
+
V
a
r
(
E
(
Y
∣
X
)
)
Var(Y) = E(Var(Y|X)) + Var(E(Y|X))
Va
r
(
Y
)
=
E
(
Va
r
(
Y
∣
X
))
+
Va
r
(
E
(
Y
∣
X
))
Previous
Linear Transformations
Next
The Beta Family
Last modified
1yr ago
Copy link
Contents
Conditional Expectation
Conditional Variance