Tutorial 4 Expected Value, Variance and Moment Generating Function
Tutorial 4 Expected Value, Variance and Moment Generating Function
Tutorial 4
Expected Value, Variance and
Moment Generating Function
2
Expected Value
If X is a discrete random variable having a
probability mass function p(x), the
expectation or the expected value of X, is
defined by
E[X] is a weighted average of the possible
values that X can take on, each value being
weighted by the prob. that X assumes it.
>
=
0 ) ( :
) ( ] [
x p x
x xp X E
3
Expected Value
If X is a continuous random variable having a
probability density function f(x), then the
expected value of X is defined by
If a and b are constants, then
}
= dx x xf X E ) ( ] [
b X aE b aX E + = + ] [ ] [
4
Example 1
Calculate E[X] if X if a Poisson random variable
with parameter .
= =
=
=
=
e e
k
e
i
e
i
e
i
ie
X E
k
k
i
i
i
i
i
i
0
1
1
1
0
)! (
)! 1 (
)! 1 (
!
] [
5
Example 2
Calculate the expectation of a random variable
uniformly distributed over (a, b).
The expected value of a random variable uniformly
distributed over the interval (a, b) is just the
midpoint of the interval.
2
) ( 2
] [
2 2
b a
a b
a b
dx
a b
x
X E
b
a
+
=
=
}
6
Variance
If X is a random variable with mean ,
then the variance of X is defined by
The variance of X measures the expected
square of the deviation of X from its expected
value.
] ) [( ) (
2
= X E X Var
7
Variance
2 2
2 2 2
2 2
2 2
2
2
] [
2 ] [
) ( ) ( 2 ) (
) ( ) 2 (
) ( ) (
] ) [( ) (
=
+ =
+ =
+ =
=
=
X E
X E
x p x xp x p x
x p x x
x p x
X E X Var
x x x
x
x
2 2
]) [ ( ] [ ) ( X E X E X Var =
8
Variance
If a and b are constants, then
The square root of the Var(X) is called
the standard deviation of X.
) ( ) (
2
X Var a b aX Var = +
9
Example 3
Calculate Var(X) when x represents the
outcome when a fair die is rolled.
2
7
] [ = X E
6
91
)
6
1
( 6 )
6
1
( 5 )
6
1
( 4 )
6
1
( 3 )
6
1
( 2 )
6
1
( 1
] [
2 2 2 2 2
2
=
+ + + + + =
X E
12
35
)
2
7
(
6
91
) (
2
= = X Var
10
Moment Generating Functions
Moment generating function is define as
follow:
| |
f(x) density with continuous is X if ) ( e
p(x) function mass with discrete is X if ) (
) (
tx
}
=
=
=
dx x f
or
x p e
e E t M
x
tx
tX
11
Moment Generating Functions
| |
| |
| | E[X] (0) M'
(t) M'
Then,
) 0 (
= =
=
(
=
=
X
tX
tX
tX
Xe E
Xe E
e
dt
d
E
e E
dt
d
12
Moment Generating Functions
Similarly,
| |
| | ] E[X (0) ' M'
)] ( [
] [
) ( ' (t) ' M'
2 ) 0 ( 2
2
= =
=
=
=
=
X
tX
tX
tX
e X E
e X E
Xe
dt
d
E
Xe E
dt
d
t M
dt
d
13
Moment Generating Functions
In general, the nth derivative of M(t) is
given by
Implying that
] [ ) (
tX n n
e X E t M =
1 > n
] [ ) 0 (
n n
X E M =
1 > n
14
Example 4
Binomial Dist. (n,p)
| |
t n t
n t
k n k t
k n k tk
tX
pe - p pe n t M
- p pe
p pe
k
n
p p
k
n
e
e E t M
1
n
0 k
n
0 k
) 1 ( ) ( '
) 1 (
) 1 ( ) (
) 1 (
) (
+ =
+ =
|
|
.
|
\
|
=
|
|
.
|
\
|
=
=
15
Example 4 (cont)
t n t
pe - p pe n t M
1
) 1 ( ) ( '
+ =
t n t t n t
pe - p pe n pe - p pe n n
t M
1 2 2
) 1 ( ) ( ) 1 ( ) 1 (
) ( ' '
+ + + =
Mean = M(0) = np
E[X
2
] = M(0) = n(n-1)p + np
Variance = E[X
2
] (E[X])
= n(n-1)p + np (np)
= np(1-p)