Professional Documents
Culture Documents
Expectation
Expectation
Paul Rognon
1 / 19
Expectation of a random variable
For example:
• if X ∼ Bern(p) then E(X ) = p,
• if X ∼ N(0, 1) then E(X ) = 0.
2 / 19
Higher order moments
k-th moment of X (k ≥ 1)
E(X k ) is the k-th moment, if it exists.
E(X − E(X ))k is the k-th central moment, if it exists.
Variance
The variance var(X ) is the the second central moment
• var(X ) = E[(X − E(X ))2 ] = E(X 2 ) − (E(X ))2
• var(aX + b) = a2 var(X )
ai2 var(Xi )
P P
• (Xi )i...k independent then var( i ai Xi ) = i
p
The standard deviation is defined as sd(X ) = σx = var(X )
Expectation g (X )
For any mesurable function g , if the expectation E (g (X )) exists,
Z X
E(g (X )) = g (x)fX (x)dx or E(g (X )) = g (x)fX (x)dx
R R
3 / 19
Exercises
4 / 19
Covariance
The covariance cov(X , Y ) between two random variables X and Y is
defined by:
It is a measure of dependence:
• X⊥
⊥ Y =⇒ cov(X , Y ) = 0
• cov(X , Y ) ̸= 0 =⇒ X , Y are not independent
The correlation ρ(X , Y ) is a standardized covariance and measure of
dependence
cov(X , Y )
ρ(X , Y ) = p ∈ [−1, 1].
var(X )var(Y )
• var(X ) = cov(X , X ) ≥ 0
• Symmetry: cov(X , Y ) = cov(Y , X )
• cov(X + a, Y + b) = cov(X , Y )
• Bilinearity: cov(aX + bY , Z ) = a cov(X , Z ) + b cov(Y , Z )
• var(X + Y ) = var(X ) + var(Y ) + 2cov(X , Y ), and
var(X − Y ) = var(X ) + var(Y ) − 2cov(X , Y )
• morePgenerally, P
var ( i ai Xi ) = i ai2 var (Xi ) + 2
PP
i<j ai aj cov (Xi , Xj )
6 / 19
Exercise
There are two coins: one fair coin and one coin where head has
probability 2/3. We pick at random one coin and toss it twice. Let X be
the Bernoulli variable such that X = 1 if we picked the fair coin, T1 and
T2 be the results of the two tosses. We define T1 and T2 as Bernoulli
random variables that take the value 1 if the result is head, 0 if tail.
7 / 19
Sample moments
Let X1 , . . . , Xn be independent copies of X (random sample).
1 Pn
Sample mean: X̄n = n i=1 Xi
1 Pn
Sample variance: Sn = n−1 i=1 (Xi − X̄ )2
8 / 19
Moments of a random vector
Mean vector
Let X = (X1 , . . . , Xp ) be a vector of random variables with joint
distribution fX (x).
The expectation µ = E(X ) of X is a vector whose i-th entry is
µi = E(Xi ).
The expectation is linear: for A ∈ Rm×p , E(AX ) = A E(X )
The (variance) covariance matrix
The (variance) covariance matrix var(X ) of X is defined as:
9 / 19
Exercise
10 / 19
Multivariate sample moments
Suppose that X ∈ R n×p is a matrix of n replications of a random vector
X = (X1 , . . . , Xp ). Denote the rows of X by x (1) , . . . , x (n) .
• The sample mean vector is
n
1 X (i) 1 T
x̄ = x = 1 X ∈ Rp .
n n n
i=1
• The sample covariance (variance) matrix is
n
1 X (i)
S = (x − x̄)(x (i) − x̄)T .
n−1
i=1
The diagonal entries are sample variances of Xi and the off-diagonal
entries are sample covariances (estimators of cov(Xi , Xj )).
E(X )
P(X ≥ t) ≤ .
t
σ2
P(|X − µ| ≥ t) ≤
t2
and, in particular, P X σ−µ ≥ t ≤ 1
.
t2
Jensen’s inequality
If g : R → R convex, then E(g (X )) ≥ g (E(X )).
12 / 19
Exercise
13 / 19
Conditional expectation
14 / 19
Properties of conditional expectation
15 / 19
Exercise
Recall our coin tosses example. There are two coins: one fair coin and
one coin where head has probability 2/3. We pick at random one coin
and toss it twice.
Let X be the Bernoulli variable such that X = 1 if we picked the fair
coin, T1 and T2 be the results of the two tosses. We define T1 and T2 as
Bernoulli random variables that take the value 1 if the result is head, 0 if
tail.
If we get head in the first toss, we earn 1/2 and if get head in the second
toss, we earn 1/4. Let G be the total gain in the two tosses.
16 / 19
Moment generating function
The moment generating function when it exists is defined as:
P
i e txi P (X = xi ) for a discrete variable
t·X
MX (t) = E(e ) = R
e t·x f (x)dx for a continuous variable
R X
We have:
dMX
dt (0) = E(X ), and
more generally, M (k) (0) = E[X k ].
Properties
P
• if X1 , . . . , Xn are independent random variables and S = i Xi ,
then:
n
Y
ϕS (ω) = ϕXk (ω)
k=1
19 / 19