Lecture 9: Variance, Covariance, Correlation Coefficient: Kate Rina Sta Nková
Lecture 9: Variance, Covariance, Correlation Coefficient: Kate Rina Sta Nková
Kateřina Staňková
Statistics (MAT1003)
May 2, 2012
beamer-tu-log
Variance Covariance Correlation coefficient
Outline
1 Variance
Definition
Standard Deviation
Variance of linear combination of RV
2 Covariance
Meaning & Definition
Examples
3 Correlation coefficient
And now . . .
1 Variance
Definition
Standard Deviation
Variance of linear combination of RV
2 Covariance
Meaning & Definition
Examples
3 Correlation coefficient
beamer-tu-log
Variance Covariance Correlation coefficient
Definition
Variance
Let X be an RV with µx = E(X ). Then the variance of X is
given by
V (X ) = E{(X − µX )2 }
beamer-tu-log
Variance Covariance Correlation coefficient
Definition
Variance
Let X be an RV with µx = E(X ). Then the variance of X is
given by
V (X ) = E{(X − µX )2 }
Notation: V (X ), Var(X ), σ 2 , σx2
| {z }
book
beamer-tu-log
Variance Covariance Correlation coefficient
Definition
Variance
Let X be an RV with µx = E(X ). Then the variance of X is
given by
V (X ) = E{(X − µX )2 }
Notation: V (X ), Var(X ), σ 2 , σx2
| {z }
book
Alternative formula
beamer-tu-log
Variance Covariance Correlation coefficient
Definition
Variance
Let X be an RV with µx = E(X ). Then the variance of X is
given by
V (X ) = E{(X − µX )2 }
Notation: V (X ), Var(X ), σ 2 , σx2
| {z }
book
Alternative formula
Observation
beamer-tu-log
Variance is always nonnegative!
Variance Covariance Correlation coefficient
Standard Deviation
Standard deviation σX
s
Square root of V (X ), i.e., σX = + V (X ) = + E(X 2 ) − µ2X
p
| {z }
V (X )
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Standard deviation σX
s
Square root of V (X ), i.e., σX = + V (X ) = + E(X 2 ) − µ2X
p
| {z }
V (X )
Example 1
X : ] eyes on a die
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Standard deviation σX
s
Square root of V (X ), i.e., σX = + V (X ) = + E(X 2 ) − µ2X
p
| {z }
V (X )
Example 1
X : ] eyes on a die
2
2 91 7 35
V (X ) = E(X ) − µ2X = − =
6 2 12
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Standard deviation σX
s
Square root of V (X ), i.e., σX = + V (X ) = + E(X 2 ) − µ2X
p
| {z }
V (X )
Example 1
X : ] eyes on a die
2
2 91 7 35
V (X ) = E(X ) − µ2X = − =
6 2 12
q
35
Standard deviation: σX = 12
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Standard deviation σX
s
Square root of V (X ), i.e., σX = + V (X ) = + E(X 2 ) − µ2X
p
| {z }
V (X )
Example 1
X : ] eyes on a die
2
2 91 7 35
V (X ) = E(X ) − µ2X = − =
6 2 12
q
35
Standard deviation: σX = 12
Example 2
n : a real number
beamer-tu-log
,
Variance Covariance Correlation coefficient
Standard Deviation
Standard deviation σX
s
Square root of V (X ), i.e., σX = + V (X ) = + E(X 2 ) − µ2X
p
| {z }
V (X )
Example 1
X : ] eyes on a die
2
2 91 7 35
V (X ) = E(X ) − µ2X = − =
6 2 12
q
35
Standard deviation: σX = 12
Example 2
n : a real number
beamer-tu-log
V (n) = E(n2 ) − µ2n = n2 − n2 = 0,
Variance Covariance Correlation coefficient
Standard Deviation
Standard deviation σX
s
Square root of V (X ), i.e., σX = + V (X ) = + E(X 2 ) − µ2X
p
| {z }
V (X )
Example 1
X : ] eyes on a die
2
2 91 7 35
V (X ) = E(X ) − µ2X = − =
6 2 12
q
35
Standard deviation: σX = 12
Example 2
n : a real number
beamer-tu-log
V (n) = E(n2 ) − µ2n = n2 − n2 = 0, σn = 0
Variance Covariance Correlation coefficient
Standard Deviation
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 3
Let X be a continuous random variable with PDF
10 10 4
g(x) = x− x , 0<x <1 (0 elsewhere)
3 3
E(X ) =
E(X 2 ) =
V (X ) = , σX =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 3
Let X be a continuous random variable with PDF
10 10 4
g(x) = x− x , 0<x <1 (0 elsewhere)
3 3
Z 1
E(X ) = x g(x)dx
0
E(X 2 ) =
V (X ) = , σX =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 3
Let X be a continuous random variable with PDF
10 10 4
g(x) = x− x , 0<x <1 (0 elsewhere)
3 3
Z 1 Z 1
10 10 4
E(X ) = x g(x)dx = x x− x dx
0 0 3 3
2
E(X ) =
V (X ) = , σX =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 3
Let X be a continuous random variable with PDF
10 10 4
g(x) = x− x , 0<x <1 (0 elsewhere)
3 3
Z 1 Z 1
10 10 4 5
E(X ) = x g(x)dx = x x− x dx =
0 0 3 3 9
2
E(X ) =
V (X ) = , σX =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 3
Let X be a continuous random variable with PDF
10 10 4
g(x) = x− x , 0<x <1 (0 elsewhere)
3 3
Z 1 Z 1
10 10 4 5
E(X ) = x g(x)dx = x x− x dx =
0 0 3 3 9
Z 1
2 2
E(X ) = x g(x)dx
0
V (X ) = , σX =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 3
Let X be a continuous random variable with PDF
10 10 4
g(x) = x− x , 0<x <1 (0 elsewhere)
3 3
Z 1 Z 1
10 10 4 5
E(X ) = x g(x)dx = x− x x dx =
0 0 3 3 9
Z 1 Z 1
10 10 4
E(X 2 ) = x 2 g(x)dx = x2 x− x dx
0 0 3 3
V (X ) = , σX =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 3
Let X be a continuous random variable with PDF
10 10 4
g(x) = x− x , 0<x <1 (0 elsewhere)
3 3
Z 1 Z 1
10 10 4 5
E(X ) = x g(x)dx = x− x x dx =
0 0 3 3 9
Z 1 Z 1
10 10 4 5
E(X 2 ) = x 2 g(x)dx = x2 x− x dx =
0 0 3 3 14
V (X ) = , σX =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 3
Let X be a continuous random variable with PDF
10 10 4
g(x) = x− x , 0<x <1 (0 elsewhere)
3 3
Z 1 Z 1
10 10 4 5
E(X ) = x g(x)dx = x− x x dx =
0 0 3 3 9
Z 1 Z 1
10 10 4 5
E(X 2 ) = x 2 g(x)dx = x2 x− x dx =
0 0 3 3 14
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 3
Let X be a continuous random variable with PDF
10 10 4
g(x) = x− x , 0<x <1 (0 elsewhere)
3 3
Z 1 Z 1
10 10 4 5
E(X ) = x g(x)dx = x−x x dx =
0 0 3 3 9
Z 1 Z 1
10 10 4 5
E(X 2 ) = x 2 g(x)dx = x2 x− x dx =
0 0 3 3 14
2
5 5
V (X ) = E(X 2 ) − (E(X ))2 = − , σX =
14 9
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 3
Let X be a continuous random variable with PDF
10 10 4
g(x) = x− x , 0<x <1 (0 elsewhere)
3 3
Z 1 Z 1
10 10 4 5
E(X ) = x g(x)dx = x−x x dx =
0 0 3 3 9
Z 1 Z 1
10 10 4 5
E(X 2 ) = x 2 g(x)dx = x2 x− x dx =
0 0 3 3 14
2
5 5 55
V (X ) = E(X 2 ) − (E(X ))2 = − = , σX =
14 9 1134
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 3
Let X be a continuous random variable with PDF
10 10 4
g(x) = x− x , 0<x <1 (0 elsewhere)
3 3
Z 1 Z 1
10 10 4 5
E(X ) = x g(x)dx = x−x x dx =
0 0 3 3 9
Z 1 Z 1
10 10 4 5
E(X 2 ) = x 2 g(x)dx = x2 x− x dx =
0 0 3 3 14
2 r
5 5 55 55
V (X ) = E(X 2 ) − (E(X ))2 = − = , σX =
14 9 1134 1134
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
,
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
E(Y ) =
E(Y 2 ) =
V (Y ) = , σY =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
Z 1
E(Y ) = y h(y )dy
0
E(Y 2 ) =
V (Y ) = , σY =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
Z 1 Z 1
E(Y ) = y h(y )dy = 5 y 5 dy
0 0
E(Y 2 ) =
V (Y ) = , σY =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
Z 1 Z 1 1
5 6
E(Y ) = y h(y )dy = 5 y 5 dy = y
0 0 6 y =0
E(Y 2 ) =
V (Y ) = , σY =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
Z 1 Z 1 1
5 6 5
E(Y ) = y h(y )dy = 5 y 5 dy = y =
0 0 6 y =0 6
E(Y 2 ) =
V (Y ) = , σY =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
Z 1 Z 1 1
5 6 5
E(Y ) = y h(y )dy = 5 y 5 dy = y =
0 0 6 y =0 6
Z 1
E(Y 2 ) = y 2 h(y )dy
0
V (Y ) = , σY =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
Z 1 Z 1 1
5 6 5
E(Y ) = y h(y )dy = 5 y 5 dy = y =
0 0 6 y =0 6
Z 1 Z 1
E(Y 2 ) = y 2 h(y )dy = 5 y 6 dy
0 0
V (Y ) = , σY =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
Z 1 Z 1 1
5 6 5
E(Y ) = y h(y )dy = 5 y 5 dy = y =
0 0 6 y =0 6
Z 1 Z 1
5
E(Y 2 ) = y 2 h(y )dy = 5 y 6 dy =
0 0 7
V (Y ) = , σY =
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
Z 1 Z 1 1
5 6 5
E(Y ) = y h(y )dy = 5 y 5 dy = y =
0 0 6 y =0 6
Z 1 Z 1
5
E(Y 2 ) = y 2 h(y )dy = 5 y 6 dy =
0 0 7
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
Z 1 Z 1 1
5 6 5
E(Y ) = y h(y )dy = 5 y 5 dy = y =
0 0 6 y =0 6
Z 1 Z 1
5
E(Y 2 ) = y 2 h(y )dy = 5 y 6 dy =
0 0 7
2
5 5
V (Y ) = E(Y 2 ) − (E(Y ))2 = − , σY =
7 6
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
Z 1 Z 1 1
5 6 5
E(Y ) = y h(y )dy = 5 y 5 dy = y =
0 0 6 y =0 6
Z 1 Z 1
5
E(Y 2 ) = y 2 h(y )dy = 5 y 6 dy =
0 0 7
2
5 5 5
V (Y ) = E(Y 2 ) − (E(Y ))2 = − = , σY =
7 6 252
beamer-tu-log
Variance Covariance Correlation coefficient
Standard Deviation
Example 4
Let
h(y ) = 5 y 4 , 0<y <1 (0 elsewhere)
Z 1 Z 1 1
5 6 5
E(Y ) = y h(y )dy = 5 y 5 dy = y =
0 0 6 y =0 6
Z 1 Z 1
5
E(Y 2 ) = y 2 h(y )dy = 5 y 6 dy =
0 0 7
2 r
2 5 2 5 5 5
V (Y ) = E(Y ) − (E(Y )) = − = , σY =
7 6 252 252
beamer-tu-log
Variance Covariance Correlation coefficient
Theorem about V (a X + b)
beamer-tu-log
Variance Covariance Correlation coefficient
Theorem about V (a X + b)
Let X be an RV with variance V (X ). Then:
V (a X + b) = a2 V (X )
beamer-tu-log
Variance Covariance Correlation coefficient
Theorem about V (a X + b)
Let X be an RV with variance V (X ). Then:
V (a X + b) = a2 V (X )
Proof:
beamer-tu-log
Variance Covariance Correlation coefficient
Theorem about V (a X + b)
Let X be an RV with variance V (X ). Then:
V (a X + b) = a2 V (X )
Proof:
V (a X + b) = E{(a X + b − µaX +b )2 }
beamer-tu-log
Variance Covariance Correlation coefficient
Theorem about V (a X + b)
Let X be an RV with variance V (X ). Then:
V (a X + b) = a2 V (X )
Proof:
V (a X + b) = E{(a X + b − µaX +b )2 }
= E{(a X + b − (aµX + b))2 }
beamer-tu-log
Variance Covariance Correlation coefficient
Theorem about V (a X + b)
Let X be an RV with variance V (X ). Then:
V (a X + b) = a2 V (X )
Proof:
V (a X + b) = E{(a X + b − µaX +b )2 }
= E{(a X + b − (aµX + b))2 }
= E{(a X − a µX )2 }
beamer-tu-log
Variance Covariance Correlation coefficient
Theorem about V (a X + b)
Let X be an RV with variance V (X ). Then:
V (a X + b) = a2 V (X )
Proof:
V (a X + b) = E{(a X + b − µaX +b )2 }
= E{(a X + b − (aµX + b))2 }
= E{(a X − a µX )2 } = E{a2 (X − µX )2 }
beamer-tu-log
Variance Covariance Correlation coefficient
Theorem about V (a X + b)
Let X be an RV with variance V (X ). Then:
V (a X + b) = a2 V (X )
Proof:
V (a X + b) = E{(a X + b − µaX +b )2 }
= E{(a X + b − (aµX + b))2 }
= E{(a X − a µX )2 } = E{a2 (X − µX )2 }
= a2 E{(X − µX )2 }
beamer-tu-log
Variance Covariance Correlation coefficient
Theorem about V (a X + b)
Let X be an RV with variance V (X ). Then:
V (a X + b) = a2 V (X )
Proof:
V (a X + b) = E{(a X + b − µaX +b )2 }
= E{(a X + b − (aµX + b))2 }
= E{(a X − a µX )2 } = E{a2 (X − µX )2 }
= a2 E{(X − µX )2 } = a2 V (X )
beamer-tu-log
Variance Covariance Correlation coefficient
Theorem about V (a X + b)
Let X be an RV with variance V (X ). Then:
V (a X + b) = a2 V (X )
Proof:
V (a X + b) = E{(a X + b − µaX +b )2 }
= E{(a X + b − (aµX + b))2 }
= E{(a X − a µX )2 } = E{a2 (X − µX )2 }
= a2 E{(X − µX )2 } = a2 V (X )
beamer-tu-log
Variance Covariance Correlation coefficient
And now . . .
1 Variance
Definition
Standard Deviation
Variance of linear combination of RV
2 Covariance
Meaning & Definition
Examples
3 Correlation coefficient
beamer-tu-log
Variance Covariance Correlation coefficient
What is covariance?
Dependence of realizations of 2 (or more) different RVs.
beamer-tu-log
Variance Covariance Correlation coefficient
What is covariance?
Dependence of realizations of 2 (or more) different RVs.
Definition
Let X and Y be RVs with µX = E(X ) and µY = E(Y ). Then
Notation: Cov(X , Y ), σX ,Y
|{z}
book
beamer-tu-log
Variance Covariance Correlation coefficient
What is covariance?
Dependence of realizations of 2 (or more) different RVs.
Definition
Let X and Y be RVs with µX = E(X ) and µY = E(Y ). Then
Notation: Cov(X , Y ), σX ,Y
|{z}
book
Remark
Covariance can be positive and negative (variance is always
nonnegative)
beamer-tu-log
Variance Covariance Correlation coefficient
Definition
Cov(X , Y ) = E{(X − µX )(Y − µY )}
Notation: Cov(X , Y ), σX ,Y
|{z}
book
beamer-tu-log
Variance Covariance Correlation coefficient
Definition
Cov(X , Y ) = E{(X − µX )(Y − µY )}
Notation: Cov(X , Y ), σX ,Y
|{z}
book
Alternative formula
beamer-tu-log
Variance Covariance Correlation coefficient
Definition
Cov(X , Y ) = E{(X − µX )(Y − µY )}
Notation: Cov(X , Y ), σX ,Y
|{z}
book
Alternative formula
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Let X and Y be RVs with µX = E(X ) and µY = E(Y ). Then
Notation: Cov(X , Y ), σX ,Y
|{z}
book
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Let X and Y be RVs with µX = E(X ) and µY = E(Y ). Then
Notation: Cov(X , Y ), σX ,Y
|{z}
book
Example 1
X , Y independent RVs
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Let X and Y be RVs with µX = E(X ) and µY = E(Y ). Then
Notation: Cov(X , Y ), σX ,Y
|{z}
book
Example 1
X , Y independent RVs
Cov(X , Y )
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Let X and Y be RVs with µX = E(X ) and µY = E(Y ). Then
Notation: Cov(X , Y ), σX ,Y
|{z}
book
Example 1
X , Y independent RVs
Cov(X , Y ) = E(XY ) − µX µY
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Let X and Y be RVs with µX = E(X ) and µY = E(Y ). Then
Notation: Cov(X , Y ), σX ,Y
|{z}
book
Example 1
X , Y independent RVs
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Let X and Y be RVs with µX = E(X ) and µY = E(Y ). Then
Notation: Cov(X , Y ), σX ,Y
|{z}
book
Example 1
X , Y independent RVs
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Cov(X , Y ) = E{(X − µX )(Y − µY )} = E(XY ) − µX µY
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Cov(X , Y ) = E{(X − µX )(Y − µY )} = E(XY ) − µX µY
Example 2
X , Y independent RVs with joint PDF
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Cov(X , Y ) = E{(X − µX )(Y − µY )} = E(XY ) − µX µY
Example 2
X , Y independent RVs with joint PDF
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Cov(X , Y ) = E{(X − µX )(Y − µY )} = E(XY ) − µX µY
Example 2
X , Y independent RVs with joint PDF
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Cov(X , Y ) = E{(X − µX )(Y − µY )} = E(XY ) − µX µY
Example 2
X , Y independent RVs with joint PDF
E(X ) = 59 , E(X 2 ) = 5
14
, V (X ) = 55
1134
, E(Y ) = 56 , E(Y 2 ) = 75 , V (Y ) = 5
252
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Cov(X , Y ) = E{(X − µX )(Y − µY )} = E(XY ) − µX µY
Example 2
X , Y independent RVs with joint PDF
E(X ) = 59 , E(X 2 ) = 14
5 55
, V (X ) = 1134 , E(Y ) = 56 , E(Y 2 ) = 75 , V (Y ) = 5
252
R1R1 2
E(X , Y ) = 0 x x · y · 10 x y dy dx = 10 21
beamer-tu-log
Variance Covariance Correlation coefficient
Examples
Covariance
Cov(X , Y ) = E{(X − µX )(Y − µY )} = E(XY ) − µX µY
Example 2
X , Y independent RVs with joint PDF
E(X ) = 59 , E(X 2 ) = 14
5 55
, V (X ) = 1134 , E(Y ) = 56 , E(Y 2 ) = 75 , V (Y ) = 5
252
R1R1 2
E(X , Y ) = 0 x x · y · 10 x y dy dx = 10 21
10
Cov(X , Y ) = E(XY ) − µX µY = 21 − 59 56 = 378
5
beamer-tu-log
Variance Covariance Correlation coefficient
And now . . .
1 Variance
Definition
Standard Deviation
Variance of linear combination of RV
2 Covariance
Meaning & Definition
Examples
3 Correlation coefficient
beamer-tu-log
Variance Covariance Correlation coefficient
beamer-tu-log
Variance Covariance Correlation coefficient
Observations
−1 ≤ ρ(X , Y ) ≤ 1
beamer-tu-log
Variance Covariance Correlation coefficient
Observations
−1 ≤ ρ(X , Y ) ≤ 1
If X and Y are independent, then ρ(X , Y ) = 0.
beamer-tu-log
Variance Covariance Correlation coefficient
Observations
−1 ≤ ρ(X , Y ) ≤ 1
If X and Y are independent, then ρ(X , Y ) = 0.
beamer-tu-log
Variance Covariance Correlation coefficient
Observations
−1 ≤ ρ(X , Y ) ≤ 1
If X and Y are independent, then ρ(X , Y ) = 0.