You are on page 1of 15

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

Definition of E [ g ( X )] , the expected value of a function of X:


n
E [ g ( X )] = g ( x1 ) p1 + ... + g ( x n ) pn = ∑ g ( x i ) pi
i =1

To find the expected value of a function of a random variable, one calculates all the possible
values of the function, weights them by the corresponding probabilities, and sums the
results.
1
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

Definition of E [ g ( X )] , the expected value of a function of X:


n
E [ g ( X )] = g ( x1 ) p1 + ... + g ( x n ) pn = ∑ g ( x i ) pi
i =1

Example:

E (X )= x
n
2 2
1 p1 + ... + x pn = ∑ x i2 pi
2
n
i =1

For example, the expected value of X2 is found by calculating all its possible values,
multiplying them by the corresponding probabilities, and summing.

2
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… … …... ……... 7 6/36 49 8.17
… … …... ……... 8 5/36 64 8.89
… … …... ……... 9 4/36 81 9.00
… … …... ……... 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

The calculation of the expected value of a function of a random variable will be outlined in
general and then illustrated with an example.

3
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… … …... ……... 7 6/36 49 8.17
… … …... ……... 8 5/36 64 8.89
… … …... ……... 9 4/36 81 9.00
… … …... ……... 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

First one makes a list of the possible values of X and the corresponding probabilities.

4
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… … …... ……... 7 6/36 49 8.17
… … …... ……... 8 5/36 64 8.89
… … …... ……... 9 4/36 81 9.00
… … …... ……... 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

Next the function of X is calculated for each possible value of X.

5
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… … …... ……... 7 6/36 49 8.17
… … …... ……... 8 5/36 64 8.89
… … …... ……... 9 4/36 81 9.00
… … …... ……... 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

Then, one at a time, the value of the function is weighted by its corresponding probability.

6
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… … …... ……... 7 6/36 49 8.17
… … …... ……... 8 5/36 64 8.89
… … …... ……... 9 4/36 81 9.00
… … …... ……... 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

This is done individually for each possible value of X.

7
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… … …... ……... 7 6/36 49 8.17
… … …... ……... 8 5/36 64 8.89
… … …... ……... 9 4/36 81 9.00
… … …... ……... 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

The sum of the weighted values is the expected value of the function of X.

8
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… … …... ……... 7 6/36 49 8.17
… … …... ……... 8 5/36 64 8.89
… … …... ……... 9 4/36 81 9.00
… … …... ……... 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

The process will be illustrated for X2, where X is the random variable defined in the first
sequence. The 11 possible values of X and the corresponding probabilities are listed.

9
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… … …... ……... 7 6/36 49 8.17
… … …... ……... 8 5/36 64 8.89
… … …... ……... 9 4/36 81 9.00
… … …... ……... 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

First one calculates the possible values of X2.

10
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… … …... ……... 7 6/36 49 8.17
… … …... ……... 8 5/36 64 8.89
… … …... ……... 9 4/36 81 9.00
… … …... ……... 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

The first value is 4, which arises when X is equal to 2. The probability of X being equal to 2
is 1/36, so the weighted function is 4/36, which we shall write in decimal form as 0.11.

11
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… … …... ……... 7 6/36 49 8.17
… … …... ……... 8 5/36 64 8.89
… … …... ……... 9 4/36 81 9.00
… … …... ……... 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

Similarly for all the other possible values of X.

12
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… … …... ……... 7 6/36 49 8.17
… … …... ……... 8 5/36 64 8.89
… … …... ……... 9 4/36 81 9.00
… … …... ……... 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

The expected value of X2 is the sum of its weighted values in the final column. It is equal to
54.83. It is the average value of the figures in the previous column, taking the differing
probabilities into account.
13
EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

xi pi g(xi) g(xi ) pi xi pi xi2 xi2 pi


x1 p1 g(x1) g(x1) p1 2 1/36 4 0.11
x2 p2 g(x2) g(x2) p2 3 2/36 9 0.50
x3 p3 g(x3) g(x3) p3 4 3/36 16 1.33
… … …... ……... 5 4/36 25 2.78
… … …... ……... 6 5/36 36 5.00
… E…( X 2 )…...
= 54.83……... 7 6/36 49 8.17
… E ( X )…...
… =7 ……... 8 5/36 64 8.89
… … …... ……...
E…( X 2 )…...
9 4/36 81 9.00
… ≠ ( E ( X……...
))2 10 3/36 100 8.83
… … …... ……... 11 2/36 121 6.72
xn pn g(xn) g(xn) pn 12 1/36 144 4.00

Σ g(xi) pi 54.83

Note that E(X2) is not the same thing as E(X), squared. In the previous sequence we saw
that E(X) for this example was 7. Its square is 49.

14
Copyright Christopher Dougherty 2016.

These slideshows may be downloaded by anyone, anywhere for personal use.


Subject to respect for copyright and, where appropriate, attribution, they may be
used as a resource for teaching an econometrics course. There is no need to
refer to the author.

The content of this slideshow comes from Section R.2 of C. Dougherty,


Introduction to Econometrics, fifth edition 2016, Oxford University Press.
Additional (free) resources for both students and instructors may be
downloaded from the OUP Online Resource Centre
http://www.oup.com/uk/orc/bin/9780199567089/.

Individuals studying econometrics on their own who feel that they might benefit
from participation in a formal course should consider the London School of
Economics summer school course
EC212 Introduction to Econometrics
http://www2.lse.ac.uk/study/summerSchools/summerSchool/Home.aspx
or the University of London International Programmes distance learning course
EC2020 Elements of Econometrics
www.londoninternational.ac.uk/lse.

2015.12.17

You might also like