You are on page 1of 2

1.017/1.

010 Class 8
Expectation, Functions of a Random Variable

Mean, variance of random variables

Expectation (population mean) of x... E[x]

For a discrete x:
E ( x) = x = ∑ x p (x )
i x i

For a continuous x:
+∞

E ( x) = x =
−∞
∫ xf ( x)dx
x

(Population) variance of x... Var[x]:

[
Var ( x ) = E ( x - x )
2
]
Derive these for uniform & triangular distributions

Functions of a random variable

y = g(x) x is a random variable with CDF Fx(x)


y is a random variable with CDF Fy(y) since it depends on x

Derived distribution problems

Derive Fy(y) from Fx(x) using either of these options:

1. Analytical derivation
Apply definitions of y, Fx(x), and Fy(y).

Fy ( y ) = P[ y ≤ y ] = P[ g ( x ) ≤ y ] = P[ x = {x | g ( x) ≤ y}]

2. Stochastic simulation
Generate many realizations of x, compute y for each replicate,
construct empirical Fy(y) from y replicates

Example (analytical derivation): Distribution of y = x2 for a uniformly


distributed x:

Uniform distribution centered on 0:

1
y = g ( x) = x 2
x +1
Fx ( x) = ; f x ( x) = 1 ; − 1 ≤ x ≤ 1
2
Fy ( y ) = P[ y ≤ y ] = P[ g ( x ) ≤ y ] = P[ x = {x | g ( x) ≤ y ]
Fy ( y ) = P[ x = {x | x 2 ≤ y ] = P[− y 0.5 ≤ x ≤ y 0.5 ] = Fx ( y 0.5 ) − Fx (− y 0.5 ) = y 0.5 ; 0 ≤ y ≤1

Uniform distribution centered on 0.5 (note need to split y interval into 2 parts):

y = g ( x) = x 2
Fx ( x) = ( x + 1) / 3 ; f x ( x) = 1 / 3 ; − 1 ≤ x ≤ 2
Fy ( y ) = P[ y ≤ y ] = P[ g ( x ) ≤ y ] = P[ x = {x | g ( x) ≤ y ]
2 y 0.5
Fy ( y ) = P[ x = {x | x 2 ≤ y ] = P[− y 0.5 ≤ x ≤ y 0.5 ] = Fx ( y 0.5 ) − Fx (− y 0.5 ) = ; 0 ≤ y ≤1
3
= P[ x = {x | x 2 ≤ y ] = P[−1 ≤ x ≤ y 0.5 ] = Fx ( y 0.5 ) − Fx (−1) = ( y 0.5 + 1) / 3 ; 1 ≤ y ≤ 4

Mean and variance of y = g(x) :

E ( y ) = E[ g ( x )] = ∑ g(x )p (x )
i
i x i

+∞

E ( y ) = E[ g ( y )] = ∫ g ( x) f ( x)dx
−∞
x

{
Var ( y ) = Var[ g ( y )] = E [ g ( x ) - g ( x )] 2 }

Copyright 2003 Massachusetts Institute of Technology


Last modified Oct. 8, 2003

You might also like