Chapter 1
Chapter 1
Course 2022/2023
Contents
1 Random variable
2 Random vector
Two-dimensional random vector
N-dimensional random vector
3 Exercises
FX (x ) = P (X Æ x ) , ’x œ R
Discrete RV
ÿ
µX = E (X ) = xpX (x )
xœ X
ÿ ÿ
‡X2 = Var(X ) = (x ≠ µX )2 pX (x ) = x 2 pX (x ) ≠µ2X
xœ X xœ X
¸ ˚˙ ˝ ¸ ˚˙ ˝
E [(X ≠µX )2 ] E (X 2 )
Moments
µY = E (Y ) = E (aX + b) = aE (X ) + b = aµX + b
Ë È
‡Y2 = Var (Y ) = Var (aX + b) = E (Y ≠ µY )2
Ë È Ë È
2
= E (aX + ◆
b ≠ aµX ≠ ◆
b) = a2 E (X ≠ µX )2 = a2 ‡X2
0.9
0.35
0.8
0.3
0.7
0.25
0.6
0.2 0.5
0.4
0.15
0.3
0.1
0.2
0.05
0.1
0 0
-3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3
ΩX
X1
FX1 (x1 ) = FX1 ,X2 (x1 , Œ) FX2 (x2 ) = FX1 ,X2 (Œ, x2 )
Œ Œ
fX1 (x1 ) = fX1 ,X2 (x1 , x2 ) dx2 fX2 (x2 ) = fX1 ,X2 (x1 , x2 ) dx1
≠Œ ≠Œ
ÿ ÿ
pX1 (x1 ) = pX1 ,X2 (x1 , x2 ) pX2 (x2 ) = pX1 ,X2 (x1 , x2 )
x2 œ X2 x1 œ X1
Discrete RVs:
pX1 ,X2 (x1 , x2 )
pX1 (x1 | x2 ) © pX1 (x1 | X2 = x2 ) =
pX2 (x2 )
pX1 ,X2 (x1 , x2 )
pX2 (x2 | x1 ) © pX2 (x2 | X1 = x1 ) =
pX1 (x1 )
Correlation:
I Œ Œ
x1 x2 fX1 ,X2 (x1 , x2 )dx1 dx2 continuous
RX1 X2 = E (X1 X2 ) = q≠Œ
q ≠Œ
(x1 ,x2 )œ X
x1 x2 pX1 ,X2 (x1 , x2 ) discrete
Correlation matrix
C ! " D AC D B
E X12 E (X X )
! 1 2 "2
X1 1 2
RX = =E [X1 X2 ] = E XXT
E (X2 X1 ) E X2 X2
Dept. SSR (ETSIT-UPM) Random variables Course 2022/2023 14 / 47
Bidimensional random vector. Moments III
Covariance matrix
5 6 5 6
Var (X1 ) Cov (X1 , X2 ) ‡X2 1 flX1 X2 ‡X1 ‡X2
CX = =
Cov (X2 , X1 ) Var (X2 ) flX 1 X 2 ‡ X 1 ‡ X 2 ‡X2 2
# $
= E (X ≠ µX )(X ≠ µX ) = RX ≠ µX µT
T
X
RX = RT
X
CX = CT
X
Positive semi-definite: ’a œ R2
aT RX a Ø 0
aT CX a Ø 0
Dept. SSR (ETSIT-UPM) Random variables Course 2022/2023 15 / 47
Bidimensional random vector. Moments IV
Cross-covariance vector
C D
Cov (X1 , Y )
cXY = E [(X ≠ µX )(Y ≠ µY )] =
Cov (X2 , Y )
Cross-covariance matrices
5 6
# $ Cov (X1 , Y1 ) Cov (X1 , Y2 )
CXY = E (X ≠ µX )(Y ≠ µY )T =
Cov (X2 , Y1 ) Cov (X2 , Y2 )
5 6
# $ Cov (Y1 , X1 ) Cov (Y1 , X2 )
CYX = E (Y ≠ µY )(X ≠ µX )T = = CT
Cov (Y2 , X1 ) Cov (Y2 , X2 ) XY
CXY = RXY ≠ µX µT
Y
fX1 ,X2 (x1 , x2 ) = fX1 (x1 )fX2 (x2 ) ’x1 , x2 œ R (continuous RVs)
pX1 ,X2 (x1 , x2 ) = pX1 (x1 )pX2 (x2 ) ’(x1 , x2 ) œ X (discrete RVs)
or:
Continuous: Discrete:
fX1 (x1 | x2 ) = fX1 (x1 ) ’x1 , x2 pX1 (x1 | x2 ) = pX1 (x1 ) ’x1 , x2
fX2 (x2 | x1 ) = fX2 (x2 ) ’x1 , x2 pX2 (x2 | x1 ) = pX2 (x2 ) ’x1 , x2
where a = [a1 , a2 ]T
Variance
‡Y2 = Var (Y ) = a12 Var(X1 ) + a22 Var(X2 ) + 2a1 a2 Cov (X1 , X2 )
1 2
‡Y2 = Var (Y ) = Var aT X + b = aT CX a
Y = AX + b
with C D C D
a11 a12 b1
A= b=
a21 a22 b2
Moments of Y = AX + b
where
where x = [x1 , x2 ]T and parameters µX and CX are the mean vector and
covariance matrix.
Theorem: If X ≥ N (µX , CX ) and Y = AX + b, we obtain:
Y ≥ N (µY , CY ), with µY = AµX + b, CY = ACX AT
(x1 ≠µ1 )2
Œ
1 ≠
2‡ 2
fX1 (x1 ) = fX1 ,X2 (x1 , x2 )dx2 = Ò e 1
≠Œ 2fi‡12
(x2 ≠µ2 )2
Œ
1 ≠
2‡ 2
fX2 (x2 ) = fX1 ,X2 (x1 , x2 )dx1 = Ò e 2
≠Œ 2fi‡22
2
(x1 ≠µX1 |X2 )
fX ,X (x1 , x2 ) 1 ≠
2‡ 2
fX1 (x1 | x2 ) = 1 2 =Ò e X1 |X2
fX2 (x2 ) 2fi‡X2 1 |X2
where
‡1
µX1 |X2 = E (X1 |X2 = x2 ) = µ1 + fl (x2 ≠ µ2 )
‡2
1 2
‡X2 1 |X2 = Var (X1 |X2 = x2 ) = ‡12 1 ≠ fl2
X = [X1 , X2 , . . . , XN ] T
where x = [x1 , x2 , . . . , xN ]T
f (x1 , x2 , . . . , xN )
fX1 (x1 | x2 , x3 , . . . , xN ) =
f (x2 , x3 , . . . , xN )
p(x1 , x2 , . . . , xN )
pX1 (x1 | x2 , x3 , . . . , xN ) =
p(x2 , x3 , . . . , xN )
Conditional moments
E (X1 | X2 = x2 , X3 = x3 , . . . , XN = xN ) =
I Œ
x f (x | x2 , x3 , . . . , xN )dx1
≠Œ 1 X1 1
continuous
= q
x1 œ X x1 pX1 (x1 | x2 , x3 , . . . , xN )
1
discrete
Var (X1 | X2 = x2 , X3 = x3 , . . . , XN = xN ) =
E (X12 | X2 = x2 , X3 = x3 , . . . , XN = xN )≠E 2 (X1 | X2 = x2 , , X3 = x3 , . . . , XN = xN )
Discrete RV
T
p(x1 , x2 , . . . , xN ) = pX1 (x1 )pX2 (x2 ) · · · pXN (xN ) ’ [x1 , x2 , . . . , xN ] œ X
Y = g(X1 , X2 , . . . , XN ) © g(X)
Moments
If X1 , X2 , . . . , XN are continuous Rvs:
where a = [a1 , a2 , . . . , aN ]T
E (aT X + b) = aT µX + b = µT
Xa + b
N
ÿ N ÿ
ÿ N
Var(aT X + b) = ai2 Var(Xi ) + ai aj Cov(Xi , Xj )
i=1 i=1 j=1
j”=i
= aT CX a
If X1 , X2 , . . . , XN are uncorrelated:
Var(a1 X1 + a2 X2 + · · · + aN XN + b) = a12 Var(X1 ) + a22 Var(X2 ) + · · · + aN2 Var(XN )
Y = g(X)
where X = [X1 , X2 , . . . , XN ]T , Y = [Y1 , Y2 , . . . , YM ]T and
g = [g1 (·), g2 (·), . . . , gM (·)]T
Case study: M linear transformations
Y = AX + b
µY = AµX + b
CY = ACX AT
CXY = CX AT
CYX = ACX = CT
XY
Let us consider
! "
that we have a (non observable) Gaussian random variable
Y ≥ N 0, ‡Y2 from whom we obtain two other observed random
variables X1 , X2 defined as follows:
X1 = AY + B
X2 = AY 2 + D
! " ! " ! "
where A ≥ N µA , ‡A2 , B ≥ N 0, ‡B2 and D ≥ N 0, ‡D 2 are also
# $ # $
a) Calculate the following statistics: E X12 , E X22 , E [YX1 ], E [YX2 ] ,
E [X1 X2 ]. Verify that E [X1 X2 ] = 0 , E [YX2 ] = 0.
d› d›
b) Calculate the equations d– = 0 and d— = 0 expressing the result just in
terms of those statistics found in a) (it is not necessary to substitute).
c) Calculate –, — expressing the results just in terms of previous statistics
found in a). Assume that E [X1 X2 ] = 0 , E [YX2 ] = !
0. "
Note : If Z is a Gaussian
# 2$
random #variable
$
Z ≥#N $0, ‡Z2 , we have the
following results: E Z = ‡Z , E Z = 0, E Z 4 = 3‡Z4 .
2 3
Therefore
ˆ› Ë È
= 0 =∆ E [YX1 ] ≠ –E X12 ≠ —E [X1 X2 ] = 0
ˆ–
ˆ› Ë È
= 0 =∆ E [YX2 ] ≠ –E [X1 X2 ] ≠ —E X22 = 0
ˆ—
ˆ› :0
⇠
⇠2⇠ ⇠⇠:0 Ë È
2
= 0 =∆ ⇠
E⇠[YX ] ≠ –⇠
E⇠[X⇠
1 X2 ] ≠ —E X2 = 0 =∆ — = 0
ˆ—
ˆ› Ë È
⇠⇠:0
= 0 =∆ E [YX1 ] ≠ –E X12 ≠ —⇠ E⇠
[X⇠1 X2 ] = 0 =∆
ˆ–
E [YX1 ] µA ‡Y2
=∆ – = # 2 $ =∆ – = ! 2 "
E X1 µA + ‡A2 ‡Y2 + ‡B2
*0 *0
µX = E (X) = E (HY + Z) = HE (Y) + E (Z) = 0
Ë È Ë È
CXY = E (X ≠ µX ) (Y ≠ µY )T = E XYT = RXY
Ë È Ë È
CX = E (X ≠ µX ) (X ≠ µX )T = E XXT = RX