Class03 8
Class03 8
Class03 8
010 Class 8
Expectation, Functions of a Random Variable
For a discrete x:
E ( x) = x = ∑ x p (x )
i x i
For a continuous x:
+∞
E ( x) = x =
−∞
∫ xf ( x)dx
x
[
Var ( x ) = E ( x - x )
2
]
Derive these for uniform & triangular distributions
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
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
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 }