Professional Documents
Culture Documents
PHP 2510 Expectation, Variance, Covariance, Correlation
PHP 2510 Expectation, Variance, Covariance, Correlation
Expected value
Synonyms for expected value: average, mean
The expectation or expected value of a random variable X is a
weighted average of its possible outcomes.
For a discrete random variable, each outcome is weighted by its
probability of occurrence, using the mass function:
X
X
E(X) =
xi P (X = xi ) =
xi p(xi )
i
p(k)
.125
.375
.375
.125
3
X
k p(k)
k=0
36 if the number is 12
X=
1 if the number is not 12
Find E(X), or your expected winnings.
p(k)
36
1
38
37
38
= (1)
37
38
+ (36)
1
38
= 0.026
Question: What the expected return in 100 plays of roulette?
k
X
E(X) =
k e
=
k!
k=0
X
k=1
k1
(1 )
Z 4
2 4
1
1x
x dx =
= 2.5
3
3
2
1
1
10
11
aE(X) + b
12
Example. Let X denote the daily low temperature for each day in
September, and let E(X) denote its average. Suppose E(X) = 65,
measured in degrees Fahrenheit. What is the mean temperature in
degrees Celsius?
To convert X from F to C, define a new random variable
160
5
Y = X
9
9
Then using the rule about linear combinations,
E(Y ) =
PHP 2510 Oct 8, 2008
5
160
E(X)
18.3
9
9
13
n
X
i=1
n
X
xi p(xi )
xi (1/n)
i=1
n
1X
xi
n i=1
14
(xi )2 p(xi )
15
var(X)
= E{(X 0.65)2 }
X
=
(xi 0.65)2 p(xi )
i
16
Properties of variance
If a and b are constants, then
var(aX + b) =
a2 var(X)
17
=
=
n
X
(xi x)2 p(xi )
i=1
n
X
i=1
n
=
It is more common to use
for this later.
1X
(xi x)2
n i=1
1
n1
instead of
1
n.
18
Standard deviation
The standard deviation measures the average distance of a random
p
variable X from its mean. By definition, SD(X) = var(X).
19
Example.
In September in Providence, noon time temperature has mean 65
and variance 100.
What is the SD of the temperatures?
Select a day at random. What does SD tell us about the
temperature on that day, relative to the average temperature?
Suppose noon time temps are normally distributed. Should a
noon time temperature of 85 be considered unusual? Why or
why not?
20
E(X)
var(X)
n x
nx
(1
)
x
n(1 )
e x /x!
(1 )x1
1/
1/ 2
1/
1/2
Normal(, 2 )
Exponential()
(1/)e/x
21
22
Covariance
Covariance measures the degree to which two variables differ from
their mean. It is an average:
cov(X, Y ) = E {(X X )(Y Y )}
cov(X, Y ) > 0 means that X and Y tend to vary in the same
direction relative to their means (both higher or both lower).
They have a positive association.
Example: height and weight
cov(X, Y ) < 0 means that X and Y tend to vary in opposite
directions relative to their means (when one is higher, the other
is lower). They have a negative association.
Example: weight and minutes of exercise per day
cov(X, Y ) = 0 generally means that X and Y are not associated.
PHP 2510 Oct 8, 2008
23
SUMMARY STATISTICS
Variable |
Obs
Mean
Std. Dev.
----------+--------------------------------map24 |
326
76.55951
7.351673
bmi |
326
25.10736
6.217994
24
100
map24
80
60
40
20
40
bmi
60
25
Computing covariance
For individual i, let mi denote MAP and let bi denote BMI.
In this table, prod represents
(mi m) (bi b)
Recall m = 76.6 and b = 25.1.
To compute covariance, we take the average (sample mean) of the
products (following pages)
DATA EXCERPT
map24 (m_i)
bmi (b_i)
prod
------------------------------------1.
72.7
15.9
35.53593
2.
69.3
16.3
63.9371
3.
81
16.3 -39.10899
4.
63.7
16.3
113.2583
5.
74
16.6
21.77467
6.
73.3
16.6
27.7298
PHP 2510 Oct 8, 2008
26
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
69.3
74.7
82.7
73
66.3
74
73
84.3
68.3
70.3
16.9
16.9
17
17.2
17.2
17.8
17.8
17.9
17.9
18
59.58139
15.26169
-49.78313
28.14632
81.12561
18.70326
26.01062
-55.78852
59.52924
44.48857
SUMMARY STATISTICS
Variable |
Obs
Mean
---------+----------------------prod |
326
13.2753
27
cd
ov(X, Y ) =
n
X
(xi x) (yi y) p(xi , yi )
i=1
n
1X
(xi x) (yi y)
n i=1
28
corr(X,
d
Y)=
(1/n)
Pn
i=1 (xi
x)(yi y)
Sx Sy
29
SUMMARY STATISTICS
Variable |
Obs
Mean
Std. Dev.
Min
Max
---------+----------------------------------------------------prod |
326
13.2753
53.69735 -131.3067
391.1627
map24 |
326
76.55951
7.351673
55
101.3
bmi |
326
25.10736
6.217994
15.9
57.2
CORRELATION COEFFICIENT
(obs=326)
|
bmi
---------+-----------------map24 |
0.2913
Using the numbers on the table above, how would you obtain the
correlation coefficient?
30