15
Definition of , the expected value of a function of X: n i i i n n p x g p x g p x g X g E 1 1 1 ... 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE X g E 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.

Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

Embed Size (px)

Citation preview

Page 1: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

Definition of , the expected value of a function of X:

n

iiinn pxgpxgpxgXgE

111 ...

1

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

XgE

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.

Page 2: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

Definition of , the expected value of a function of X:

Example:

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

n

iiinn pxpxpxXE

1

221

21

2 ...

n

iiinn pxgpxgpxgXgE

111 ...

2

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

XgE

Page 3: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

3

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

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

2 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.

Page 4: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

4

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

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

2 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.

Page 5: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

5

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

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

2 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.

Page 6: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

6

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

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

2 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.

Page 7: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

7

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

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

2 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.

Page 8: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

8

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

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

2 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.

Page 9: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

9

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

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

2 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.

Page 10: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

10

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

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

2 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.

Page 11: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

11

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

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

2 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.

Page 12: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

12

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

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

2 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.

Page 13: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

13

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

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.

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

2 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

Page 14: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

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

2 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

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

EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE

7XE

83.542 XE

22 XEXE

Page 15: Definition of, the expected value of a function of X : 1 EXPECTED VALUE OF A FUNCTION OF A RANDOM VARIABLE To find the expected value of a function of

Copyright Christopher Dougherty 2012.

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, fourth edition 2011, 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.

2012.10.29